Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
24 public TAtt3D,
25 public TAttBBox
26{
27 friend class TEveShapeEditor;
28
29private:
30 TEveShape(const TEveShape&) = delete;
31 TEveShape& operator=(const TEveShape&) = delete;
32
33public:
34 typedef std::vector<TEveVector2> vVector2_t;
35 typedef std::vector<TEveVector2>::iterator vVector2_i;
36
37protected:
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
46public:
47 TEveShape(const char* n="TEveShape", const char* t="");
48 ~TEveShape() override;
49
50 // Rendering parameters.
51 void SetMainColor(Color_t color) override;
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 void CopyVizParams(const TEveElement* el) override;
70 void WriteVizParams(std::ostream& out, const TString& var) override;
71
72 // ----------------------------------------------------------------
73
74 // Virtual from TObject
75 void Paint(Option_t* option="") override;
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=nullptr);
86
89
91 static void CheckAndFixBoxOrientationFv(Float_t box[8][3]);
92
93 ClassDefOverride(TEveShape, 0); // Abstract base-class for 2D/3D shapes.
94};
95
96#endif
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:85
float Float_t
Definition RtypesCore.h:57
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
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.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
GUI editor for TEveShape.
Abstract base-class for 2D/3D shapes.
Definition TEveShape.h:26
~TEveShape() override
Destructor.
Definition TEveShape.cxx:49
virtual void SetLineColor(Color_t c)
Definition TEveShape.h:61
void SetMainColor(Color_t color) override
Set main color.
Definition TEveShape.cxx:58
TEveShape & operator=(const TEveShape &)=delete
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
Definition TEveShape.cxx:89
TEveShape(const TEveShape &)=delete
Color_t fFillColor
Definition TEveShape.h:38
virtual Bool_t GetMiniFrame() const
Definition TEveShape.h:58
virtual Float_t GetLineWidth() const
Definition TEveShape.h:55
Bool_t fDrawFrame
Definition TEveShape.h:42
Bool_t fHighlightFrame
Definition TEveShape.h:43
std::vector< TEveVector2 >::iterator vVector2_i
Definition TEveShape.h:35
virtual Bool_t GetDrawFrame() const
Definition TEveShape.h:56
virtual Bool_t GetHighlightFrame() const
Definition TEveShape.h:57
static void CheckAndFixBoxOrientationFv(Float_t box[8][3])
Make sure box orientation is consistent with standard arrangement.
static void CheckAndFixBoxOrientationEv(TEveVector box[8])
Make sure box orientation is consistent with standard arrangement.
virtual Color_t GetFillColor() const
Definition TEveShape.h:53
std::vector< TEveVector2 > vVector2_t
Definition TEveShape.h:34
Float_t fLineWidth
Definition TEveShape.h:40
virtual Color_t GetLineColor() const
Definition TEveShape.h:54
virtual void SetDrawFrame(Bool_t f)
Definition TEveShape.h:63
void CopyVizParams(const TEveElement *el) override
Copy visualization parameters from element el.
Definition TEveShape.cxx:70
static Int_t FindConvexHull(const vVector2_t &pin, vVector2_t &pout, TEveElement *caller=nullptr)
Determines the convex-hull of points in pin.
void Paint(Option_t *option="") override
Paint this object. Only direct rendering is supported.
Color_t fLineColor
Definition TEveShape.h:39
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...
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...
Bool_t fMiniFrame
Definition TEveShape.h:44
virtual void SetMiniFrame(Bool_t r)
Definition TEveShape.h:65
virtual void SetFillColor(Color_t c)
Definition TEveShape.h:60
virtual void SetHighlightFrame(Bool_t f)
Definition TEveShape.h:64
virtual void SetLineWidth(Float_t lw)
Definition TEveShape.h:62
Basic string class.
Definition TString.h:139
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