Logo ROOT  
Reference Guide
TEveShape.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_TEveShape
13 #define ROOT_TEveShape
14 
15 #include "TEveElement.h"
16 #include "TEveVector.h"
17 
18 #include "TAtt3D.h"
19 #include "TAttBBox.h"
20 #include "TColor.h"
21 #include <vector>
22 
23 class TEveShape : public TEveElementList,
24  public TAtt3D,
25  public TAttBBox
26 {
27  friend class TEveShapeEditor;
28 
29 private:
30  TEveShape(const TEveShape&) = delete;
31  TEveShape& operator=(const TEveShape&) = delete;
32 
33 public:
34  typedef std::vector<TEveVector2> vVector2_t;
35  typedef std::vector<TEveVector2>::iterator vVector2_i;
36 
37 protected:
38  Color_t fFillColor; // fill color of polygons
39  Color_t fLineColor; // outline color of polygons
40  Float_t fLineWidth; // outline width of polygons
41 
42  Bool_t fDrawFrame; // draw frame
43  Bool_t fHighlightFrame; // highlight frame / all shape
44  Bool_t fMiniFrame; // draw minimal frame
45 
46 public:
47  TEveShape(const char* n="TEveShape", const char* t="");
48  virtual ~TEveShape();
49 
50  // Rendering parameters.
51  virtual void SetMainColor(Color_t color);
52 
53  virtual Color_t GetFillColor() const { return fFillColor; }
54  virtual Color_t GetLineColor() const { return fLineColor; }
55  virtual Float_t GetLineWidth() const { return fLineWidth;}
56  virtual Bool_t GetDrawFrame() const { return fDrawFrame; }
57  virtual Bool_t GetHighlightFrame() const { return fHighlightFrame; }
58  virtual Bool_t GetMiniFrame() const { return fMiniFrame; }
59 
60  virtual void SetFillColor(Color_t c) { fFillColor = c; }
61  virtual void SetLineColor(Color_t c) { fLineColor = c; }
62  virtual void SetLineWidth(Float_t lw) { fLineWidth = lw;}
63  virtual void SetDrawFrame(Bool_t f) { fDrawFrame = f; }
65  virtual void SetMiniFrame(Bool_t r) { fMiniFrame = r; }
66 
67  // ----------------------------------------------------------------
68 
69  virtual void CopyVizParams(const TEveElement* el);
70  virtual void WriteVizParams(std::ostream& out, const TString& var);
71 
72  // ----------------------------------------------------------------
73 
74  // Virtual from TObject
75  virtual void Paint(Option_t* option="");
76 
77  // Abstract function from TAttBBox:
78  // virtual void ComputeBBox();
79 
80  // Abstract from TEveProjectable, overriden in TEveElementList:
81  // virtual TClass* ProjectedClass(const TEveProjection* p) const;
82 
83  // ----------------------------------------------------------------
84 
85  static Int_t FindConvexHull(const vVector2_t& pin, vVector2_t& pout, TEveElement* caller=0);
86 
88  static Bool_t IsBoxOrientationConsistentFv(const Float_t box[8][3]);
89 
91  static void CheckAndFixBoxOrientationFv(Float_t box[8][3]);
92 
93  ClassDef(TEveShape, 0); // Abstract base-class for 2D/3D shapes.
94 };
95 
96 #endif
c
#define c(i)
Definition: RSha256.hxx:101
TEveShapeEditor
GUI editor for TEveShape.
Definition: TEveShapeEditor.h:25
TEveShape::CheckAndFixBoxOrientationFv
static void CheckAndFixBoxOrientationFv(Float_t box[8][3])
Make sure box orientation is consistent with standard arrangement.
Definition: TEveShape.cxx:261
n
const Int_t n
Definition: legend1.C:16
TEveShape::CopyVizParams
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
Definition: TEveShape.cxx:70
TEveElement
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:36
f
#define f(i)
Definition: RSha256.hxx:104
Option_t
const char Option_t
Definition: RtypesCore.h:66
TEveShape::fFillColor
Color_t fFillColor
Definition: TEveShape.h:38
TEveShape::GetLineWidth
virtual Float_t GetLineWidth() const
Definition: TEveShape.h:55
TEveShape::operator=
TEveShape & operator=(const TEveShape &)=delete
TEveShape::SetMainColor
virtual void SetMainColor(Color_t color)
Set main color.
Definition: TEveShape.cxx:58
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TEveShape::IsBoxOrientationConsistentEv
static Bool_t IsBoxOrientationConsistentEv(const TEveVector box[8])
Checks if the first face normal is pointing into the other direction as the vector pointing towards t...
Definition: TEveShape.cxx:222
TEveShape::vVector2_t
std::vector< TEveVector2 > vVector2_t
Definition: TEveShape.h:34
TEveShape::FindConvexHull
static Int_t FindConvexHull(const vVector2_t &pin, vVector2_t &pout, TEveElement *caller=0)
Determines the convex-hull of points in pin.
Definition: TEveShape.cxx:117
TEveShape::GetMiniFrame
virtual Bool_t GetMiniFrame() const
Definition: TEveShape.h:58
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
TEveShape::SetLineWidth
virtual void SetLineWidth(Float_t lw)
Definition: TEveShape.h:62
box
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
TColor.h
TEveElement.h
TEveShape::CheckAndFixBoxOrientationEv
static void CheckAndFixBoxOrientationEv(TEveVector box[8])
Make sure box orientation is consistent with standard arrangement.
Definition: TEveShape.cxx:249
TString
Basic string class.
Definition: TString.h:136
TAtt3D
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
Color_t
short Color_t
Definition: RtypesCore.h:83
TEveElementList
A list of TEveElements.
Definition: TEveElement.h:433
bool
TEveShape::fLineColor
Color_t fLineColor
Definition: TEveShape.h:39
TAttBBox
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
TEveShape::SetHighlightFrame
virtual void SetHighlightFrame(Bool_t f)
Definition: TEveShape.h:64
TEveVector.h
TEveShape::SetMiniFrame
virtual void SetMiniFrame(Bool_t r)
Definition: TEveShape.h:65
TAtt3D.h
TAttBBox.h
TEveShape::IsBoxOrientationConsistentFv
static Bool_t IsBoxOrientationConsistentFv(const Float_t box[8][3])
Checks if the first face normal is pointing into the other direction as the vector pointing towards t...
Definition: TEveShape.cxx:236
TEveShape::SetLineColor
virtual void SetLineColor(Color_t c)
Definition: TEveShape.h:61
TEveShape::~TEveShape
virtual ~TEveShape()
Destructor.
Definition: TEveShape.cxx:49
TEveVectorT< Float_t >
TEveShape::SetFillColor
virtual void SetFillColor(Color_t c)
Definition: TEveShape.h:60
TEveShape::Paint
virtual void Paint(Option_t *option="")
Paint this object. Only direct rendering is supported.
Definition: TEveShape.cxx:104
TEveShape::vVector2_i
std::vector< TEveVector2 >::iterator vVector2_i
Definition: TEveShape.h:35
TEveShape::fLineWidth
Float_t fLineWidth
Definition: TEveShape.h:40
TEveShape::WriteVizParams
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
Definition: TEveShape.cxx:89
TEveShape::GetDrawFrame
virtual Bool_t GetDrawFrame() const
Definition: TEveShape.h:56
TEveShape::fHighlightFrame
Bool_t fHighlightFrame
Definition: TEveShape.h:43
TEveShape::GetLineColor
virtual Color_t GetLineColor() const
Definition: TEveShape.h:54
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TEveShape::TEveShape
TEveShape(const TEveShape &)=delete
TEveShape::GetFillColor
virtual Color_t GetFillColor() const
Definition: TEveShape.h:53
TEveShape::GetHighlightFrame
virtual Bool_t GetHighlightFrame() const
Definition: TEveShape.h:57
TEveShape::SetDrawFrame
virtual void SetDrawFrame(Bool_t f)
Definition: TEveShape.h:63
TEveShape::fDrawFrame
Bool_t fDrawFrame
Definition: TEveShape.h:42
TEveShape::fMiniFrame
Bool_t fMiniFrame
Definition: TEveShape.h:44
TEveShape
Abstract base-class for 2D/3D shapes.
Definition: TEveShape.h:26