Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 &) = delete;
34 REveShape &operator=(const REveShape &) = delete;
35
36public:
37 typedef std::vector<REveVector2> vVector2_t;
38
39protected:
40 Color_t fFillColor = 7; // fill color of polygons
41 Color_t fLineColor = 12; // outline color of polygons
42 UChar_t fFillAlpha = 255; // alpha of the fill
43 UChar_t fLineAlpha = 255; // alpha of outline
44 Float_t fLineWidth = 1; // outline width of polygons
45
46 Bool_t fDrawFrame = true; // draw frame
47 Bool_t fHighlightFrame = false; // highlight frame / all shape
48 Bool_t fMiniFrame = true; // draw minimal frame
49
50public:
51 REveShape(const std::string &n = "REveShape", const std::string &t = "");
52 ~REveShape() override;
53
54 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
55
56 // Rendering parameters.
57 void SetMainColor(Color_t color) override;
58
59 Color_t GetFillColor() const { return fFillColor; }
60 Color_t GetLineColor() const { return fLineColor; }
61 UChar_t GetFillAlpha() const { return fFillAlpha; }
62 UChar_t GetLineAlpha() const { return fLineAlpha; }
63 Float_t GetLineWidth() const { return fLineWidth; }
64 Bool_t GetDrawFrame() const { return fDrawFrame; }
66 Bool_t GetMiniFrame() const { return fMiniFrame; }
67
76
77 // ----------------------------------------------------------------
78
79 void CopyVizParams(const REveElement *el) override;
80 void WriteVizParams(std::ostream &out, const TString &var) override;
81
82 // ----------------------------------------------------------------
83
84 // Abstract function from TAttBBox:
85 // virtual void ComputeBBox();
86
87 // ----------------------------------------------------------------
88
89 static Int_t FindConvexHull(const vVector2_t &pin, vVector2_t &pout, REveElement *caller = nullptr);
90
93
95 static void CheckAndFixBoxOrientationFv(Float_t box[8][3]);
96};
97
98} // namespace Experimental
99} // namespace ROOT
100
101#endif
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
bool Bool_t
Definition RtypesCore.h:63
short Color_t
Definition RtypesCore.h:85
unsigned char UChar_t
Definition RtypesCore.h:38
float Float_t
Definition RtypesCore.h:57
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
Bool_t GetHighlightFrame() const
Definition REveShape.hxx:65
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
static Int_t FindConvexHull(const vVector2_t &pin, vVector2_t &pout, REveElement *caller=nullptr)
Determines the convex-hull of points in pin.
void SetLineWidth(Float_t lw)
Definition REveShape.hxx:72
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
Definition REveShape.cxx:82
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.
REveShape & operator=(const REveShape &)=delete
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...
void SetHighlightFrame(Bool_t f)
Definition REveShape.hxx:74
REveShape(const REveShape &)=delete
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...
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition REveShape.cxx:51
static void CheckAndFixBoxOrientationEv(REveVector box[8])
Make sure box orientation is consistent with standard arrangement.
~REveShape() override
Destructor.
Definition REveShape.cxx:44
void SetMainColor(Color_t color) override
Set main color.
Definition REveShape.cxx:70
Helper for management of bounding-box information.
Definition TAttBBox.h:18
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
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...