ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
22 class TEveShape : public TEveElementList,
23  public TAtt3D,
24  public TAttBBox
25 {
26  friend class TEveShapeEditor;
27 
28 private:
29  TEveShape(const TEveShape&); // Not implemented
30  TEveShape& operator=(const TEveShape&); // Not implemented
31 
32 public:
33  typedef std::vector<TEveVector2> vVector2_t;
34  typedef std::vector<TEveVector2>::iterator vVector2_i;
35 
36 protected:
37  Color_t fFillColor; // fill color of polygons
38  Color_t fLineColor; // outline color of polygons
39  Float_t fLineWidth; // outline width of polygons
40 
41  Bool_t fDrawFrame; // draw frame
42  Bool_t fHighlightFrame; // highlight frame / all shape
43  Bool_t fMiniFrame; // draw minimal frame
44 
45 public:
46  TEveShape(const char* n="TEveShape", const char* t="");
47  virtual ~TEveShape();
48 
49  // Rendering parameters.
50  virtual void SetMainColor(Color_t color);
51 
52  virtual Color_t GetFillColor() const { return fFillColor; }
53  virtual Color_t GetLineColor() const { return fLineColor; }
54  virtual Float_t GetLineWidth() const { return fLineWidth;}
55  virtual Bool_t GetDrawFrame() const { return fDrawFrame; }
56  virtual Bool_t GetHighlightFrame() const { return fHighlightFrame; }
57  virtual Bool_t GetMiniFrame() const { return fMiniFrame; }
58 
59  virtual void SetFillColor(Color_t c) { fFillColor = c; }
60  virtual void SetLineColor(Color_t c) { fLineColor = c; }
61  virtual void SetLineWidth(Float_t lw) { fLineWidth = lw;}
62  virtual void SetDrawFrame(Bool_t f) { fDrawFrame = f; }
64  virtual void SetMiniFrame(Bool_t r) { fMiniFrame = r; }
65 
66  // ----------------------------------------------------------------
67 
68  virtual void CopyVizParams(const TEveElement* el);
69  virtual void WriteVizParams(std::ostream& out, const TString& var);
70 
71  // ----------------------------------------------------------------
72 
73  // Virtual from TObject
74  virtual void Paint(Option_t* option="");
75 
76  // Abstract function from TAttBBox:
77  // virtual void ComputeBBox();
78 
79  // Abstract from TEveProjectable, overriden in TEveElementList:
80  // virtual TClass* ProjectedClass(const TEveProjection* p) const;
81 
82  // ----------------------------------------------------------------
83 
84  static Int_t FindConvexHull(const vVector2_t& pin, vVector2_t& pout, TEveElement* caller=0);
85 
87  static Bool_t IsBoxOrientationConsistentFv(const Float_t box[8][3]);
88 
90  static void CheckAndFixBoxOrientationFv(Float_t box[8][3]);
91 
92  ClassDef(TEveShape, 0); // Abstract base-class for 2D/3D shapes.
93 };
94 
95 #endif
virtual Float_t GetLineWidth() const
Definition: TEveShape.h:54
Abstract base-class for 2D/3D shapes.
Definition: TEveShape.h:22
virtual void SetMiniFrame(Bool_t r)
Definition: TEveShape.h:64
GUI editor for TEveShape.
virtual void SetHighlightFrame(Bool_t f)
Definition: TEveShape.h:63
std::vector< TEveVector2 > vVector2_t
Definition: TEveShape.h:33
float Float_t
Definition: RtypesCore.h:53
return c
const char Option_t
Definition: RtypesCore.h:62
virtual void SetLineWidth(Float_t lw)
Definition: TEveShape.h:61
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:29
Color_t fFillColor
Definition: TEveShape.h:37
virtual void SetLineColor(Color_t c)
Definition: TEveShape.h:60
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
virtual Color_t GetLineColor() const
Definition: TEveShape.h:53
bool Bool_t
Definition: RtypesCore.h:59
virtual Bool_t GetHighlightFrame() const
Definition: TEveShape.h:56
Bool_t fHighlightFrame
Definition: TEveShape.h:42
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
TFile * f
virtual Bool_t GetDrawFrame() const
Definition: TEveShape.h:55
Float_t fLineWidth
Definition: TEveShape.h:39
A list of TEveElements.
Definition: TEveElement.h:459
static void CheckAndFixBoxOrientationFv(Float_t box[8][3])
Make sure box orientation is consistent with standard arrangement.
Definition: TEveShape.cxx:261
virtual void SetDrawFrame(Bool_t f)
Definition: TEveShape.h:62
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
Definition: TEveShape.cxx:89
virtual void SetMainColor(Color_t color)
Set main color.
Definition: TEveShape.cxx:58
virtual ~TEveShape()
Destructor.
Definition: TEveShape.cxx:49
char * out
Definition: TBase64.cxx:29
short Color_t
Definition: RtypesCore.h:79
virtual void Paint(Option_t *option="")
Paint this object. Only direct rendering is supported.
Definition: TEveShape.cxx:104
TThread * t[5]
Definition: threadsh1.C:13
ClassDef(TEveShape, 0)
virtual Color_t GetFillColor() const
Definition: TEveShape.h:52
ROOT::R::TRInterface & r
Definition: Object.C:4
std::vector< TEveVector2 >::iterator vVector2_i
Definition: TEveShape.h:34
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 & operator=(const TEveShape &)
virtual Bool_t GetMiniFrame() const
Definition: TEveShape.h:57
TEveShape(const TEveShape &)
Bool_t fDrawFrame
Definition: TEveShape.h:41
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
Definition: TEveShape.cxx:70
Helper for management of bounding-box information.
Definition: TAttBBox.h:19
virtual void SetFillColor(Color_t c)
Definition: TEveShape.h:59
Bool_t fMiniFrame
Definition: TEveShape.h:43
Color_t fLineColor
Definition: TEveShape.h:38
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
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
static void CheckAndFixBoxOrientationEv(TEveVector box[8])
Make sure box orientation is consistent with standard arrangement.
Definition: TEveShape.cxx:249
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
const Int_t n
Definition: legend1.C:16