TEveGeoShape.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveGeoShape.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_TEveGeoShape
00013 #define ROOT_TEveGeoShape
00014 
00015 #include "TEveShape.h"
00016 
00017 class TGeoShape;
00018 class TGeoCompositeShape;
00019 class TEveGeoShapeExtract;
00020 class TBuffer3D;
00021 
00022 class TEveGeoShape : public TEveShape
00023 {
00024 private:
00025    TEveGeoShape(const TEveGeoShape&);            // Not implemented
00026    TEveGeoShape& operator=(const TEveGeoShape&); // Not implemented
00027 
00028 protected:
00029    Int_t               fNSegments;
00030    TGeoShape          *fShape;
00031    TGeoCompositeShape *fCompositeShape; //! Temporary holder (if passed shape is composite shape).
00032 
00033    static TGeoManager *fgGeoMangeur;
00034 
00035    static TEveGeoShape* SubImportShapeExtract(TEveGeoShapeExtract* gse, TEveElement* parent);
00036    TEveGeoShapeExtract* DumpShapeTree(TEveGeoShape* geon, TEveGeoShapeExtract* parent=0);
00037 
00038    TGeoShape* MakePolyShape();
00039 
00040 public:
00041    TEveGeoShape(const char* name="TEveGeoShape", const char* title=0);
00042    virtual ~TEveGeoShape();
00043 
00044    virtual TObject* GetObject(const TEveException&) const
00045    { const TObject* obj = this; return const_cast<TObject*>(obj); }
00046 
00047    Int_t       GetNSegments()  const { return fNSegments; }
00048    TGeoShape*  GetShape()      const { return fShape;     }
00049    void        SetNSegments(Int_t s);
00050    void        SetShape(TGeoShape* s);
00051 
00052    virtual void ComputeBBox();
00053    virtual void Paint(Option_t* option="");
00054 
00055    void Save(const char* file, const char* name="Extract");
00056    void SaveExtract(const char* file, const char* name);
00057    void WriteExtract(const char* name);
00058 
00059    static TEveGeoShape* ImportShapeExtract(TEveGeoShapeExtract* gse, TEveElement* parent=0);
00060 
00061    // GeoProjectable
00062    virtual TBuffer3D*   MakeBuffer3D();
00063    virtual TClass*      ProjectedClass(const TEveProjection* p) const;
00064 
00065    static TGeoManager*  GetGeoMangeur();
00066 
00067    ClassDef(TEveGeoShape, 2); // Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TGeoShape's (without an active TGeoManager) and simplified geometries (needed for NLT projections).
00068 };
00069 
00070 //------------------------------------------------------------------------------
00071 
00072 class TEveGeoShapeProjected : public TEveShape,
00073                               public TEveProjected
00074 {
00075 private:
00076    TEveGeoShapeProjected(const TEveGeoShapeProjected&);            // Not implemented
00077    TEveGeoShapeProjected& operator=(const TEveGeoShapeProjected&); // Not implemented
00078 
00079 protected:
00080    TBuffer3D   *fBuff;
00081 
00082    virtual void SetDepthLocal(Float_t d);
00083 
00084 public:
00085    TEveGeoShapeProjected();
00086    virtual ~TEveGeoShapeProjected() {}
00087 
00088    virtual void SetProjection(TEveProjectionManager* proj, TEveProjectable* model);
00089    virtual void UpdateProjection();
00090    virtual TEveElement* GetProjectedAsElement() { return this; }
00091 
00092    virtual void ComputeBBox();
00093 
00094    ClassDef(TEveGeoShapeProjected, 0);
00095 };
00096 
00097 #endif

Generated on Tue Jul 5 14:14:56 2011 for ROOT_528-00b_version by  doxygen 1.5.1