Logo ROOT   6.14/05
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 "Rtypes.h"
16 #include "TGeoBBox.h"
17 
18 #include <vector>
19 
20 class TBuffer3D;
21 class TGLFaceSet;
22 class TGeoCompositeShape;
23 
24 class TEveGeoPolyShape : public TGeoBBox
25 {
26  friend class TEveGeoPolyShapeGL;
27 
28 private:
29  TEveGeoPolyShape(const TEveGeoPolyShape&); // Not implemented
30  TEveGeoPolyShape& operator=(const TEveGeoPolyShape&); // Not implemented
31 
32 protected:
33  std::vector<Double_t> fVertices;
34  std::vector<Int_t> fPolyDesc;
36 
37  virtual void FillBuffer3D(TBuffer3D& buffer, Int_t reqSections, Bool_t localFrame) const;
38 
39  struct Edge_t
40  {
43  {
44  if (i <= j) { fI = i; fJ = j; }
45  else { fI = j; fJ = i; }
46  }
47 
48  bool operator<(const Edge_t& e) const
49  {
50  if (fI == e.fI)
51  return fJ < e.fJ;
52  else
53  return fI < e.fI;
54  }
55  };
56 
57 public:
59  virtual ~TEveGeoPolyShape() {}
60 
61  static TEveGeoPolyShape* Construct(TGeoCompositeShape *cshp, Int_t n_seg);
62 
63  void SetFromFaceSet(TGLFaceSet* fs);
64 
65  virtual const TBuffer3D& GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
66  virtual TBuffer3D* MakeBuffer3D() const;
67 
68  ClassDef(TEveGeoPolyShape, 1); // A shape with arbitrary tesselation for visualization of CSG shapes.
69 };
70 
71 #endif
std::vector< Int_t > fPolyDesc
Box class.
Definition: TGeoBBox.h:17
bool operator<(const Edge_t &e) const
Edge_t(Int_t i, Int_t j)
std::vector< Double_t > fVertices
Implements a native ROOT-GL representation of an arbitrary set of polygons.
Definition: TGLFaceSet.h:21
virtual ~TEveGeoPolyShape()
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const
Fill the passed buffer 3D.
TEveGeoPolyShape()
Constructor.
Description of TEveGeoPolyShape.
#define ClassDef(name, id)
Definition: Rtypes.h:320
Class handling Boolean composition of shapes.
TEveGeoPolyShape & operator=(const TEveGeoPolyShape &)
void SetFromFaceSet(TGLFaceSet *fs)
Set data-members from a face-set.
unsigned int UInt_t
Definition: RtypesCore.h:42
Generic 3D primitive description class.
Definition: TBuffer3D.h:17
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fill static buffer 3D.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
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.