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())
148 }
else if (dynamic_cast<const TPolyMarker3D *>(obj))
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;
711 if (
TPolyMarker3D *dPm = dynamic_cast<TPolyMarker3D*>(obj)) {
714 }
else if (
TH3 *dTH3 = dynamic_cast<TH3*>(obj)) {
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.");
Complete tube description class - see TBuffer3DTypes for producer classes.
virtual void EndUpdate(Bool_t minorChange=kTRUE, Bool_t sceneChanged=kTRUE, Bool_t updateViewers=kTRUE)
Exit scene update mode.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void AddCompositeOp(UInt_t operation)
Add composite operation used to combine objects added via AddObject TVirtualViewer3D interface overlo...
void Start()
Start timing.
void SetFromMesh(const RootCsg::TBaseMesh *m)
Should only be done on an empty faceset object.
16 component (4x4) transform matrix - column MAJOR as per GL.
Implements a native ROOT-GL cylinder that can be rendered at different levels of detail.
static TGLPlot3D * CreatePlot(TH3 *h, TPolyMarker3D *pm)
Create GL plot for specified TH3 and polymarker.
void ComposePolymarker(const TList *padPrimitives)
Implements a native ROOT-GL representation of an arbitrary set of polygons.
Stopwatch object for timing GL work.
Double_t fLocalMaster[16]
Option_t * GetOption() const
void AddHistoPhysical(TGLLogicalShape *log, const Float_t *histColor=0)
Scale and rotate a histo object to mimic placement in canvas.
Short_t Min(Short_t a, Short_t b)
virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren=0)
Open new composite container.
TGLScenePad(const TGLScenePad &)
TGLLogicalShape * CreateNewLogical(const TBuffer3D &buffer) const
Create and return a new TGLLogicalShape from the supplied buffer.
Concrete physical shape - a GL drawable.
To draw a 3D polyline in a GL window.
Int_t fAcceptedPhysicals
last physical ID that was processed in AddObject()
virtual TGLLogicalShape * FindLogical(TObject *logid) const
Find and return logical shape identified by unique logid.
virtual void AdoptPhysical(TGLPhysicalShape &shape)
Adopt dynamically created physical 'shape' - add to internal map and take responsibility for deleting...
void Translate(const TGLVector3 &vect)
Shift matrix translation components by 'vect' in parent frame.
UInt_t fLastPID
next internal physical ID (from 1 - 0 reserved)
UInt_t BeginSmartRefresh()
Moves logicals that support smart-refresh to intermediate cache.
void RotateLF(Int_t i1, Int_t i2, Double_t amount)
Rotate in local frame.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
void DumpMapSizes() const
Print sizes of logical and physical-shape maps.
Base-class for direct OpenGL renderers.
Sphere description class - see TBuffer3DTypes for producer classes Supports hollow and cut spheres...
Abstract 3D shapes viewer.
3 component (x/y/z) vector class.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
static constexpr double second
The 3-D histogram classes derived from the 1-D histogram classes.
Description of TGLPlot3D.
Bool_t GetSmartRefresh() const
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)=0
virtual void PadPaintFromViewer(TGLViewer *viewer)
Entry point for requesting update of scene's contents from gl-viewer.
TGLLogicalShape * AttemptDirectRenderer(TObject *id)
Try to construct an appropriate logical-shape sub-class based on id'class, following convention that ...
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...
To draw a 3D polymarker in a GL window.
virtual TVirtualViewer3D * GetViewer3D(Option_t *type="")=0
const TGLBoundingBox & BoundingBox() const
Bool_t SectionsValid(UInt_t mask) const
virtual TGLPhysicalShape * FindPhysical(UInt_t phid) const
Find and return physical shape identified by unique 'ID'.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Int_t ValidateObjectBuffer(const TBuffer3D &buffer, Bool_t includeRaw) const
Validate if the passed 'buffer' contains all sections we require to add object.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static TClass * GetGLRenderer(TClass *isa)
Return direct-rendering GL class for class isa.
Implements VirtualViewer3D interface and fills the base-class visualization structures from pad conte...
ELock CurrentLock() const
Generic 3D primitive description class.
The ROOT global object gROOT contains a list of all defined classes.
virtual TList * GetListOfPrimitives() const =0
Base GL viewer object - used by both standalone and embedded (in pad) GL.
virtual void BeginScene()
Start building of the scene.
virtual void SetViewer3D(TVirtualViewer3D *)
RootCsg::TBaseMesh * BuildComposite()
Build and return composite shape mesh.
virtual TObjLink * FirstLink() const
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
UInt_t fNextInternalPID
using internal physical IDs
void EndSmartRefresh()
Wipes logicals in refresh-cache.
virtual Int_t DestroyPhysicals()
Destroy physical shapes.
UInt_t fCSLevel
Paritally created composite.
virtual void CloseComposite()
Close composite container TVirtualViewer3D interface overload - see base/src/TVirtualViewer3D.cxx for description of viewer architecture.
Bool_t IsSolidUncut() const
Test if buffer represents a solid uncut sphere.
Implements a native ROOT-GL sphere that can be rendered at different levels of detail.
virtual Double_t GetEntries() const
Return the current number of entries.
The color creation and management class.
void SubPadPaint(TVirtualPad *pad)
Iterate over pad-primitives and import them.
Mother of all ROOT objects.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
TObject * GetObject() const
std::vector< CSPart_t > fCSTokens
virtual void EndScene()
End building of the scene.
TGLScene provides management and rendering of ROOT's default 3D /object representation as logical and...
std::pair< UInt_t, RootCsg::TBaseMesh * > CSPart_t
virtual void PadPaint(TVirtualPad *pad)
Entry point for updating scene contents via VirtualViewer3D interface.
void Scale(const TGLVector3 &scale)
Set matrix axis scales to 'scale'.
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 Bool_t BeginUpdate()
Put scene in update mode, return true if lock acquired.
virtual Color_t GetMarkerColor() const
Return the marker color.
Double_t Sqrt(Double_t x)
virtual void AdoptLogical(TGLLogicalShape &shape)
Adopt dynamically created logical 'shape' - add to internal map and take responsibility for deleting...
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).
static constexpr double sr
virtual Int_t DestroyLogicals()
Destroy all logical shapes in scene.
virtual void ObjectPaint(TObject *obj, Option_t *opt="")
Override of virtual TVirtualViewer3D::ObjectPaint().
constexpr Double_t PiOver2()
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Double_t End()
End timing, return total time since Start(), in milliseconds.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.