Logo ROOT  
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
e
#define e(i)
Definition: RSha256.hxx:103
TEveGeoPolyShape::TEveGeoPolyShapeGL
friend class TEveGeoPolyShapeGL
Definition: TEveGeoPolyShape.h:25
TEveGeoPolyShape::TEveGeoPolyShape
TEveGeoPolyShape()
Constructor.
Definition: TEveGeoPolyShape.cxx:40
Int_t
int Int_t
Definition: RtypesCore.h:45
TEveGeoPolyShape::MakeBuffer3D
virtual TBuffer3D * MakeBuffer3D() const
Create buffer 3D and fill it with point/segment/poly data.
Definition: TEveGeoPolyShape.cxx:208
TEveGeoPolyShape::~TEveGeoPolyShape
virtual ~TEveGeoPolyShape()
Definition: TEveGeoPolyShape.h:58
TEveGeoPolyShape::Edge_t::fJ
Int_t fJ
Definition: TEveGeoPolyShape.h:40
TEveGeoPolyShape::Edge_t
Definition: TEveGeoPolyShape.h:39
TGeoBBox.h
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TEveGeoPolyShape::FillBuffer3D
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const
Fill the passed buffer 3D.
Definition: TEveGeoPolyShape.cxx:121
TEveGeoPolyShape::Edge_t::fI
Int_t fI
Definition: TEveGeoPolyShape.h:40
bool
TGeoCompositeShape
Class handling Boolean composition of shapes.
Definition: TGeoCompositeShape.h:28
TEveGeoPolyShape::fPolyDesc
std::vector< Int_t > fPolyDesc
Definition: TEveGeoPolyShape.h:33
TEveGeoPolyShape::fVertices
std::vector< Double_t > fVertices
Definition: TEveGeoPolyShape.h:32
TBuffer3D
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
TEveGeoPolyShape::operator=
TEveGeoPolyShape & operator=(const TEveGeoPolyShape &)
TEveGeoPolyShape::fNbPols
UInt_t fNbPols
Definition: TEveGeoPolyShape.h:34
TEveGeoPolyShape
Description of TEveGeoPolyShape.
Definition: TEveGeoPolyShape.h:24
TEveGeoPolyShape::TEveGeoPolyShape
TEveGeoPolyShape(const TEveGeoPolyShape &)
TGeoBBox
Box class.
Definition: TGeoBBox.h:18
TEveGeoPolyShape::Edge_t::operator<
bool operator<(const Edge_t &e) const
Definition: TEveGeoPolyShape.h:47
unsigned int
TEveGeoPolyShape::GetBuffer3D
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fill static buffer 3D.
Definition: TEveGeoPolyShape.cxx:196
TGLFaceSet
Implements a native ROOT-GL representation of an arbitrary set of polygons.
Definition: TGLFaceSet.h:23
TEveGeoPolyShape::SetFromFaceSet
void SetFromFaceSet(TGLFaceSet *fs)
Set data-members from a face-set.
Definition: TEveGeoPolyShape.cxx:111
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TEveGeoPolyShape::Edge_t::Edge_t
Edge_t(Int_t i, Int_t j)
Definition: TEveGeoPolyShape.h:41
TEveGeoPolyShape::Construct
static TEveGeoPolyShape * Construct(TGeoCompositeShape *cshp, Int_t n_seg)
Static constructor from a composite shape.
Definition: TEveGeoPolyShape.cxx:49
int