]>
Commit | Line | Data |
---|---|---|
debf9f47 | 1 | #ifndef REVE_NLTProjector |
2 | #define REVE_NLTProjector | |
3 | ||
4 | #include "TNamed.h" | |
5 | #include "TString.h" | |
6 | ||
7 | namespace std { | |
8 | template<typename _Tp> class allocator; | |
9 | template<typename _Tp, typename _Alloc > class list; | |
10 | } | |
11 | ||
12 | class TGeoManager; | |
13 | class TGeoMatrix; | |
14 | class TBuffer3D; | |
15 | ||
16 | namespace Reve { | |
17 | class Vector; | |
18 | class PointSet; | |
19 | class NLTPolygonSet; | |
20 | class NLTPolygon; | |
21 | class TrackList; | |
22 | /**************************************************************************/ | |
23 | // NLTProjections | |
24 | /**************************************************************************/ | |
25 | class NLTProjection { | |
26 | public: | |
27 | enum Type_e { CFishEye, RhoZ, RhoPhi}; | |
28 | ||
29 | Float_t fDistortion; // sensible values from 0 to 0.01 | |
30 | ||
31 | virtual Bool_t AcceptSegment(Vector& /*v1*/, Vector& /*v2*/) {return kTRUE;} | |
32 | virtual Vector* Project(Vector* pnts, Int_t npnts, Bool_t create_new = kTRUE); | |
33 | NLTProjection():fDistortion(0.) {} | |
34 | ClassDef(NLTProjection, 0) | |
35 | }; | |
36 | ||
37 | class PhiZ: public NLTProjection { | |
38 | }; | |
39 | ||
40 | class RhoZ: public NLTProjection { | |
41 | public: | |
42 | virtual Bool_t AcceptSegment(Vector& v1, Vector& v2); | |
43 | virtual Vector* Project(Vector* pnts, Int_t npnts, Bool_t copy = kTRUE); | |
44 | ClassDef(RhoZ, 0) | |
45 | }; | |
46 | ||
47 | class CircularFishEye: public NLTProjection { | |
48 | public: | |
49 | virtual Vector* Project(Vector* pnts, Int_t npnts, Bool_t copy = kTRUE); | |
50 | ClassDef(CircularFishEye, 0) | |
51 | }; | |
52 | ||
53 | /**************************************************************************/ | |
54 | // NLTProjector | |
55 | /**************************************************************************/ | |
56 | class NLTProjector : public TNamed | |
57 | { | |
58 | protected: | |
59 | void CheckPoint(Int_t idx, Float_t* bbox); | |
60 | Bool_t IsFirstIdxHead(Int_t s0, Int_t s1, TBuffer3D* buff); | |
61 | ||
62 | private: | |
63 | NLTProjection* fProjection; | |
64 | ||
65 | Float_t fEps; // distance accounted in reducing the ponts | |
66 | ||
67 | // temporary variables cashed | |
68 | Int_t* fIdxMap; // map from original to projected and reduced point needed oly for geometry | |
69 | Int_t fNRPnts; // number of reduced and projected points | |
70 | Vector* fRPnts; // reduced and projected points | |
71 | ||
72 | void ReducePoints(Vector* p, Int_t N); | |
73 | void MakePolygonsFromBP(TBuffer3D* buff, std::list<NLTPolygon, std::allocator<NLTPolygon> >& pols); | |
74 | void MakePolygonsFromBS(TBuffer3D* buff, std::list<NLTPolygon, std::allocator<NLTPolygon> >& pols); | |
75 | void CleanUp(); | |
76 | ||
77 | public: | |
78 | NLTProjector(); | |
79 | virtual ~NLTProjector(); | |
80 | ||
81 | NLTPolygonSet* ProjectGeoShape(TBuffer3D* buff, Int_t useBuffPols=-1); | |
82 | void ProjectPointSet(PointSet* ps); | |
83 | void ProjectTrackList(TrackList* tl); | |
84 | ||
85 | void SetProjection(NLTProjection* p){ fProjection = p;} | |
86 | void SetProjection(NLTProjection::Type_e type, Float_t distort = 0.); | |
87 | NLTProjection* GetProjection(){ return fProjection; } | |
88 | ||
89 | void DumpBuffer(TBuffer3D* b); | |
90 | ClassDef(NLTProjector, 0) //GUI for editing TGLViewer attributes | |
91 | }; | |
92 | } | |
93 | #endif |