Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGLClipBox Class Reference

Concrete clip box object.

Can be translated, rotated and scaled in all (xyz) axes. By default inside of the box is clipped away.

Definition at line 113 of file TGLClip.h.

Public Types

enum  EManip {
  kTranslateX = 1 << 0 , kTranslateY = 1 << 1 , kTranslateZ = 1 << 2 , kTranslateAll = kTranslateX | kTranslateY | kTranslateZ ,
  kScaleX = 1 << 3 , kScaleY = 1 << 4 , kScaleZ = 1 << 5 , kScaleAll = kScaleX | kScaleY | kScaleZ ,
  kRotateX = 1 << 6 , kRotateY = 1 << 7 , kRotateZ = 1 << 8 , kRotateAll = kRotateX | kRotateY | kRotateZ ,
  kManipAll = kTranslateAll | kScaleAll | kRotateAll
}
enum  EMode { kOutside , kInside }
enum  EType { kClipNone = 0 , kClipPlane , kClipBox }

Public Member Functions

 TGLClipBox ()
 Construct an (initially) axis aligned clip pbox object, extents 'halfLengths', centered on 'center' vertex.
 ~TGLClipBox () override
 Destroy clip box object.
void AddReference (TGLPShapeRef *ref)
 Add reference ref.
const TGLBoundingBoxBoundingBox () const
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 local axes of the shape support LOD adjustment, and the global 'sceneFlags' passed.
const Float_tColor () const
void Draw (TGLRnrCtx &rnrCtx) const override
 Draw out clipping object with blending and back + front filling.
const TGLLogicalShapeGetLogical () const
EManip GetManip () const
EMode GetMode () const
const TGLPhysicalShapeGetNextPhysical () const
TGLVector3 GetScale () const
UChar_t GetSelected () const
TGLVertex3 GetTranslation () const
UInt_t ID () const
void IncTimeStamp ()
void Invalidate ()
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'.
TClassIsA () const override
Bool_t IsInvisible () const
Bool_t IsModified () const
Bool_t IsSelected () const
Bool_t IsTransparent () const
Bool_t IsValid () const
virtual void Modified ()
void PlaneSet (TGLPlaneSet_t &set) const override
 Return set of 6 planes describing faces of the box but invert them so that they point inside of box.
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 Rotate (const TGLVertex3 &pivot, const TGLVector3 &axis, Double_t angle)
void Scale (const TGLVector3 &scale)
void Select (UChar_t select)
void SetColor (const Float_t rgba[17])
 Set full color attributes - see OpenGL material documentation for full description.
void SetColorOnFamily (const Float_t rgba[17])
 Set full color attributes to all physicals sharing the same logical with this object.
void SetDiffuseColor (Color_t ci, UChar_t transparency)
 Set color from standard ROOT representation, that is color index.
void SetDiffuseColor (const Float_t rgba[4])
 Set color from ROOT color index and transparency [0,100].
void SetDiffuseColor (const UChar_t rgba[4])
 Set color from RGBA quadruplet.
void SetManip (EManip manip)
void SetMode (EMode mode)
void SetTransform (const Double_t vals[16])
void SetTransform (const TGLMatrix &transform)
void SetTranslation (const TGLVertex3 &translation)
void Setup (const TGLBoundingBox &bbox) override
 Setup the clip object for scene encompassed by bbox.
void Setup (const TGLVector3 &min_point, const TGLVector3 &max_point) override
 Setup the clip box with min/max points directly.
void SetupGLColors (TGLRnrCtx &rnrCtx, const Float_t *color=nullptr) const
 Setup colors - avoid setting things not required for current draw flags.
void Streamer (TBuffer &) override
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
UInt_t TimeStamp () const
void Translate (const TGLVector3 &vect)

Static Public Member Functions

static TClassClass ()
static const char * Class_Name ()
static constexpr Version_t Class_Version ()
static const char * DeclFileName ()

Protected Attributes

EMode fMode
UInt_t fTimeStamp
Bool_t fValid

Private Member Functions

void InitColor (const Float_t rgba[4])
 Initialise the colors, using basic RGBA diffuse material color supplied.
void UpdateBoundingBox ()
 Update our internal bounding box (in global frame).

Private Attributes

TGLBoundingBox fBoundingBox
 ! bounding box of the physical (transformed)
Float_t fColor [17]
 ! GL color array
TGLPShapeReffFirstPSRef
 ! pointer to first reference
UInt_t fID
 ! unique physical ID within containing scene
Bool_t fInvertedWind
 ! face winding TODO: can get directly from fTransform?
Bool_t fIsScaleForRnr
 ! cache
const TGLLogicalShapefLogicalShape
 ! the associated logical shape
EManip fManip
 ! permitted manipulation bitflags - see EManip
Bool_t fModified
 ! has been modified - retain across scene rebuilds
TGLPhysicalShapefNextPhysical
 ! pointer to next replica
UChar_t fSelected
 ! selected state
TGLMatrix fTransform
 ! transform (placement) of physical instance

Static Private Attributes

static const float fgColor [4] = { 1.0, 0.6, 0.2, 0.3 }
 ! Fixed color of clip box

#include <TGLClip.h>

Inheritance diagram for TGLClipBox:
TGLClip TGLPhysicalShape

Member Enumeration Documentation

◆ EManip

enum TGLPhysicalShape::EManip
inherited
Enumerator
kTranslateX 
kTranslateY 
kTranslateZ 
kTranslateAll 
kScaleX 
kScaleY 
kScaleZ 
kScaleAll 
kRotateX 
kRotateY 
kRotateZ 
kRotateAll 
kManipAll 

Definition at line 41 of file TGLPhysicalShape.h.

◆ EMode

enum TGLClip::EMode
inherited
Enumerator
kOutside 
kInside 

Definition at line 34 of file TGLClip.h.

◆ EType

enum TGLClip::EType
inherited
Enumerator
kClipNone 
kClipPlane 
kClipBox 

Definition at line 39 of file TGLClip.h.

Constructor & Destructor Documentation

◆ TGLClipBox()

TGLClipBox::TGLClipBox ( )

Construct an (initially) axis aligned clip pbox object, extents 'halfLengths', centered on 'center' vertex.

Box can be translated, rotated and scaled in all (xyz) local axes.

Definition at line 261 of file TGLClip.cxx.

◆ ~TGLClipBox()

TGLClipBox::~TGLClipBox ( )
override

Destroy clip box object.

Definition at line 269 of file TGLClip.cxx.

Member Function Documentation

◆ AddReference()

void TGLPhysicalShape::AddReference ( TGLPShapeRef * ref)
inherited

Add reference ref.

Definition at line 138 of file TGLPhysicalShape.cxx.

◆ BoundingBox()

const TGLBoundingBox & TGLPhysicalShape::BoundingBox ( ) const
inlineinherited

Definition at line 88 of file TGLPhysicalShape.h.

◆ CalculateShapeLOD()

void TGLPhysicalShape::CalculateShapeLOD ( TGLRnrCtx & rnrCtx,
Float_t & pixSize,
Short_t & shapeLOD ) const
virtualinherited

Calculate shape-lod, suitable for use under projection defined by 'rnrCtx', taking account of which local axes of the shape support LOD adjustment, and the global 'sceneFlags' passed.

Returned shapeLOD component is from 0 (kLODPixel - lowest quality) to 100 (kLODHigh - highest quality).

Scene flags are not used. LOD quantization is not done. RnrCtx is not modified as this is called via lodification stage of rendering.

Definition at line 430 of file TGLPhysicalShape.cxx.

◆ Class()

TClass * TGLClipBox::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

const char * TGLClipBox::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

constexpr Version_t TGLClipBox::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 127 of file TGLClip.h.

◆ Color()

const Float_t * TGLPhysicalShape::Color ( ) const
inlineinherited

Definition at line 113 of file TGLPhysicalShape.h.

◆ DeclFileName()

const char * TGLClipBox::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 127 of file TGLClip.h.

◆ Draw()

void TGLClip::Draw ( TGLRnrCtx & rnrCtx) const
overridevirtualinherited

Draw out clipping object with blending and back + front filling.

Some clip objects are single face which we want to see both sides of.

Reimplemented from TGLPhysicalShape.

Definition at line 119 of file TGLClip.cxx.

◆ GetLogical()

const TGLLogicalShape * TGLPhysicalShape::GetLogical ( ) const
inlineinherited

Definition at line 96 of file TGLPhysicalShape.h.

◆ GetManip()

EManip TGLPhysicalShape::GetManip ( ) const
inlineinherited

Definition at line 100 of file TGLPhysicalShape.h.

◆ GetMode()

EMode TGLClip::GetMode ( ) const
inlineinherited

Definition at line 60 of file TGLClip.h.

◆ GetNextPhysical()

const TGLPhysicalShape * TGLPhysicalShape::GetNextPhysical ( ) const
inlineinherited

Definition at line 97 of file TGLPhysicalShape.h.

◆ GetScale()

TGLVector3 TGLPhysicalShape::GetScale ( ) const
inlineinherited

Definition at line 141 of file TGLPhysicalShape.h.

◆ GetSelected()

UChar_t TGLPhysicalShape::GetSelected ( ) const
inlineinherited

Definition at line 109 of file TGLPhysicalShape.h.

◆ GetTranslation()

TGLVertex3 TGLPhysicalShape::GetTranslation ( ) const
inlineinherited

Definition at line 147 of file TGLPhysicalShape.h.

◆ ID()

UInt_t TGLPhysicalShape::ID ( ) const
inlineinherited

Definition at line 87 of file TGLPhysicalShape.h.

◆ IncTimeStamp()

void TGLClip::IncTimeStamp ( )
inlineinherited

Definition at line 64 of file TGLClip.h.

◆ InitColor()

void TGLPhysicalShape::InitColor ( const Float_t rgba[4])
privateinherited

Initialise the colors, using basic RGBA diffuse material color supplied.

Definition at line 206 of file TGLPhysicalShape.cxx.

◆ Invalidate()

void TGLClip::Invalidate ( )
inlineinherited

Definition at line 67 of file TGLClip.h.

◆ InvokeContextMenu()

void TGLPhysicalShape::InvokeContextMenu ( TContextMenu & menu,
UInt_t x,
UInt_t y ) const
inherited

Request creation of context menu on shape, attached to 'menu' at screen position 'x' 'y'.

Definition at line 509 of file TGLPhysicalShape.cxx.

◆ IsA()

TClass * TGLClipBox::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TGLClip.

Definition at line 127 of file TGLClip.h.

◆ IsInvisible()

Bool_t TGLPhysicalShape::IsInvisible ( ) const
inlineinherited

Definition at line 115 of file TGLPhysicalShape.h.

◆ IsModified()

Bool_t TGLPhysicalShape::IsModified ( ) const
inlineinherited

Definition at line 105 of file TGLPhysicalShape.h.

◆ IsSelected()

Bool_t TGLPhysicalShape::IsSelected ( ) const
inlineinherited

Definition at line 108 of file TGLPhysicalShape.h.

◆ IsTransparent()

Bool_t TGLPhysicalShape::IsTransparent ( ) const
inlineinherited

Definition at line 114 of file TGLPhysicalShape.h.

◆ IsValid()

Bool_t TGLClip::IsValid ( ) const
inlineinherited

Definition at line 66 of file TGLClip.h.

◆ Modified()

virtual void TGLClip::Modified ( )
inlinevirtualinherited

Definition at line 55 of file TGLClip.h.

◆ PlaneSet()

void TGLClipBox::PlaneSet ( TGLPlaneSet_t & set) const
overridevirtual

Return set of 6 planes describing faces of the box but invert them so that they point inside of box.

Implements TGLClip.

Definition at line 312 of file TGLClip.cxx.

◆ QuantizeShapeLOD()

void TGLPhysicalShape::QuantizeShapeLOD ( Short_t shapeLOD,
Short_t combiLOD,
Short_t & quantLOD ) const
virtualinherited

Factor in scene/vierer LOD and Quantize ... forward to logical shape.

Definition at line 500 of file TGLPhysicalShape.cxx.

◆ RemoveReference()

void TGLPhysicalShape::RemoveReference ( TGLPShapeRef * ref)
inherited

Remove reference ref.

Definition at line 149 of file TGLPhysicalShape.cxx.

◆ Rotate()

void TGLPhysicalShape::Rotate ( const TGLVertex3 & pivot,
const TGLVector3 & axis,
Double_t angle )
inlineinherited

Definition at line 197 of file TGLPhysicalShape.h.

◆ Scale()

void TGLPhysicalShape::Scale ( const TGLVector3 & scale)
inlineinherited

Definition at line 185 of file TGLPhysicalShape.h.

◆ Select()

void TGLPhysicalShape::Select ( UChar_t select)
inlineinherited

Definition at line 110 of file TGLPhysicalShape.h.

◆ SetColor()

void TGLPhysicalShape::SetColor ( const Float_t color[17])
inherited

Set full color attributes - see OpenGL material documentation for full description.

0->3 diffuse, 4->7 ambient, 8->11 specular, 12->15 emission, 16 shininess

Definition at line 226 of file TGLPhysicalShape.cxx.

◆ SetColorOnFamily()

void TGLPhysicalShape::SetColorOnFamily ( const Float_t rgba[17])
inherited

Set full color attributes to all physicals sharing the same logical with this object.

Definition at line 240 of file TGLPhysicalShape.cxx.

◆ SetDiffuseColor() [1/3]

void TGLPhysicalShape::SetDiffuseColor ( Color_t ci,
UChar_t transparency )
inherited

Set color from standard ROOT representation, that is color index.

  • transparency in range [0, 100].

Definition at line 274 of file TGLPhysicalShape.cxx.

◆ SetDiffuseColor() [2/3]

void TGLPhysicalShape::SetDiffuseColor ( const Float_t rgba[4])
inherited

Set color from ROOT color index and transparency [0,100].

Definition at line 253 of file TGLPhysicalShape.cxx.

◆ SetDiffuseColor() [3/3]

void TGLPhysicalShape::SetDiffuseColor ( const UChar_t rgba[4])
inherited

Set color from RGBA quadruplet.

Definition at line 263 of file TGLPhysicalShape.cxx.

◆ SetManip()

void TGLPhysicalShape::SetManip ( EManip manip)
inlineinherited

Definition at line 101 of file TGLPhysicalShape.h.

◆ SetMode()

void TGLClip::SetMode ( EMode mode)
inlineinherited

Definition at line 61 of file TGLClip.h.

◆ SetTransform() [1/2]

void TGLPhysicalShape::SetTransform ( const Double_t vals[16])
inlineinherited

Definition at line 161 of file TGLPhysicalShape.h.

◆ SetTransform() [2/2]

void TGLPhysicalShape::SetTransform ( const TGLMatrix & transform)
inlineinherited

Definition at line 153 of file TGLPhysicalShape.h.

◆ SetTranslation()

void TGLPhysicalShape::SetTranslation ( const TGLVertex3 & translation)
inlineinherited

Definition at line 169 of file TGLPhysicalShape.h.

◆ Setup() [1/2]

void TGLClipBox::Setup ( const TGLBoundingBox & bbox)
overridevirtual

Setup the clip object for scene encompassed by bbox.

Implements TGLClip.

Definition at line 276 of file TGLClip.cxx.

◆ Setup() [2/2]

void TGLClipBox::Setup ( const TGLVector3 & min_point,
const TGLVector3 & max_point )
overridevirtual

Setup the clip box with min/max points directly.

This only makes sense if you disable auto-update of the clip-object:

gl_viewer->SetClipAutoUpdate(kFALSE).

After calling this also call gl_viewer->RefreshPadEditor(gl_viewer) and gl_viewer->RequestDraw().

Reimplemented from TGLClip.

Definition at line 299 of file TGLClip.cxx.

◆ SetupGLColors()

void TGLPhysicalShape::SetupGLColors ( TGLRnrCtx & rnrCtx,
const Float_t * color = nullptr ) const
inherited

Setup colors - avoid setting things not required for current draw flags.

Definition at line 291 of file TGLPhysicalShape.cxx.

◆ Streamer()

void TGLClipBox::Streamer ( TBuffer & )
overridevirtual

Reimplemented from TGLClip.

◆ StreamerNVirtual()

void TGLClipBox::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 127 of file TGLClip.h.

◆ TimeStamp()

UInt_t TGLClip::TimeStamp ( ) const
inlineinherited

Definition at line 63 of file TGLClip.h.

◆ Translate()

void TGLPhysicalShape::Translate ( const TGLVector3 & vect)
inlineinherited

Definition at line 177 of file TGLPhysicalShape.h.

◆ UpdateBoundingBox()

void TGLPhysicalShape::UpdateBoundingBox ( )
privateinherited

Update our internal bounding box (in global frame).

Definition at line 192 of file TGLPhysicalShape.cxx.

Member Data Documentation

◆ fBoundingBox

TGLBoundingBox TGLPhysicalShape::fBoundingBox
privateinherited

! bounding box of the physical (transformed)

Definition at line 63 of file TGLPhysicalShape.h.

◆ fColor

Float_t TGLPhysicalShape::fColor[17]
privateinherited

! GL color array

Definition at line 64 of file TGLPhysicalShape.h.

◆ fFirstPSRef

TGLPShapeRef* TGLPhysicalShape::fFirstPSRef
privateinherited

! pointer to first reference

Definition at line 59 of file TGLPhysicalShape.h.

◆ fgColor

const float TGLClipBox::fgColor = { 1.0, 0.6, 0.2, 0.3 }
staticprivate

! Fixed color of clip box

Definition at line 254 of file TGLClip.h.

◆ fID

UInt_t TGLPhysicalShape::fID
privateinherited

! unique physical ID within containing scene

Definition at line 61 of file TGLPhysicalShape.h.

◆ fInvertedWind

Bool_t TGLPhysicalShape::fInvertedWind
privateinherited

! face winding TODO: can get directly from fTransform?

Definition at line 67 of file TGLPhysicalShape.h.

◆ fIsScaleForRnr

Bool_t TGLPhysicalShape::fIsScaleForRnr
privateinherited

! cache

Definition at line 69 of file TGLPhysicalShape.h.

◆ fLogicalShape

const TGLLogicalShape* TGLPhysicalShape::fLogicalShape
privateinherited

! the associated logical shape

Definition at line 57 of file TGLPhysicalShape.h.

◆ fManip

EManip TGLPhysicalShape::fManip
privateinherited

! permitted manipulation bitflags - see EManip

Definition at line 65 of file TGLPhysicalShape.h.

◆ fMode

EMode TGLClip::fMode
protectedinherited

Definition at line 47 of file TGLClip.h.

◆ fModified

Bool_t TGLPhysicalShape::fModified
privateinherited

! has been modified - retain across scene rebuilds

Definition at line 68 of file TGLPhysicalShape.h.

◆ fNextPhysical

TGLPhysicalShape* TGLPhysicalShape::fNextPhysical
privateinherited

! pointer to next replica

Definition at line 58 of file TGLPhysicalShape.h.

◆ fSelected

UChar_t TGLPhysicalShape::fSelected
privateinherited

! selected state

Definition at line 66 of file TGLPhysicalShape.h.

◆ fTimeStamp

UInt_t TGLClip::fTimeStamp
protectedinherited

Definition at line 48 of file TGLClip.h.

◆ fTransform

TGLMatrix TGLPhysicalShape::fTransform
privateinherited

! transform (placement) of physical instance

Definition at line 62 of file TGLPhysicalShape.h.

◆ fValid

Bool_t TGLClip::fValid
protectedinherited

Definition at line 49 of file TGLClip.h.


The documentation for this class was generated from the following files: