#ifndef ROOT_TEvePolygonSetProjected
#define ROOT_TEvePolygonSetProjected
#include "TEveElement.h"
#include "TEveProjectionBases.h"
#include "TNamed.h"
#include "TAtt3D.h"
#include "TAttBBox.h"
#include "TColor.h"
class TBuffer3D;
class TEveVector;
class TEvePolygonSetProjected : public TEveElementList,
public TEveProjected,
public TAtt3D,
public TAttBBox
{
friend class TEvePolygonSetProjectedGL;
friend class TEvePolygonSetProjectedEditor;
private:
TEvePolygonSetProjected(const TEvePolygonSetProjected&);
TEvePolygonSetProjected& operator=(const TEvePolygonSetProjected&);
protected:
struct Polygon_t
{
Int_t fNPnts;
Int_t* fPnts;
Polygon_t() : fNPnts(0), fPnts(0) {}
virtual ~Polygon_t() { delete [] fPnts; fNPnts=0; fPnts=0;}
Polygon_t& operator=(const Polygon_t& x)
{ fNPnts = x.fNPnts; fPnts = x.fPnts; return *this; }
Int_t FindPoint(Int_t pi)
{ for (Int_t i=0; i<fNPnts; ++i) if (fPnts[i] == pi) return i; return -1; }
};
typedef std::list<Polygon_t> vpPolygon_t;
typedef vpPolygon_t::iterator vpPolygon_i;
typedef vpPolygon_t::const_iterator vpPolygon_ci;
private:
TBuffer3D* fBuff;
Bool_t IsFirstIdxHead(Int_t s0, Int_t s1);
Float_t AddPolygon(std::list<Int_t, std::allocator<Int_t> >& pp, std::list<Polygon_t, std::allocator<Polygon_t> >& p);
Int_t* ProjectAndReducePoints();
Float_t MakePolygonsFromBP(Int_t* idxMap);
Float_t MakePolygonsFromBS(Int_t* idxMap);
protected:
vpPolygon_t fPols;
vpPolygon_t fPolsBS;
vpPolygon_t fPolsBP;
Int_t fNPnts;
TEveVector* fPnts;
Color_t fFillColor;
Color_t fLineColor;
Float_t fLineWidth;
Bool_t fHighlightFrame;
virtual void SetDepthLocal(Float_t d);
public:
TEvePolygonSetProjected(const char* n="TEvePolygonSetProjected", const char* t="");
virtual ~TEvePolygonSetProjected();
virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
virtual void UpdateProjection();
void ProjectBuffer3D();
virtual void ComputeBBox();
virtual void Paint(Option_t* option = "");
virtual void DumpPolys() const;
void DumpBuffer3D();
virtual Bool_t CanEditMainColor() const { return kTRUE; }
virtual void SetMainColor(Color_t color);
virtual Bool_t CanEditMainTransparency() const { return kTRUE; }
virtual Color_t GetFillColor() const { return fFillColor; }
virtual Color_t GetLineColor() const { return fLineColor; }
virtual Float_t GetLineWidth() const { return fLineWidth;}
virtual Bool_t GetHighlightFrame() const { return fHighlightFrame; }
virtual void SetFillColor(Color_t c) { fFillColor = c; }
virtual void SetLineColor(Color_t c) { fLineColor = c; }
virtual void SetLineWidth(Float_t lw) { fLineWidth = lw;}
virtual void SetHighlightFrame(Bool_t f) { fHighlightFrame = f; }
ClassDef(TEvePolygonSetProjected,0);
};
#endif
TEvePolygonSetProjected.h:1 TEvePolygonSetProjected.h:2 TEvePolygonSetProjected.h:3 TEvePolygonSetProjected.h:4 TEvePolygonSetProjected.h:5 TEvePolygonSetProjected.h:6 TEvePolygonSetProjected.h:7 TEvePolygonSetProjected.h:8 TEvePolygonSetProjected.h:9 TEvePolygonSetProjected.h:10 TEvePolygonSetProjected.h:11 TEvePolygonSetProjected.h:12 TEvePolygonSetProjected.h:13 TEvePolygonSetProjected.h:14 TEvePolygonSetProjected.h:15 TEvePolygonSetProjected.h:16 TEvePolygonSetProjected.h:17 TEvePolygonSetProjected.h:18 TEvePolygonSetProjected.h:19 TEvePolygonSetProjected.h:20 TEvePolygonSetProjected.h:21 TEvePolygonSetProjected.h:22 TEvePolygonSetProjected.h:23 TEvePolygonSetProjected.h:24 TEvePolygonSetProjected.h:25 TEvePolygonSetProjected.h:26 TEvePolygonSetProjected.h:27 TEvePolygonSetProjected.h:28 TEvePolygonSetProjected.h:29 TEvePolygonSetProjected.h:30 TEvePolygonSetProjected.h:31 TEvePolygonSetProjected.h:32 TEvePolygonSetProjected.h:33 TEvePolygonSetProjected.h:34 TEvePolygonSetProjected.h:35 TEvePolygonSetProjected.h:36 TEvePolygonSetProjected.h:37 TEvePolygonSetProjected.h:38 TEvePolygonSetProjected.h:39 TEvePolygonSetProjected.h:40 TEvePolygonSetProjected.h:41 TEvePolygonSetProjected.h:42 TEvePolygonSetProjected.h:43 TEvePolygonSetProjected.h:44 TEvePolygonSetProjected.h:45 TEvePolygonSetProjected.h:46 TEvePolygonSetProjected.h:47 TEvePolygonSetProjected.h:48 TEvePolygonSetProjected.h:49 TEvePolygonSetProjected.h:50 TEvePolygonSetProjected.h:51 TEvePolygonSetProjected.h:52 TEvePolygonSetProjected.h:53 TEvePolygonSetProjected.h:54 TEvePolygonSetProjected.h:55 TEvePolygonSetProjected.h:56 TEvePolygonSetProjected.h:57 TEvePolygonSetProjected.h:58 TEvePolygonSetProjected.h:59 TEvePolygonSetProjected.h:60 TEvePolygonSetProjected.h:61 TEvePolygonSetProjected.h:62 TEvePolygonSetProjected.h:63 TEvePolygonSetProjected.h:64 TEvePolygonSetProjected.h:65 TEvePolygonSetProjected.h:66 TEvePolygonSetProjected.h:67 TEvePolygonSetProjected.h:68 TEvePolygonSetProjected.h:69 TEvePolygonSetProjected.h:70 TEvePolygonSetProjected.h:71 TEvePolygonSetProjected.h:72 TEvePolygonSetProjected.h:73 TEvePolygonSetProjected.h:74 TEvePolygonSetProjected.h:75 TEvePolygonSetProjected.h:76 TEvePolygonSetProjected.h:77 TEvePolygonSetProjected.h:78 TEvePolygonSetProjected.h:79 TEvePolygonSetProjected.h:80 TEvePolygonSetProjected.h:81 TEvePolygonSetProjected.h:82 TEvePolygonSetProjected.h:83 TEvePolygonSetProjected.h:84 TEvePolygonSetProjected.h:85 TEvePolygonSetProjected.h:86 TEvePolygonSetProjected.h:87 TEvePolygonSetProjected.h:88 TEvePolygonSetProjected.h:89 TEvePolygonSetProjected.h:90 TEvePolygonSetProjected.h:91 TEvePolygonSetProjected.h:92 TEvePolygonSetProjected.h:93 TEvePolygonSetProjected.h:94 TEvePolygonSetProjected.h:95 TEvePolygonSetProjected.h:96 TEvePolygonSetProjected.h:97 TEvePolygonSetProjected.h:98 TEvePolygonSetProjected.h:99 TEvePolygonSetProjected.h:100 TEvePolygonSetProjected.h:101 TEvePolygonSetProjected.h:102 TEvePolygonSetProjected.h:103 TEvePolygonSetProjected.h:104 TEvePolygonSetProjected.h:105 TEvePolygonSetProjected.h:106 TEvePolygonSetProjected.h:107 TEvePolygonSetProjected.h:108 TEvePolygonSetProjected.h:109 TEvePolygonSetProjected.h:110 TEvePolygonSetProjected.h:111 TEvePolygonSetProjected.h:112 TEvePolygonSetProjected.h:113 TEvePolygonSetProjected.h:114 TEvePolygonSetProjected.h:115 TEvePolygonSetProjected.h:116 TEvePolygonSetProjected.h:117 TEvePolygonSetProjected.h:118 TEvePolygonSetProjected.h:119