Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TBuffer3D.h
Go to the documentation of this file.
1// @(#)root/base:$Id: TBuffer3D.h,v 1.00
2// Author: Olivier Couet 05/05/04
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, 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_TBuffer3D
13#define ROOT_TBuffer3D
14
15#include "TObject.h"
16
17class TBuffer3D : public TObject
18{
19private:
20 const Int_t fType; // Primitive type - predefined ones in TBuffer3DTypes.h
21
22 UInt_t fNbPnts; // Number of points describing the shape
23 UInt_t fNbSegs; // Number of segments describing the shape
24 UInt_t fNbPols; // Number of polygons describing the shape
25
26 UInt_t fPntsCapacity; // Current capacity of fPnts space
27 UInt_t fSegsCapacity; // Current capacity of fSegs space
28 UInt_t fPolsCapacity; // Current capacity of fSegs space
29
30 UInt_t fSections; // Section validity flags
31
32 void Init();
33
34 // Non-copyable class
35 TBuffer3D(const TBuffer3D &) = delete;
36 TBuffer3D & operator=(const TBuffer3D &) = delete;
37
38 //CS specific
40
41public:
42 //CS specific
44
45 static UInt_t GetCSLevel();
46 static void IncCSLevel();
47 static UInt_t DecCSLevel();
48
49 enum ESection {
50// clang++ <v20 (-Wshadow) complains about shadowing GuiTypes.h global variable kNone. Let's silence warning:
51#if defined(__clang__) && __clang_major__ < 20
52#pragma clang diagnostic push
53#pragma clang diagnostic ignored "-Wshadow"
54#endif
55 kNone = BIT(0),
56#if defined(__clang__) && __clang_major__ < 20
57#pragma clang diagnostic pop
58#endif
59 kCore = BIT(1),
63 kRaw = BIT(5),
65 };
66
71 virtual ~TBuffer3D();
72
73 // Section validity flags
75 void ClearSectionsValid();
78
79 // Convenience functions
80 void SetLocalMasterIdentity(); // Set fLocalMaster in kCore to identity
81 void SetAABoundingBox(const Double_t origin[3], // Set fBBVertex in kBoundingBox to axis aligned BB
82 const Double_t halfLengths[3]);
83
84 // SECTION: kRawSize get/set
88
89 UInt_t NbPnts() const { return fNbPnts; }
90 UInt_t NbSegs() const { return fNbSegs; }
91 UInt_t NbPols() const { return fNbPols; }
92
93 // SECTION: kCore
94 Int_t Type() const { return fType; }
95
96 TObject *fID; // ID/object generating buffer - see TVirtualViewer3D for setting
97 Int_t fColor; // Color index
98 Short_t fTransparency; // Percentage transparency [0,100]
99 Bool_t fLocalFrame; // True = Local, False = Master reference frame
100 Bool_t fReflection; // Matrix is reflection
101 Bool_t fScaled; // The shape is scaled
102 Double_t fLocalMaster[16]; // Local->Master Matrix - identity if master frame
103
104 // SECTION: kBoundingBox
105 //
106 // Local frame (fLocalFrame true) axis aligned
107 // Master frame (fLocalFrame false) oriented
108 // Could be more compact (2 and 3 vertices respectively) and rest
109 // calculated as needed - but not worth it
110 // 7-------6
111 // /| /|
112 // 3-------2 |
113 // | 4-----|-5
114 // |/ |/
115 // 0-------1
116 //
117 Double_t fBBVertex[8][3]; // 8 vertices defining bounding box.
118
119 // SECTION: kShapeSpecific - none for base class
120
121 // SECTION: kRaw
122 Double_t *fPnts; // x0, y0, z0, x1, y1, z1, ..... ..... ....
123 Int_t *fSegs; // c0, p0, q0, c1, p1, q1, ..... ..... ....
124 Int_t *fPols; // c0, n0, s0, s1, ... sn, c1, n1, s0, ... sn
125
126
127 // OUTPUT SECTION, filled by viewer as response
128 mutable UInt_t fPhysicalID; // Unique replica ID.
129
130
131 ClassDefOverride(TBuffer3D,0) // 3D primitives description
132};
133
134/** \class TBuffer3DSphere
135Sphere description class - see TBuffer3DTypes for producer classes
136Supports hollow and cut spheres.*/
137
139{
140private:
141 // Non-copyable class
144
145public:
149
150 Bool_t IsSolidUncut() const;
151
152 // SECTION: kShapeSpecific
155 Double_t fThetaMin; // Lower theta limit (orientation?)
156 Double_t fThetaMax; // Higher theta limit (orientation?)
157 Double_t fPhiMin; // Lower phi limit (orientation?)
158 Double_t fPhiMax; // Higher phi limit (orientation?)
159};
160
161/** \class TBuffer3DTube
162Complete tube description class - see TBuffer3DTypes for producer classes
163*/
164
166{
167private:
168 // Non-copyable class
169 TBuffer3DTube(const TBuffer3DTube &) = delete;
171
172protected:
177
178public:
182
183 // SECTION: kShapeSpecific
184 Double_t fRadiusInner; // Inner radius
185 Double_t fRadiusOuter; // Outer radius
186 Double_t fHalfLength; // Half length (dz)
187};
188
189/** \class TBuffer3DTubeSeg
190Tube segment description class - see TBuffer3DTypes for producer classes
191*/
192
194{
195private:
196 // Non-copyable class
199
200protected:
205
206public:
210
211 // SECTION: kShapeSpecific
212 Double_t fPhiMin; // Lower phi limit
213 Double_t fPhiMax; // Higher phi limit
214};
215
216/** \class TBuffer3DCutTube
217Cut tube segment description class - see TBuffer3DTypes for producer classes
218*/
219
221{
222private:
223 // Non-copyable class
226
227public:
231
232 // SECTION: kShapeSpecific
233 Double_t fLowPlaneNorm[3]; // Normal to lower cut plane
234 Double_t fHighPlaneNorm[3]; // Normal to highest cut plane
235};
236
237#endif
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:53
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
#define BIT(n)
Definition Rtypes.h:91
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Cut tube segment description class - see TBuffer3DTypes for producer classes.
Definition TBuffer3D.h:221
Double_t fLowPlaneNorm[3]
Definition TBuffer3D.h:233
Double_t fHighPlaneNorm[3]
Definition TBuffer3D.h:234
TBuffer3DCutTube & operator=(const TBuffer3DTubeSeg &)=delete
TBuffer3DCutTube(const TBuffer3DTubeSeg &)=delete
Sphere description class - see TBuffer3DTypes for producer classes Supports hollow and cut spheres.
Definition TBuffer3D.h:139
TBuffer3DSphere(const TBuffer3DSphere &)=delete
TBuffer3DSphere & operator=(const TBuffer3DSphere &)=delete
Double_t fRadiusInner
Definition TBuffer3D.h:153
Double_t fThetaMin
Definition TBuffer3D.h:155
Double_t fPhiMin
Definition TBuffer3D.h:157
Double_t fThetaMax
Definition TBuffer3D.h:156
Double_t fRadiusOuter
Definition TBuffer3D.h:154
Bool_t IsSolidUncut() const
Test if buffer represents a solid uncut sphere.
Double_t fPhiMax
Definition TBuffer3D.h:158
Tube segment description class - see TBuffer3DTypes for producer classes.
Definition TBuffer3D.h:194
TBuffer3DTubeSeg(const TBuffer3DTubeSeg &)
Double_t fPhiMax
Definition TBuffer3D.h:213
TBuffer3DTubeSeg & operator=(const TBuffer3DTubeSeg &)=delete
Double_t fPhiMin
Definition TBuffer3D.h:212
Complete tube description class - see TBuffer3DTypes for producer classes.
Definition TBuffer3D.h:166
TBuffer3DTube & operator=(const TBuffer3DTube &)=delete
Double_t fRadiusInner
Definition TBuffer3D.h:184
Double_t fRadiusOuter
Definition TBuffer3D.h:185
TBuffer3DTube(const TBuffer3DTube &)=delete
Double_t fHalfLength
Definition TBuffer3D.h:186
Generic 3D primitive description class.
Definition TBuffer3D.h:18
void SetLocalMasterIdentity()
Set kRaw tessellation section of buffer with supplied sizes.
Int_t Type() const
Definition TBuffer3D.h:94
Int_t * fPols
Definition TBuffer3D.h:124
UInt_t NbPols() const
Definition TBuffer3D.h:91
UInt_t fPntsCapacity
Definition TBuffer3D.h:26
UInt_t NbPnts() const
Definition TBuffer3D.h:89
UInt_t NbSegs() const
Definition TBuffer3D.h:90
UInt_t fNbPols
Definition TBuffer3D.h:24
UInt_t fNbPnts
Definition TBuffer3D.h:22
Bool_t SectionsValid(UInt_t mask) const
Definition TBuffer3D.h:76
@ kBoundingBox
Definition TBuffer3D.h:60
@ kShapeSpecific
Definition TBuffer3D.h:61
const Int_t fType
Definition TBuffer3D.h:20
@ kCSDifference
Definition TBuffer3D.h:43
@ kCSIntersection
Definition TBuffer3D.h:43
Double_t fLocalMaster[16]
Definition TBuffer3D.h:102
static UInt_t DecCSLevel()
Decrement CS level.
static UInt_t GetCSLevel()
Return CS level.
void ClearSectionsValid()
Clear any sections marked valid.
UInt_t fPolsCapacity
Definition TBuffer3D.h:28
void SetSectionsValid(UInt_t mask)
Definition TBuffer3D.h:74
Int_t * fSegs
Definition TBuffer3D.h:123
void Init()
Initialise buffer.
Bool_t fLocalFrame
Definition TBuffer3D.h:99
Bool_t fScaled
Definition TBuffer3D.h:101
Int_t fColor
Definition TBuffer3D.h:97
static UInt_t fgCSLevel
Definition TBuffer3D.h:39
UInt_t fPhysicalID
Definition TBuffer3D.h:128
static void IncCSLevel()
Increment CS level.
TBuffer3D & operator=(const TBuffer3D &)=delete
UInt_t fSections
Definition TBuffer3D.h:30
UInt_t fSegsCapacity
Definition TBuffer3D.h:27
Short_t fTransparency
Definition TBuffer3D.h:98
void SetAABoundingBox(const Double_t origin[3], const Double_t halfLengths[3])
Set fBBVertex in kBoundingBox section to a axis aligned (local) BB using supplied origin and box half...
Bool_t fReflection
Definition TBuffer3D.h:100
UInt_t GetSections(UInt_t mask) const
Definition TBuffer3D.h:77
TObject * fID
Definition TBuffer3D.h:96
TBuffer3D(const TBuffer3D &)=delete
UInt_t fNbSegs
Definition TBuffer3D.h:23
virtual ~TBuffer3D()
Destructor.
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
Double_t * fPnts
Definition TBuffer3D.h:122
Double_t fBBVertex[8][3]
Definition TBuffer3D.h:117
Mother of all ROOT objects.
Definition TObject.h:42