Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveBox.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel, 2010
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_TEveBox
13 #define ROOT_TEveBox
14 
15 #include "TEveShape.h"
16 
17 //------------------------------------------------------------------------------
18 // TEveBox
19 //------------------------------------------------------------------------------
20 
21 class TEveBox : public TEveShape
22 {
23  friend class TEveBoxGL;
24 
25 private:
26  TEveBox(const TEveBox&); // Not implemented
27  TEveBox& operator=(const TEveBox&); // Not implemented
28 
29 protected:
30  Float_t fVertices[8][3];
31 
32 public:
33  TEveBox(const char* n="TEveBox", const char* t="");
34  virtual ~TEveBox();
35 
36  void SetVertex(Int_t i, Float_t x, Float_t y, Float_t z);
37  void SetVertex(Int_t i, const Float_t* v);
38  void SetVertices(const Float_t* vs);
39 
40  const Float_t* GetVertex(Int_t i) const { return fVertices[i]; }
41 
42  // For TAttBBox:
43  virtual void ComputeBBox();
44 
45  // Projectable:
46  virtual TClass* ProjectedClass(const TEveProjection* p) const;
47 
48  ClassDef(TEveBox, 0); // 3D box with arbitrary vertices.
49 };
50 
51 
52 //------------------------------------------------------------------------------
53 // TEveBoxProjected
54 //------------------------------------------------------------------------------
55 
56 class TEveBoxProjected : public TEveShape,
57  public TEveProjected
58 {
59  friend class TEveBoxProjectedGL;
60 
61 private:
62  TEveBoxProjected(const TEveBoxProjected&); // Not implemented
63  TEveBoxProjected& operator=(const TEveBoxProjected&); // Not implemented
64 
65 protected:
66  vVector2_t fPoints;
67  Int_t fBreakIdx;
68  vVector2_t fDebugPoints;
69 
70  virtual void SetDepthLocal(Float_t d);
71 
72  static Bool_t fgDebugCornerPoints;
73 
74 public:
75  TEveBoxProjected(const char* n="TEveBoxProjected", const char* t="");
76  virtual ~TEveBoxProjected();
77 
78  // For TAttBBox:
79  virtual void ComputeBBox();
80 
81  // Projected:
82  virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
83  virtual void UpdateProjection();
84 
85  virtual TEveElement* GetProjectedAsElement() { return this; }
86 
87  static Bool_t GetDebugCornerPoints();
88  static void SetDebugCornerPoints(Bool_t d);
89 
90  ClassDef(TEveBoxProjected, 0); // Projection of TEveBox.
91 };
92 
93 #endif