Logo ROOT  
Reference Guide
REveShape.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Author: Matevz Tadel, 2010, 2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, 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 ROOT7_REveShape
13 #define ROOT7_REveShape
14 
15 #include <ROOT/REveElement.hxx>
16 #include <ROOT/REveVector.hxx>
17 
18 #include "TAttBBox.h"
19 #include "TColor.h"
20 
21 namespace ROOT {
22 namespace Experimental {
23 
24 // =========================================================================
25 // REveShape
26 // Abstract base-class for 2D/3D shapes.
27 // =========================================================================
28 
29 class REveShape : public REveElement,
30  public TAttBBox
31 {
32 private:
33  REveShape(const REveShape &) = delete;
34  REveShape &operator=(const REveShape &) = delete;
35 
36 public:
37  typedef std::vector<REveVector2> vVector2_t;
38 
39 protected:
40  Color_t fFillColor; // fill color of polygons
41  Color_t fLineColor; // outline color of polygons
42  Float_t fLineWidth; // outline width of polygons
43 
44  Bool_t fDrawFrame; // draw frame
45  Bool_t fHighlightFrame; // highlight frame / all shape
46  Bool_t fMiniFrame; // draw minimal frame
47 
48 public:
49  REveShape(const std::string &n = "REveShape", const std::string &t = "");
50  virtual ~REveShape();
51 
52  Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
53 
54  // Rendering parameters.
55  void SetMainColor(Color_t color) override;
56 
57  virtual Color_t GetFillColor() const { return fFillColor; }
58  virtual Color_t GetLineColor() const { return fLineColor; }
59  virtual Float_t GetLineWidth() const { return fLineWidth; }
60  virtual Bool_t GetDrawFrame() const { return fDrawFrame; }
61  virtual Bool_t GetHighlightFrame() const { return fHighlightFrame; }
62  virtual Bool_t GetMiniFrame() const { return fMiniFrame; }
63 
64  virtual void SetFillColor(Color_t c) { fFillColor = c; }
65  virtual void SetLineColor(Color_t c) { fLineColor = c; }
66  virtual void SetLineWidth(Float_t lw) { fLineWidth = lw; }
67  virtual void SetDrawFrame(Bool_t f) { fDrawFrame = f; }
69  virtual void SetMiniFrame(Bool_t r) { fMiniFrame = r; }
70 
71  // ----------------------------------------------------------------
72 
73  void CopyVizParams(const REveElement *el) override;
74  void WriteVizParams(std::ostream &out, const TString &var) override;
75 
76  // ----------------------------------------------------------------
77 
78  // Abstract function from TAttBBox:
79  // virtual void ComputeBBox();
80 
81  // ----------------------------------------------------------------
82 
83  static Int_t FindConvexHull(const vVector2_t &pin, vVector2_t &pout, REveElement *caller = nullptr);
84 
86  static Bool_t IsBoxOrientationConsistentFv(const Float_t box[8][3]);
87 
89  static void CheckAndFixBoxOrientationFv(Float_t box[8][3]);
90 };
91 
92 } // namespace Experimental
93 } // namespace ROOT
94 
95 #endif
c
#define c(i)
Definition: RSha256.hxx:101
ROOT::Experimental::REveShape::SetMainColor
void SetMainColor(Color_t color) override
Set main color.
Definition: REveShape.cxx:77
n
const Int_t n
Definition: legend1.C:16
ROOT::Experimental::REveShape::fLineWidth
Float_t fLineWidth
Definition: REveShape.hxx:42
ROOT::Experimental::REveShape::operator=
REveShape & operator=(const REveShape &)=delete
f
#define f(i)
Definition: RSha256.hxx:104
ROOT::Experimental::REveShape::IsBoxOrientationConsistentEv
static Bool_t IsBoxOrientationConsistentEv(const REveVector box[8])
Checks if the first face normal is pointing into the other direction as the vector pointing towards t...
Definition: REveShape.cxx:232
ROOT::Experimental::REveShape::FindConvexHull
static Int_t FindConvexHull(const vVector2_t &pin, vVector2_t &pout, REveElement *caller=nullptr)
Determines the convex-hull of points in pin.
Definition: REveShape.cxx:128
nlohmann::json
basic_json<> json
Definition: REveElement.hxx:58
ROOT::Experimental::REveShape::SetDrawFrame
virtual void SetDrawFrame(Bool_t f)
Definition: REveShape.hxx:67
r
ROOT::R::TRInterface & r
Definition: Object.C:4
ROOT::Experimental::REveShape::WriteVizParams
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
Definition: REveShape.cxx:108
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
box
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
ROOT::Experimental::REveShape::SetMiniFrame
virtual void SetMiniFrame(Bool_t r)
Definition: REveShape.hxx:69
ROOT::Experimental::REveShape::fHighlightFrame
Bool_t fHighlightFrame
Definition: REveShape.hxx:45
ROOT::Experimental::REveShape::SetLineColor
virtual void SetLineColor(Color_t c)
Definition: REveShape.hxx:65
TColor.h
ROOT::Experimental::REveShape::CheckAndFixBoxOrientationEv
static void CheckAndFixBoxOrientationEv(REveVector box[8])
Make sure box orientation is consistent with standard arrangement.
Definition: REveShape.cxx:259
ROOT::Experimental::REveShape::fDrawFrame
Bool_t fDrawFrame
Definition: REveShape.hxx:44
ROOT::Experimental::REveShape::fFillColor
Color_t fFillColor
Definition: REveShape.hxx:40
TString
Basic string class.
Definition: TString.h:136
ROOT::Experimental::REveShape::GetFillColor
virtual Color_t GetFillColor() const
Definition: REveShape.hxx:57
ROOT::Experimental::REveElement
Definition: REveElement.hxx:80
ROOT::Experimental::REveVectorT< Float_t >
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
Color_t
short Color_t
Definition: RtypesCore.h:83
bool
ROOT::Experimental::REveShape::SetHighlightFrame
virtual void SetHighlightFrame(Bool_t f)
Definition: REveShape.hxx:68
TAttBBox
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
ROOT::Experimental::REveShape::REveShape
REveShape(const REveShape &)=delete
REveElement.hxx
TAttBBox.h
ROOT::Experimental::REveShape
Definition: REveShape.hxx:31
ROOT::Experimental::REveShape::SetLineWidth
virtual void SetLineWidth(Float_t lw)
Definition: REveShape.hxx:66
ROOT::Experimental::REveShape::vVector2_t
std::vector< REveVector2 > vVector2_t
Definition: REveShape.hxx:37
ROOT::Experimental::REveShape::CheckAndFixBoxOrientationFv
static void CheckAndFixBoxOrientationFv(Float_t box[8][3])
Make sure box orientation is consistent with standard arrangement.
Definition: REveShape.cxx:271
ROOT::Experimental::REveShape::WriteCoreJson
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition: REveShape.cxx:60
ROOT::Experimental::REveShape::GetDrawFrame
virtual Bool_t GetDrawFrame() const
Definition: REveShape.hxx:60
ROOT::Experimental::REveShape::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: REveShape.cxx:246
REveVector.hxx
ROOT::Experimental::REveShape::GetHighlightFrame
virtual Bool_t GetHighlightFrame() const
Definition: REveShape.hxx:61
ROOT::Experimental::REveShape::~REveShape
virtual ~REveShape()
Destructor.
Definition: REveShape.cxx:53
ROOT::Experimental::REveShape::fMiniFrame
Bool_t fMiniFrame
Definition: REveShape.hxx:46
ROOT::Experimental::REveShape::CopyVizParams
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
Definition: REveShape.cxx:89
ROOT::Experimental::REveShape::fLineColor
Color_t fLineColor
Definition: REveShape.hxx:41
ROOT::Experimental::REveShape::GetLineColor
virtual Color_t GetLineColor() const
Definition: REveShape.hxx:58
ROOT::Experimental::REveShape::SetFillColor
virtual void SetFillColor(Color_t c)
Definition: REveShape.hxx:64
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveShape::GetMiniFrame
virtual Bool_t GetMiniFrame() const
Definition: REveShape.hxx:62
ROOT::Experimental::REveShape::GetLineWidth
virtual Float_t GetLineWidth() const
Definition: REveShape.hxx:59
int