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
21namespace ROOT {
22namespace Experimental {
23
24// =========================================================================
25// REveShape
26// Abstract base-class for 2D/3D shapes.
27// =========================================================================
28
29class REveShape : public REveElement,
30 public TAttBBox
31{
32private:
33 REveShape(const REveShape &); // Not implemented
34 REveShape &operator=(const REveShape &); // Not implemented
35
36public:
37 typedef std::vector<REveVector2> vVector2_t;
38
39protected:
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
48public:
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
87
89 static void CheckAndFixBoxOrientationFv(Float_t box[8][3]);
90};
91
92} // namespace Experimental
93} // namespace ROOT
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
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
Definition: REveShape.cxx:108
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
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
Definition: REveShape.cxx:89
virtual void SetLineWidth(Float_t lw)
Definition: REveShape.hxx:66
std::vector< REveVector2 > vVector2_t
Definition: REveShape.hxx:37
static void CheckAndFixBoxOrientationFv(Float_t box[8][3])
Make sure box orientation is consistent with standard arrangement.
Definition: REveShape.cxx:271
virtual void SetMiniFrame(Bool_t r)
Definition: REveShape.hxx:69
virtual ~REveShape()
Destructor.
Definition: REveShape.cxx:53
REveShape & operator=(const REveShape &)
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
virtual void SetHighlightFrame(Bool_t f)
Definition: REveShape.hxx:68
virtual void SetLineColor(Color_t c)
Definition: REveShape.hxx:65
virtual Color_t GetFillColor() const
Definition: REveShape.hxx:57
virtual Float_t GetLineWidth() const
Definition: REveShape.hxx:59
virtual void SetFillColor(Color_t c)
Definition: REveShape.hxx:64
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
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition: REveShape.cxx:60
virtual Bool_t GetDrawFrame() const
Definition: REveShape.hxx:60
virtual Color_t GetLineColor() const
Definition: REveShape.hxx:58
static void CheckAndFixBoxOrientationEv(REveVector box[8])
Make sure box orientation is consistent with standard arrangement.
Definition: REveShape.cxx:259
REveShape(const REveShape &)
virtual Bool_t GetMiniFrame() const
Definition: REveShape.hxx:62
virtual Bool_t GetHighlightFrame() const
Definition: REveShape.hxx:61
virtual void SetDrawFrame(Bool_t f)
Definition: REveShape.hxx:67
void SetMainColor(Color_t color) override
Set main color.
Definition: REveShape.cxx:77
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
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
VSD Structures.
Definition: StringConv.hxx:21