11#include "TGLIncludes.h"
121 fBoundingBox.Set(buffer.fBBVertex);
124 fBoundingBox.SetAligned(buffer.NbPnts(), buffer.fPnts);
131 fExternalObj =
new TNamed(
"Generic object",
"Internal object created for bookkeeping.");
144 Warning(
"TGLLogicalShape::~TGLLogicalShape",
"some physicals still lurking around.");
176 assert(phys !=
nullptr);
194 Error(
"TGLLogicalShape::SubRef",
"Attempt to un-ref an unregistered physical.");
346 fScene->GetGLCtxIdentity()->RegisterDLNameRangeToWipe(base,
size);
350 Warning(
"TGLLogicalShape::PurgeDLRange",
"Scene unknown, attempting direct deletion.");
351 glDeleteLists(base,
size);
377 Info(
"TGLLogicalShape::Draw",
"this %zd (class %s) LOD %d", (
size_t)
this,
IsA()->GetName(), rnrCtx.
ShapeLOD());
399 Warning(
"TGLLogicalShape::Draw",
"display-list registration failed.");
414 glNewList(
fDLBase + off, GL_COMPILE_AND_EXECUTE);
446 printf(
"TGLLogicalShape::ProcessSelection %d names on the stack (z1=%g, z2=%g).\n",
503 printf(
"TGLLogicalShape::SetEnvDefaults() fgUseDLs=%d, fgUseDLsForVertArrs=%d\n",
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Generic 3D primitive description class.
Bool_t SectionsValid(UInt_t mask) const
TGLColor & Selection(Int_t i)
const UChar_t * CArr() const
UInt_t fRef
! physical instance ref counting
virtual void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec)
Virtual method called-back after a secondary selection hit is recorded (see TGLViewer::HandleButton()...
virtual Bool_t SupportsSecondarySelect() const
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw the GL drawable, using draw flags.
virtual void DLCachePurge()
Purge all entries for all LODs for this drawable from the display list cache, returning the reserved ...
TObject * fExternalObj
! Also plays the role of ID.
virtual Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const
Returns kTRUE if draws should be display list cached kFALSE otherwise.
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const =0
virtual void DrawHighlight(TGLRnrCtx &rnrCtx, const TGLPhysicalShape *pshp, Int_t lvl=-1) const
Draw the logical shape in highlight mode.
UInt_t UnrefFirstPhysical()
Unreferenced first physical in the list, returning its id and making it fit for destruction somewhere...
virtual ~TGLLogicalShape()
Destroy logical shape.
void SubRef(TGLPhysicalShape *phys) const
Remove reference to given physical shape, potentially deleting this object when hitting zero ref-coun...
virtual Short_t QuantizeShapeLOD(Short_t shapeLOD, Short_t combiLOD) const
Logical shapes usually support only discreet LOD values, especially in view of display-list caching.
TGLLogicalShape()
Constructor.
virtual UInt_t DLOffset(Short_t) const
Bool_t fOwnExtObj
! External object is a fake
static void SetIgnoreSizeForCameraInterest(Bool_t isfci)
Set state of static fgIgnoreSizeForCameraInterest flag.
UShort_t fDLValid
! display-list validity bit-field
virtual void DLCacheDrop()
Drop all entries for all LODs for this drawable from the display list cache, WITHOUT returning the re...
void UpdateBoundingBoxesOfPhysicals()
Update bounding-boxed of all dependent physicals.
static Bool_t fgIgnoreSizeForCameraInterest
void AddRef(TGLPhysicalShape *phys) const
Add reference to given physical shape.
void DestroyPhysicals()
Destroy all physicals attached to this logical.
static void SetEnvDefaults()
void InvokeContextMenu(TContextMenu &menu, UInt_t x, UInt_t y) const
Invoke popup menu or our bound external TObject (if any), using passed 'menu' object,...
TGLPhysicalShape * fFirstPhysical
! first replica
Bool_t SetDLCache(Bool_t cached)
Modify capture of draws into display list cache kTRUE - capture, kFALSE direct draw.
UInt_t fDLBase
! display-list id base
TGLScene * fScene
! scene where object is stored (can be zero!)
void PurgeDLRange(UInt_t base, Int_t size) const
Purge given display-list range.
static Bool_t GetIgnoreSizeForCameraInterest()
Get state of static fgIgnoreSizeForCameraInterest flag.
Int_t fDLSize
! display-list size for different LODs
Bool_t fDLCache
! use display list caching
virtual TClass * IsA() const
virtual void DLCacheClear()
Clear all entries for all LODs for this drawable from the display list cache but keeping the reserved...
static Bool_t fgUseDLs
! global flag for usage of display-lists
virtual Bool_t IgnoreSizeForOfInterest() const
Return true if size of this shape should be ignored when determining if the object should be drawn.
static Bool_t fgUseDLsForVertArrs
! global flag for usage of display-lists in shapes that use vertex arrays
Bool_t fRefStrong
! Strong ref (delete on 0 ref); not in scene
Concrete physical shape - a GL drawable.
TGLPhysicalShape * fNextPhysical
! pointer to next replica
const TGLLogicalShape * fLogicalShape
! the associated logical shape
UChar_t GetSelected() const
void UpdateBoundingBox()
Update our internal bounding box (in global frame).
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Bool_t IsDLCaptureOpen() const
Bool_t SecSelection() const
void CloseDLCapture()
End display list capture.
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
void OpenDLCapture()
Start display-list capture.
UInt_t GetItem(Int_t i) const
Standard selection record including information about containing scene and details ob out selected ob...
static UInt_t LockColor()
Prevent further color changes.
static UInt_t UnlockColor()
Allow color changes.
The TNamed class is the base class for all named ROOT classes.
Mother of all ROOT objects.