Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveGeoShape.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_TEveGeoShape
13 #define ROOT_TEveGeoShape
14 
15 #include "TEveShape.h"
16 
17 class TGeoShape;
18 class TGeoHMatrix;
19 class TGeoCompositeShape;
20 class TEveGeoShapeExtract;
21 class TBuffer3D;
22 
23 class TEveGeoShape : public TEveShape
24 {
25 private:
26  TEveGeoShape(const TEveGeoShape&); // Not implemented
27  TEveGeoShape& operator=(const TEveGeoShape&); // Not implemented
28 
29 protected:
30  Int_t fNSegments;
31  TGeoShape *fShape;
32  TGeoCompositeShape *fCompositeShape; //! Temporary holder (if passed shape is composite shape).
33 
34  static TGeoManager *fgGeoMangeur;
35 
36  static TEveGeoShape* SubImportShapeExtract(TEveGeoShapeExtract* gse, TEveElement* parent);
37  TEveGeoShapeExtract* DumpShapeTree(TEveGeoShape* geon, TEveGeoShapeExtract* parent=0);
38 
39  TGeoShape* MakePolyShape();
40 
41 public:
42  TEveGeoShape(const char* name="TEveGeoShape", const char* title=0);
43  virtual ~TEveGeoShape();
44 
45  virtual TObject* GetObject(const TEveException&) const
46  { const TObject* obj = this; return const_cast<TObject*>(obj); }
47 
48  Int_t GetNSegments() const { return fNSegments; }
49  TGeoShape* GetShape() const { return fShape; }
50  void SetNSegments(Int_t s);
51  void SetShape(TGeoShape* s);
52 
53  virtual void ComputeBBox();
54  virtual void Paint(Option_t* option="");
55 
56  void Save(const char* file, const char* name="Extract");
57  void SaveExtract(const char* file, const char* name);
58  void WriteExtract(const char* name);
59 
60  static TEveGeoShape* ImportShapeExtract(TEveGeoShapeExtract* gse, TEveElement* parent=0);
61 
62  // GeoProjectable
63  virtual TBuffer3D* MakeBuffer3D();
64  virtual TClass* ProjectedClass(const TEveProjection* p) const;
65 
66  static TGeoManager* GetGeoMangeur();
67  static TGeoHMatrix* GetGeoHMatrixIdentity();
68 
69  ClassDef(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).
70 };
71 
72 //------------------------------------------------------------------------------
73 
74 class TEveGeoShapeProjected : public TEveShape,
75  public TEveProjected
76 {
77 private:
78  TEveGeoShapeProjected(const TEveGeoShapeProjected&); // Not implemented
79  TEveGeoShapeProjected& operator=(const TEveGeoShapeProjected&); // Not implemented
80 
81 protected:
82  TBuffer3D *fBuff;
83 
84  virtual void SetDepthLocal(Float_t d);
85 
86 public:
87  TEveGeoShapeProjected();
88  virtual ~TEveGeoShapeProjected();
89 
90  virtual void SetProjection(TEveProjectionManager* proj, TEveProjectable* model);
91  virtual void UpdateProjection();
92  virtual TEveElement* GetProjectedAsElement() { return this; }
93 
94  virtual void ComputeBBox();
95 
96  ClassDef(TEveGeoShapeProjected, 0);
97 };
98 
99 #endif