17#include "TGLIncludes.h"
70 fNextPhysical (nullptr),
71 fFirstPSRef (nullptr),
99 fNextPhysical (nullptr),
100 fFirstPSRef (nullptr),
160 while ((
shp2 =
shp1->fNextPSRef) !=
nullptr) {
162 shp1->fNextPSRef =
shp2->fNextPSRef;
172 Error(
"TGLPhysicalShape::RemoveReference",
"Attempt to un-ref an unregistered shape-ref.");
230 for (
UInt_t i = 0; i < 17; i++) {
246 pshp->SetColor(color);
256 for (
Int_t i=0; i<4; ++i)
266 for (
Int_t i=0; i<4; ++i)
294 if (color ==
nullptr) color =
fColor;
296 switch (
rnrCtx.DrawPass()) {
342 Info(
"TGLPhysicalShape::Draw",
"this %zd (class %s) LOD %d",
343 (
size_t)
this,
IsA()->GetName(),
rnrCtx.ShapeLOD());
350 if (!
rnrCtx.IsDrawPassOutlineLine())
361 Info(
"TGLPhysicalShape::Draw",
"this %zd (class %s) LOD %d",
362 (
size_t)
this,
IsA()->GetName(),
rnrCtx.ShapeLOD());
376 if (
rnrCtx.HighlightOutline())
378 static const Int_t offsets[20][2] =
379 { {-1,-1}, { 1,-1}, { 1, 1}, {-1, 1},
380 { 1, 0}, { 0, 1}, {-1, 0}, { 0,-1},
381 { 0,-2}, { 2, 0}, { 0, 2}, {-2, 0},
382 {-2,-2}, { 2,-2}, { 2, 2}, {-2, 2},
383 { 0,-3}, { 3, 0}, { 0, 3}, {-3, 0} };
389 for (
int i = 0; i <
max_off; ++i)
407 if (
rnrCtx.IsDrawPassOutlineLine())
410 if (
rnrCtx.IsDrawPassOutlineLine())
471 Error(
"TGLPhysicalShape::CalcPhysicalLOD",
"LOD calculation for single axis not implemented presently");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
void Set(const TGLVertex3 vertex[8])
Set a bounding box from provided 8 vertices.
void Transform(const TGLMatrix &matrix)
Transform all vertices with matrix.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
16 component (4x4) transform matrix - column MAJOR as per GL.
void Transpose3x3()
Transpose the top left 3x3 matrix component along major diagonal Supported as currently incompatibili...
const Double_t * CArr() const
Bool_t IsScalingForRender() const
Return true if matrix is to be considered a scaling matrix for rendering.
Base class for references to TGLPysicalShape that need to be notified when the shape is destroyed.
virtual void SetPShape(TGLPhysicalShape *shape)
Set the shape.
TGLPShapeRef * fNextPSRef
virtual void PShapeModified()
This is called from physical shape when it is modified.
Concrete physical shape - a GL drawable.
void Modified()
Call this after modifying the physical so that the information can be propagated to the object refere...
void InvokeContextMenu(TContextMenu &menu, UInt_t x, UInt_t y) const
Request creation of context menu on shape, attached to 'menu' at screen position 'x' 'y'.
virtual ~TGLPhysicalShape()
Destroy the physical shape.
void SetupGLColors(TGLRnrCtx &rnrCtx, const Float_t *color=nullptr) const
Setup colors - avoid setting things not required for current draw flags.
const TGLLogicalShape * fLogicalShape
Bool_t fModified
face winding TODO: can get directly from fTransform?
const TGLBoundingBox & BoundingBox() const
virtual void QuantizeShapeLOD(Short_t shapeLOD, Short_t combiLOD, Short_t &quantLOD) const
Factor in scene/vierer LOD and Quantize ... forward to logical shape.
void RemoveReference(TGLPShapeRef *ref)
Remove reference ref.
void InitColor(const Float_t rgba[4])
Initialise the colors, using basic RGBA diffuse material color supplied.
void SetColor(const Float_t rgba[17])
Set full color attributes - see OpenGL material documentation for full description.
Bool_t fIsScaleForRnr
has been modified - retain across scene rebuilds
virtual TClass * IsA() const
void SetColorOnFamily(const Float_t rgba[17])
Set full color attributes to all physicals sharing the same logical with this object.
virtual void CalculateShapeLOD(TGLRnrCtx &rnrCtx, Float_t &pixSize, Short_t &shapeLOD) const
Calculate shape-lod, suitable for use under projection defined by 'rnrCtx', taking account of which l...
void AddReference(TGLPShapeRef *ref)
Add reference ref.
Bool_t fInvertedWind
selected state
void SetDiffuseColor(const Float_t rgba[4])
Set color from ROOT color index and transparency [0,100].
TGLPhysicalShape(const TGLPhysicalShape &)=delete
TGLBoundingBox fBoundingBox
transform (placement) of physical instance
TGLMatrix fTransform
unique physical ID within containing scene
TGLPShapeRef * fFirstPSRef
pointer to next replica
Float_t fColor[17]
bounding box of the physical (transformed)
void UpdateBoundingBox()
cache
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw physical shape, using LOD flags, potential from display list cache.
Viewport (pixel base) 2D rectangle class.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
static UInt_t LockColor()
Prevent further color changes.
static UInt_t UnlockColor()
Allow color changes.
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
static void ColorAlpha(const TGLColor &color, UChar_t alpha)
Set color from TGLColor and alpha value.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)