Logo ROOT   6.14/05
Reference Guide
TEvePolygonSetProjected.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TEvePolygonSetProjected
13 #define ROOT_TEvePolygonSetProjected
14 
15 #include "TEveVector.h"
16 #include "TEveShape.h"
17 
18 class TBuffer3D;
19 
21  public TEveProjected
22 {
25 
26 private:
27  TEvePolygonSetProjected(const TEvePolygonSetProjected&); // Not implemented
28  TEvePolygonSetProjected& operator=(const TEvePolygonSetProjected&); // Not implemented
29 
30 protected:
31  struct Polygon_t
32  {
33  Int_t fNPnts; // number of points
34  Int_t* fPnts; // point indices
35 
36  Polygon_t() : fNPnts(0), fPnts(0) {}
37  virtual ~Polygon_t() { delete [] fPnts; fNPnts=0; fPnts=0; }
38 
40  { fNPnts = x.fNPnts; fPnts = x.fPnts; return *this; }
41 
43  {
44  for (Int_t i=0; i<fNPnts; ++i) {
45  if (fPnts[i] == pi) return i;
46  }
47  return -1;
48  }
49  };
50 
51  typedef std::list<Polygon_t> vpPolygon_t;
52  typedef vpPolygon_t::iterator vpPolygon_i;
53  typedef vpPolygon_t::const_iterator vpPolygon_ci;
54 
55 private:
56  TBuffer3D* fBuff; // buffer of projectable object
57 
59  Float_t AddPolygon(std::list<Int_t, std::allocator<Int_t> >& pp, std::list<Polygon_t, std::allocator<Polygon_t> >& p);
60 
64 
65 protected:
66  vpPolygon_t fPols; // polygons
67  vpPolygon_t fPolsBS; // polygons build from TBuffer3D segments
68  vpPolygon_t fPolsBP; // polygons build from TBuffer3D polygons
69 
70  Int_t fNPnts; // number of reduced and projected points
71  TEveVector* fPnts; // reduced and projected points
72 
73  virtual void SetDepthLocal(Float_t d);
74 
75  Float_t PolygonSurfaceXY(const Polygon_t& poly) const;
76 
77 public:
78  TEvePolygonSetProjected(const char* n="TEvePolygonSetProjected", const char* t="");
79  virtual ~TEvePolygonSetProjected();
80 
81  virtual void ComputeBBox();
82 
84  virtual void UpdateProjection();
85  virtual TEveElement* GetProjectedAsElement() { return this; }
86 
87  void ProjectBuffer3D();
88 
89  virtual void DumpPolys() const;
90  void DumpBuffer3D();
91 
92  ClassDef(TEvePolygonSetProjected,0); // Set of projected polygons with outline; typically produced from a TBuffer3D.
93 
94 };
95 
96 #endif
Abstract base class for classes that hold results of a non-linear projection transformation.
Abstract base-class for 2D/3D shapes.
Definition: TEveShape.h:22
TEvePolygonSetProjected & operator=(const TEvePolygonSetProjected &)
std::list< Polygon_t > vpPolygon_t
static constexpr double pi
TEvePolygonSetProjected(const TEvePolygonSetProjected &)
Polygon_t & operator=(const Polygon_t &x)
float Float_t
Definition: RtypesCore.h:53
#define s0(x)
Definition: RSha256.hxx:90
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void ComputeBBox()
Override of virtual method from TAttBBox.
GL-renderer for TEvePolygonSetProjected class.
Float_t AddPolygon(std::list< Int_t, std::allocator< Int_t > > &pp, std::list< Polygon_t, std::allocator< Polygon_t > > &p)
Check if polygon has dimensions above TEveProjection::fgEps and add it to a list if it is not a dupli...
void DumpBuffer3D()
Dump information about currently projected buffer.
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
A set of projected polygons.
Manager class for steering of projections and managing projected objects.
Abstract base-class for non-linear projectable objects.
Float_t MakePolygonsFromBP(Int_t *idxMap)
Build polygons from list of buffer polygons.
virtual void DumpPolys() const
Dump information about built polygons.
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
This is virtual method from base-class TEveProjected.
Generic 3D primitive description class.
Definition: TBuffer3D.h:17
#define s1(x)
Definition: RSha256.hxx:91
Float_t MakePolygonsFromBS(Int_t *idxMap)
Build polygons from the set of buffer segments.
Int_t * ProjectAndReducePoints()
Project and reduce buffer points.
#define d(i)
Definition: RSha256.hxx:102
vpPolygon_t::const_iterator vpPolygon_ci
void ProjectBuffer3D()
Project current buffer.
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
virtual ~TEvePolygonSetProjected()
Destructor.
vpPolygon_t::iterator vpPolygon_i
Float_t PolygonSurfaceXY(const Polygon_t &poly) const
Calculate XY surface of a polygon.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
virtual void UpdateProjection()
This is virtual method from base-class TEveProjected.
const Int_t n
Definition: legend1.C:16
Bool_t IsFirstIdxHead(Int_t s0, Int_t s1)
Compare the two segments and check if the first index of first segment is starting.