Logo ROOT   6.16/01
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
23 public TAtt3D,
24 public TAttBBox
25{
26 friend class TEveShapeEditor;
27
28private:
29 TEveShape(const TEveShape&); // Not implemented
30 TEveShape& operator=(const TEveShape&); // Not implemented
31
32public:
33 typedef std::vector<TEveVector2> vVector2_t;
34 typedef std::vector<TEveVector2>::iterator vVector2_i;
35
36protected:
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
45public:
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
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
ROOT::R::TRInterface & r
Definition: Object.C:4
#define f(i)
Definition: RSha256.hxx:104
#define c(i)
Definition: RSha256.hxx:101
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
short Color_t
Definition: RtypesCore.h:79
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
A list of TEveElements.
Definition: TEveElement.h:431
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
GUI editor for TEveShape.
Abstract base-class for 2D/3D shapes.
Definition: TEveShape.h:25
virtual void SetLineColor(Color_t c)
Definition: TEveShape.h:60
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
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
Definition: TEveShape.cxx:70
Color_t fFillColor
Definition: TEveShape.h:37
virtual Bool_t GetMiniFrame() const
Definition: TEveShape.h:57
virtual Float_t GetLineWidth() const
Definition: TEveShape.h:54
Bool_t fDrawFrame
Definition: TEveShape.h:41
TEveShape(const TEveShape &)
Bool_t fHighlightFrame
Definition: TEveShape.h:42
std::vector< TEveVector2 >::iterator vVector2_i
Definition: TEveShape.h:34
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
Definition: TEveShape.cxx:89
virtual Bool_t GetDrawFrame() const
Definition: TEveShape.h:55
virtual Bool_t GetHighlightFrame() const
Definition: TEveShape.h:56
static void CheckAndFixBoxOrientationFv(Float_t box[8][3])
Make sure box orientation is consistent with standard arrangement.
Definition: TEveShape.cxx:261
virtual ~TEveShape()
Destructor.
Definition: TEveShape.cxx:49
static void CheckAndFixBoxOrientationEv(TEveVector box[8])
Make sure box orientation is consistent with standard arrangement.
Definition: TEveShape.cxx:249
virtual Color_t GetFillColor() const
Definition: TEveShape.h:52
virtual void SetMainColor(Color_t color)
Set main color.
Definition: TEveShape.cxx:58
std::vector< TEveVector2 > vVector2_t
Definition: TEveShape.h:33
Float_t fLineWidth
Definition: TEveShape.h:39
virtual Color_t GetLineColor() const
Definition: TEveShape.h:53
virtual void SetDrawFrame(Bool_t f)
Definition: TEveShape.h:62
TEveShape & operator=(const TEveShape &)
Color_t fLineColor
Definition: TEveShape.h:38
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
virtual void Paint(Option_t *option="")
Paint this object. Only direct rendering is supported.
Definition: TEveShape.cxx:104
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
Bool_t fMiniFrame
Definition: TEveShape.h:43
virtual void SetMiniFrame(Bool_t r)
Definition: TEveShape.h:64
virtual void SetFillColor(Color_t c)
Definition: TEveShape.h:59
virtual void SetHighlightFrame(Bool_t f)
Definition: TEveShape.h:63
virtual void SetLineWidth(Float_t lw)
Definition: TEveShape.h:61
Basic string class.
Definition: TString.h:131
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
const Int_t n
Definition: legend1.C:16