59 fAcceptedPhysicals (0),
113 Float_t rgba[4] = {1.f, 1.f, 1.f, 1.f};
115 rgba[0] = histoColor[0];
116 rgba[1] = histoColor[1];
117 rgba[2] = histoColor[2];
118 rgba[3] = histoColor[3];
145 if (
const TH3 *
th3 =
dynamic_cast<const TH3*
>(obj)) {
146 if(!
th3->GetEntries())
152 return gotMarker && gotEmptyTH3;
171 if (HasPolymarkerAndFrame(prims)) {
237 Error(
"TGLScenePad::PadPaint",
"Mismatch between pad argument and data-member!");
262 Info(
"TGLScenePad::BeginScene",
"entering.");
266 Error(
"TGLScenePad::BeginScene",
"could not take scene lock.");
270 UInt_t destroyedLogicals = 0;
271 UInt_t destroyedPhysicals = 0;
299 Info(
"TGLScenePad::BeginScene",
"destroyed %d physicals %d logicals in %f msec",
300 destroyedPhysicals, destroyedLogicals, stopwatch.
End());
357 if (physicalID == 0) {
358 Error(
"TGLScenePad::AddObject",
"0 physical ID reserved");
364 Error(
"TGLScenePad::AddObject",
"invalid next physical ID - mix of internal + external IDs?");
370 *addChildren =
kTRUE;
374 Error(
"TGLScenePad::AddObject",
"expected scene to be modify-locked.");
383 RootCsg::TBaseMesh *newMesh = RootCsg::ConvertToMesh(buffer);
411 Error(
"TGLScenePad::AddObject",
"cached physical with no associated cached logical");
423 Bool_t includeRaw = (logical == 0);
426 return extraSections;
432 Error(
"TGLScenePad::AddObject",
"internal physical ID tracking error?");
437 Error(
"TGLScenePad::AddObject",
"expecting to require physical");
446 Error(
"TGLScenePad::AddObject",
"failed to create logical");
467 Error(
"TGLScenePad::AddObject",
"failed to create physical");
485 Error(
"TGLScenePad::OpenComposite",
"composite already open");
490 Error(
"TGLScenePad::OpenComposite",
"expected top level composite to not require extra buffer sections");
530 fCSTokens.push_back(std::make_pair(operation, (RootCsg::TBaseMesh *)0));
547 Error(
"TGLScenePad::ValidateObjectBuffer",
"kCore section of buffer should be filled always");
580 Error(
"TGLScenePad::ValidateObjectBuffer",
"failed to cast buffer of type 'kSphere' to TBuffer3DSphere");
616 const_cast<TBuffer3D&
>(buffer).fColor = 42;
618 switch (buffer.
Type())
635 newLogical =
new TGLSphere(*sphereBuffer);
640 Error(
"TGLScenePad::CreateNewLogical",
"failed to cast buffer of type 'kSphere' to TBuffer3DSphere");
658 Error(
"TGLScenePad::CreateNewLogical",
"failed to cast buffer of type 'kTube/kTubeSeg/kCutTube' to TBuffer3DTube");
668 Error(
"TGLScenePad::CreateNewLogical",
"composite already open");
694 if (colorIndex < 0) colorIndex = 42;
714 }
else if (
TH3 *dTH3 =
dynamic_cast<TH3*
>(obj)) {
715 if(!
th3 && !dTH3->GetEntries())
728 Float_t rgba[4] = {0.f, 0.f, 0.f, 1.};
729 c->GetRGB(rgba[0], rgba[1], rgba[2]);
747 UInt_t opCode = currToken.first;
756 return RootCsg::BuildUnion(left, right);
758 return RootCsg::BuildIntersection(left, right);
760 return RootCsg::BuildDifference(left, right);
762 Error(
"BuildComposite",
"Wrong operation code %d\n", opCode);
786 catch (std::exception&)
792 Warning(
"TGLScenePad::AttemptDirectRenderer",
"failed initializing direct rendering.");
virtual Color_t GetMarkerColor() const
Return the marker color.
Sphere description class - see TBuffer3DTypes for producer classes Supports hollow and cut spheres.
Bool_t IsSolidUncut() const
Test if buffer represents a solid uncut sphere.
Complete tube description class - see TBuffer3DTypes for producer classes.
Generic 3D primitive description class.
Bool_t SectionsValid(UInt_t mask) const
Double_t fLocalMaster[16]
The ROOT global object gROOT contains a list of all defined classes.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
The color creation and management class.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
Implements a native ROOT-GL cylinder that can be rendered at different levels of detail.
Implements a native ROOT-GL representation of an arbitrary set of polygons.
void SetFromMesh(const RootCsg::TBaseMesh *m)
Should only be done on an empty faceset object.
ELock CurrentLock() const
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
16 component (4x4) transform matrix - column MAJOR as per GL.
void Scale(const TGLVector3 &scale)
Set matrix axis scales to 'scale'.
void RotateLF(Int_t i1, Int_t i2, Double_t amount)
Rotate in local frame.
void Translate(const TGLVector3 &vect)
Shift matrix translation components by 'vect' in parent frame.
Base-class for direct OpenGL renderers.
static TClass * GetGLRenderer(TClass *isa)
Return direct-rendering GL class for class isa.
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)=0
Concrete physical shape - a GL drawable.
Description of TGLPlot3D.
static TGLPlot3D * CreatePlot(TH3 *h, TPolyMarker3D *pm)
Create GL plot for specified TH3 and polymarker.
To draw a 3D polyline in a GL window.
To draw a 3D polymarker in a GL window.
Implements VirtualViewer3D interface and fills the base-class visualization structures from pad conte...
TGLLogicalShape * CreateNewLogical(const TBuffer3D &buffer) const
Create and return a new TGLLogicalShape from the supplied buffer.
std::vector< CSPart_t > fCSTokens
virtual void CloseComposite()
Close composite container TVirtualViewer3D interface overload - see base/src/TVirtualViewer3D....
RootCsg::TBaseMesh * BuildComposite()
Build and return composite shape mesh.
void AddHistoPhysical(TGLLogicalShape *log, const Float_t *histColor=0)
Scale and rotate a histo object to mimic placement in canvas.
virtual void AddCompositeOp(UInt_t operation)
Add composite operation used to combine objects added via AddObject TVirtualViewer3D interface overlo...
TGLPhysicalShape * CreateNewPhysical(UInt_t physicalID, const TBuffer3D &buffer, const TGLLogicalShape &logical) const
Create and return a new TGLPhysicalShape with id 'ID', using 'buffer' placement information (translat...
TGLLogicalShape * AttemptDirectRenderer(TObject *id)
Try to construct an appropriate logical-shape sub-class based on id'class, following convention that ...
virtual void PadPaintFromViewer(TGLViewer *viewer)
Entry point for requesting update of scene's contents from gl-viewer.
void SubPadPaint(TVirtualPad *pad)
Iterate over pad-primitives and import them.
UInt_t fLastPID
next internal physical ID (from 1 - 0 reserved)
Int_t ValidateObjectBuffer(const TBuffer3D &buffer, Bool_t includeRaw) const
Validate if the passed 'buffer' contains all sections we require to add object.
Int_t fAcceptedPhysicals
last physical ID that was processed in AddObject()
virtual void PadPaint(TVirtualPad *pad)
Entry point for updating scene contents via VirtualViewer3D interface.
void ComposePolymarker(const TList *padPrimitives)
virtual void ObjectPaint(TObject *obj, Option_t *opt="")
Override of virtual TVirtualViewer3D::ObjectPaint().
virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren=0)
Open new composite container.
UInt_t fCSLevel
Paritally created composite.
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)
Add an object to the viewer, using internal physical IDs TVirtualViewer3D interface overload - see ba...
virtual void BeginScene()
Start building of the scene.
virtual void EndScene()
End building of the scene.
TGLScenePad(const TGLScenePad &)
std::pair< UInt_t, RootCsg::TBaseMesh * > CSPart_t
UInt_t fNextInternalPID
using internal physical IDs
TGLScene provides management and rendering of ROOT's default 3D /object representation as logical and...
virtual TGLPhysicalShape * FindPhysical(UInt_t phid) const
Find and return physical shape identified by unique 'ID'.
virtual Bool_t BeginUpdate()
Put scene in update mode, return true if lock acquired.
virtual void AdoptPhysical(TGLPhysicalShape &shape)
Adopt dynamically created physical 'shape' - add to internal map and take responsibility for deleting...
virtual void EndUpdate(Bool_t minorChange=kTRUE, Bool_t sceneChanged=kTRUE, Bool_t updateViewers=kTRUE)
Exit scene update mode.
virtual Int_t DestroyPhysicals()
Destroy physical shapes.
virtual void AdoptLogical(TGLLogicalShape &shape)
Adopt dynamically created logical 'shape' - add to internal map and take responsibility for deleting.
void EndSmartRefresh()
Wipes logicals in refresh-cache.
static void RGBAFromColorIdx(Float_t rgba[4], Color_t ci, Char_t transp=0)
Fill rgba color from ROOT color-index ci and transparency (0->100).
virtual Int_t DestroyLogicals()
Destroy all logical shapes in scene.
void DumpMapSizes() const
Print sizes of logical and physical-shape maps.
virtual TGLLogicalShape * FindLogical(TObject *logid) const
Find and return logical shape identified by unique logid.
UInt_t BeginSmartRefresh()
Moves logicals that support smart-refresh to intermediate cache.
Implements a native ROOT-GL sphere that can be rendered at different levels of detail.
Stopwatch object for timing GL work.
void Start()
Start timing.
Double_t End()
End timing, return total time since Start(), in milliseconds.
3 component (x/y/z) vector class.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Bool_t GetSmartRefresh() const
The 3-D histogram classes derived from the 1-D histogram classes.
virtual TObjLink * FirstLink() const
TObject * GetObject() const
Option_t * GetOption() const
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual TList * GetListOfPrimitives() const =0
virtual TVirtualViewer3D * GetViewer3D(Option_t *type="")=0
virtual void SetViewer3D(TVirtualViewer3D *)
Abstract 3D shapes viewer.
static constexpr double second
static constexpr double sr
constexpr Double_t PiOver2()
constexpr Double_t DegToRad()
Conversion from degree to radian:
Double_t Sqrt(Double_t x)
Short_t Min(Short_t a, Short_t b)