00001 // @(#)root/eve:$Id: TEveGeoPolyShape.h 37192 2010-12-02 15:54:26Z matevz $ 00002 // Author: Matevz Tadel 2007 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TEveGeoPolyShape 00013 #define ROOT_TEveGeoPolyShape 00014 00015 #include "TGeoBBox.h" 00016 00017 class TBuffer3D; 00018 class TGLFaceSet; 00019 class TGeoCompositeShape; 00020 00021 class TEveGeoPolyShape : public TGeoBBox 00022 { 00023 friend class TEveGeoPolyShapeGL; 00024 00025 private: 00026 TEveGeoPolyShape(const TEveGeoPolyShape&); // Not implemented 00027 TEveGeoPolyShape& operator=(const TEveGeoPolyShape&); // Not implemented 00028 00029 protected: 00030 std::vector<Double_t> fVertices; 00031 std::vector<Int_t> fPolyDesc; 00032 UInt_t fNbPols; 00033 00034 virtual void FillBuffer3D(TBuffer3D& buffer, Int_t reqSections, Bool_t localFrame) const; 00035 00036 struct Edge_t 00037 { 00038 Int_t fI, fJ; 00039 Edge_t(Int_t i, Int_t j) 00040 { 00041 if (i <= j) { fI = i; fJ = j; } 00042 else { fI = j; fJ = i; } 00043 } 00044 00045 bool operator<(const Edge_t& e) const 00046 { 00047 if (fI == e.fI) 00048 return fJ < e.fJ; 00049 else 00050 return fI < e.fI; 00051 } 00052 }; 00053 00054 public: 00055 TEveGeoPolyShape(); 00056 virtual ~TEveGeoPolyShape() {} 00057 00058 static TEveGeoPolyShape* Construct(TGeoCompositeShape *cshp, Int_t n_seg); 00059 00060 void SetFromFaceSet(TGLFaceSet* fs); 00061 00062 virtual const TBuffer3D& GetBuffer3D(Int_t reqSections, Bool_t localFrame) const; 00063 virtual TBuffer3D* MakeBuffer3D() const; 00064 00065 ClassDef(TEveGeoPolyShape, 1); // A shape with arbitrary tesselation for visualization of CSG shapes. 00066 }; 00067 00068 #endif