ROOT  6.06/09
Reference Guide
TEveGeoPolyShape.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 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_TEveGeoPolyShape
13 #define ROOT_TEveGeoPolyShape
14 
15 #include "TGeoBBox.h"
16 
17 class TBuffer3D;
18 class TGLFaceSet;
19 class TGeoCompositeShape;
20 
21 class TEveGeoPolyShape : public TGeoBBox
22 {
23  friend class TEveGeoPolyShapeGL;
24 
25 private:
26  TEveGeoPolyShape(const TEveGeoPolyShape&); // Not implemented
27  TEveGeoPolyShape& operator=(const TEveGeoPolyShape&); // Not implemented
28 
29 protected:
30  std::vector<Double_t> fVertices;
31  std::vector<Int_t> fPolyDesc;
33 
34  virtual void FillBuffer3D(TBuffer3D& buffer, Int_t reqSections, Bool_t localFrame) const;
35 
36  struct Edge_t
37  {
40  {
41  if (i <= j) { fI = i; fJ = j; }
42  else { fI = j; fJ = i; }
43  }
44 
45  bool operator<(const Edge_t& e) const
46  {
47  if (fI == e.fI)
48  return fJ < e.fJ;
49  else
50  return fI < e.fI;
51  }
52  };
53 
54 public:
56  virtual ~TEveGeoPolyShape() {}
57 
58  static TEveGeoPolyShape* Construct(TGeoCompositeShape *cshp, Int_t n_seg);
59 
60  void SetFromFaceSet(TGLFaceSet* fs);
61 
62  virtual const TBuffer3D& GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
63  virtual TBuffer3D* MakeBuffer3D() const;
64 
65  ClassDef(TEveGeoPolyShape, 1); // A shape with arbitrary tesselation for visualization of CSG shapes.
66 };
67 
68 #endif
std::vector< Int_t > fPolyDesc
Edge_t(Int_t i, Int_t j)
std::vector< Double_t > fVertices
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const
Fill the passed buffer 3D.
Implements a native ROOT-GL representation of an arbitrary set of polygons.
Definition: TGLFaceSet.h:25
virtual ~TEveGeoPolyShape()
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TEveGeoPolyShape()
Constructor.
Description of TEveGeoPolyShape.
TEveGeoPolyShape & operator=(const TEveGeoPolyShape &)
bool operator<(const Edge_t &e) const
void SetFromFaceSet(TGLFaceSet *fs)
Set data-members from a face-set.
unsigned int UInt_t
Definition: RtypesCore.h:42
ClassDef(TEveGeoPolyShape, 1)
Generic 3D primitive description class.
Definition: TBuffer3D.h:19
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fill static buffer 3D.
friend class TEveGeoPolyShapeGL
static TEveGeoPolyShape * Construct(TGeoCompositeShape *cshp, Int_t n_seg)
Static constructor from a composite shape.
virtual TBuffer3D * MakeBuffer3D() const
Create buffer 3D and fill it with point/segment/poly data.