Logo ROOT   master
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 #include <vector>
18 
19 class TBuffer3D;
20 class TGLFaceSet;
21 class TGeoCompositeShape;
22 
23 class TEveGeoPolyShape : public TGeoBBox
24 {
25  friend class TEveGeoPolyShapeGL;
26 
27 private:
28  TEveGeoPolyShape(const TEveGeoPolyShape&); // Not implemented
29  TEveGeoPolyShape& operator=(const TEveGeoPolyShape&); // Not implemented
30 
31 protected:
32  std::vector<Double_t> fVertices;
33  std::vector<Int_t> fPolyDesc;
35 
36  virtual void FillBuffer3D(TBuffer3D& buffer, Int_t reqSections, Bool_t localFrame) const;
37 
38  struct Edge_t
39  {
42  {
43  if (i <= j) { fI = i; fJ = j; }
44  else { fI = j; fJ = i; }
45  }
46 
47  bool operator<(const Edge_t& e) const
48  {
49  if (fI == e.fI)
50  return fJ < e.fJ;
51  else
52  return fI < e.fI;
53  }
54  };
55 
56 public:
58  virtual ~TEveGeoPolyShape() {}
59 
60  static TEveGeoPolyShape* Construct(TGeoCompositeShape *cshp, Int_t n_seg);
61 
62  void SetFromFaceSet(TGLFaceSet* fs);
63 
64  virtual const TBuffer3D& GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
65  virtual TBuffer3D* MakeBuffer3D() const;
66 
67  ClassDef(TEveGeoPolyShape, 1); // A shape with arbitrary tesselation for visualization of CSG shapes.
68 };
69 
70 #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:43
bool Bool_t
Definition: RtypesCore.h:61
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:322
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:44
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.