Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:41

0001 // @(#)root/eve:$Id$
0002 // Author: Matevz Tadel 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TEveGeoShape
0013 #define ROOT_TEveGeoShape
0014 
0015 #include "TEveShape.h"
0016 
0017 class TGeoShape;
0018 class TGeoHMatrix;
0019 class TGeoCompositeShape;
0020 class TEveGeoShapeExtract;
0021 class TBuffer3D;
0022 
0023 class TEveGeoShape : public TEveShape
0024 {
0025 private:
0026    TEveGeoShape(const TEveGeoShape&);            // Not implemented
0027    TEveGeoShape& operator=(const TEveGeoShape&); // Not implemented
0028 
0029 protected:
0030    Int_t               fNSegments;
0031    TGeoShape          *fShape;
0032    TGeoCompositeShape *fCompositeShape; //! Temporary holder (if passed shape is composite shape).
0033 
0034    static TGeoManager *fgGeoMangeur;
0035 
0036    static TEveGeoShape* SubImportShapeExtract(TEveGeoShapeExtract* gse, TEveElement* parent);
0037    TEveGeoShapeExtract* DumpShapeTree(TEveGeoShape* geon, TEveGeoShapeExtract* parent=nullptr);
0038 
0039    TGeoShape* MakePolyShape();
0040 
0041 public:
0042    TEveGeoShape(const char* name="TEveGeoShape", const char* title=nullptr);
0043    ~TEveGeoShape() override;
0044 
0045    TObject* GetObject(const TEveException&) const override
0046    { const TObject* obj = this; return const_cast<TObject*>(obj); }
0047 
0048    Int_t       GetNSegments()  const { return fNSegments; }
0049    TGeoShape*  GetShape()      const { return fShape;     }
0050    void        SetNSegments(Int_t s);
0051    void        SetShape(TGeoShape* s);
0052 
0053    void ComputeBBox() override;
0054    void Paint(Option_t* option="") override;
0055 
0056    void Save(const char* file, const char* name="Extract");
0057    void SaveExtract(const char* file, const char* name);
0058    void WriteExtract(const char* name);
0059 
0060    static TEveGeoShape* ImportShapeExtract(TEveGeoShapeExtract* gse, TEveElement* parent=nullptr);
0061 
0062    // GeoProjectable
0063    virtual TBuffer3D*   MakeBuffer3D();
0064    TClass*      ProjectedClass(const TEveProjection* p) const override;
0065 
0066    static TGeoManager*  GetGeoMangeur();
0067    static TGeoHMatrix*  GetGeoHMatrixIdentity();
0068 
0069    ClassDefOverride(TEveGeoShape, 0); // 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).
0070 };
0071 
0072 //------------------------------------------------------------------------------
0073 
0074 class TEveGeoShapeProjected : public TEveShape,
0075                               public TEveProjected
0076 {
0077 private:
0078    TEveGeoShapeProjected(const TEveGeoShapeProjected&);            // Not implemented
0079    TEveGeoShapeProjected& operator=(const TEveGeoShapeProjected&); // Not implemented
0080 
0081 protected:
0082    TBuffer3D   *fBuff;
0083 
0084    void SetDepthLocal(Float_t d) override;
0085 
0086 public:
0087    TEveGeoShapeProjected();
0088    ~TEveGeoShapeProjected() override;
0089 
0090    void SetProjection(TEveProjectionManager* proj, TEveProjectable* model) override;
0091    void UpdateProjection() override;
0092    TEveElement* GetProjectedAsElement() override { return this; }
0093 
0094    void ComputeBBox() override;
0095 
0096    ClassDefOverride(TEveGeoShapeProjected, 0);
0097 };
0098 
0099 #endif