ROOT
6.06/09
Reference Guide
|
Concrete physical shape - a GL drawable.
Physical shapes are the objects the user can actually see, select, move in the viewer. It is a placement of the associated local frame TGLLogicaShape into the world frame. The draw process is:
Load attributes - material colors etc Load translation matrix - placement Load gl name (for selection) Call our associated logical shape Draw() to draw placed shape
The physical shape supports translation, scaling and rotation, selection, color changes, and permitted modification flags etc. A physical shape cannot modify or be bound to another (or no) logical shape - hence const & handle. It can perform mutable reference counting on the logical to enable purging.
Physical shape also maintains a list of references to it and provides notifications of change and destruction. See class TGLPShapeRef which needs to be sub-classes for real use.
See base/src/TVirtualViewer3D for description of common external 3D viewer architecture and how external viewer clients use it.
Definition at line 33 of file TGLPhysicalShape.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 } |
Public Member Functions | |
TGLPhysicalShape (UInt_t ID, const TGLLogicalShape &logicalShape, const TGLMatrix &transform, Bool_t invertedWind, const Float_t rgba[4]) | |
TGLPhysicalShape (UInt_t ID, const TGLLogicalShape &logicalShape, const double *transform, Bool_t invertedWind, const Float_t rgba[4]) | |
Construct a physical shape using arguments: More... | |
virtual | ~TGLPhysicalShape () |
Destroy the physical shape. More... | |
void | AddReference (TGLPShapeRef *ref) |
Add reference ref. More... | |
void | RemoveReference (TGLPShapeRef *ref) |
Remove reference ref. More... | |
UInt_t | ID () const |
const TGLBoundingBox & | BoundingBox () 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. More... | |
virtual void | QuantizeShapeLOD (Short_t shapeLOD, Short_t combiLOD, Short_t &quantLOD) const |
Factor in scene/vierer LOD and Quantize ... More... | |
void | SetupGLColors (TGLRnrCtx &rnrCtx, const Float_t *color=0) const |
Setup colors - avoid setting things not required for current draw flags. More... | |
virtual void | Draw (TGLRnrCtx &rnrCtx) const |
Draw physical shape, using LOD flags, potential from display list cache. More... | |
const TGLLogicalShape * | GetLogical () const |
const TGLPhysicalShape * | GetNextPhysical () const |
EManip | GetManip () const |
void | SetManip (EManip manip) |
void | Modified () |
Call this after modifying the physical so that the information can be propagated to the object referencing it. More... | |
Bool_t | IsModified () const |
Bool_t | IsSelected () const |
UChar_t | GetSelected () const |
void | Select (UChar_t select) |
const Float_t * | Color () const |
Bool_t | IsTransparent () const |
Bool_t | IsInvisible () const |
void | SetColor (const Float_t rgba[17]) |
Set full color attributes - see OpenGL material documentation for full description. More... | |
void | SetColorOnFamily (const Float_t rgba[17]) |
Set full color attributes to all physicals sharing the same logical with this object. More... | |
void | SetDiffuseColor (const Float_t rgba[4]) |
Set color from ROOT color index and transparency [0,100]. More... | |
void | SetDiffuseColor (const UChar_t rgba[4]) |
Set color from RGBA quadruplet. More... | |
void | SetDiffuseColor (Color_t ci, UChar_t transparency) |
Set color from standard ROOT representation, that is color index. More... | |
TGLVector3 | GetScale () const |
TGLVertex3 | GetTranslation () const |
void | SetTransform (const TGLMatrix &transform) |
void | SetTransform (const Double_t vals[16]) |
void | SetTranslation (const TGLVertex3 &translation) |
void | Translate (const TGLVector3 &vect) |
void | Scale (const TGLVector3 &scale) |
void | Rotate (const TGLVertex3 &pivot, const TGLVector3 &axis, Double_t angle) |
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'. More... | |
Private Member Functions | |
TGLPhysicalShape (const TGLPhysicalShape &) | |
TGLPhysicalShape & | operator= (const TGLPhysicalShape &) |
void | UpdateBoundingBox () |
cache More... | |
void | InitColor (const Float_t rgba[4]) |
Initialise the colors, using basic RGBA diffuse material color supplied. More... | |
Private Attributes | |
const TGLLogicalShape * | fLogicalShape |
TGLPhysicalShape * | fNextPhysical |
the associated logical shape More... | |
TGLPShapeRef * | fFirstPSRef |
pointer to next replica More... | |
UInt_t | fID |
pointer to first reference More... | |
TGLMatrix | fTransform |
unique physical ID within containing scene More... | |
TGLBoundingBox | fBoundingBox |
transform (placement) of physical instance More... | |
Float_t | fColor [17] |
bounding box of the physical (transformed) More... | |
EManip | fManip |
GL color array. More... | |
UChar_t | fSelected |
permitted manipulation bitflags - see EManip More... | |
Bool_t | fInvertedWind |
selected state More... | |
Bool_t | fModified |
face winding TODO: can get directly from fTransform? More... | |
Bool_t | fIsScaleForRnr |
has been modified - retain across scene rebuilds More... | |
Friends | |
class | TGLLogicalShape |
#include <TGLPhysicalShape.h>
Enumerator | |
---|---|
kTranslateX | |
kTranslateY | |
kTranslateZ | |
kTranslateAll | |
kScaleX | |
kScaleY | |
kScaleZ | |
kScaleAll | |
kRotateX | |
kRotateY | |
kRotateZ | |
kRotateAll | |
kManipAll |
Definition at line 43 of file TGLPhysicalShape.h.
|
private |
TGLPhysicalShape::TGLPhysicalShape | ( | UInt_t | ID, |
const TGLLogicalShape & | logicalShape, | ||
const TGLMatrix & | transform, | ||
Bool_t | invertedWind, | ||
const Float_t | rgba[4] | ||
) |
TGLPhysicalShape::TGLPhysicalShape | ( | UInt_t | id, |
const TGLLogicalShape & | logicalShape, | ||
const double * | transform, | ||
Bool_t | invertedWind, | ||
const Float_t | rgba[4] | ||
) |
Construct a physical shape using arguments:
Definition at line 95 of file TGLPhysicalShape.cxx.
|
virtual |
Destroy the physical shape.
Definition at line 124 of file TGLPhysicalShape.cxx.
void TGLPhysicalShape::AddReference | ( | TGLPShapeRef * | ref | ) |
Add reference ref.
Definition at line 139 of file TGLPhysicalShape.cxx.
Referenced by TGLPShapeRef::SetPShape().
|
inline |
Definition at line 90 of file TGLPhysicalShape.h.
Referenced by TGLScene::CalcBoundingBox(), CalculateShapeLOD(), TGLScene::ComparePhysicalDiagonals(), TGLScene::ComparePhysicalVolumes(), TGLTransManip::Draw(), TGLScaleManip::Draw(), TGLRotateManip::Draw(), TGLClipSet::GetClipState(), TGLRotateManip::HandleButton(), TGLTransManip::HandleMotion(), TGLScaleManip::HandleMotion(), TGLClipPlane::PlaneSet(), TGLClipBox::PlaneSet(), TGLScene::RebuildSceneInfo(), TGLManipSet::Render(), TGLScene::RenderElements(), Rotate(), TGLAutoRotator::RotateScene(), TGLClipPlane::Set(), TGLClipSet::SetClipState(), TGLClipPlane::Setup(), and TGLScene::UpdateSceneInfo().
|
virtual |
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 431 of file TGLPhysicalShape.cxx.
Referenced by TGLScene::UpdateSceneInfo().
|
inline |
Definition at line 115 of file TGLPhysicalShape.h.
Referenced by TH3GL::DirectDraw(), and TGLPShapeObjEditor::SetModel().
Draw physical shape, using LOD flags, potential from display list cache.
Reimplemented in TGLClip.
Definition at line 338 of file TGLPhysicalShape.cxx.
Referenced by TGLViewer::DoSecondarySelect(), TGLClip::Draw(), and TGLScene::RenderElements().
|
inline |
Definition at line 98 of file TGLPhysicalShape.h.
Referenced by TStructViewerGUI::MouseOverSlot(), TGLScene::RebuildSceneInfo(), TGLScene::ResolveSelectRecord(), TGLAutoRotator::RotateScene(), TGLSAViewer::SelectionChanged(), TGLClipPlane::Setup(), TGLClipBox::Setup(), and TGLScene::TSceneInfo::UpdateDrawStats().
|
inline |
Definition at line 102 of file TGLPhysicalShape.h.
Referenced by TGLTransManip::Draw(), TGLScaleManip::Draw(), and TGLRotateManip::Draw().
|
inline |
Definition at line 99 of file TGLPhysicalShape.h.
|
inline |
Definition at line 143 of file TGLPhysicalShape.h.
Referenced by TGLScaleManip::HandleButton(), TGLClipSet::SetClipState(), and TGLPShapeObjEditor::SetModel().
|
inline |
Definition at line 111 of file TGLPhysicalShape.h.
Referenced by TEvePolygonSetProjectedGL::DrawHighlight(), and TGLLogicalShape::DrawHighlight().
|
inline |
Definition at line 149 of file TGLPhysicalShape.h.
Referenced by TGLPShapeObjEditor::SetModel().
|
inline |
Definition at line 89 of file TGLPhysicalShape.h.
Referenced by TGLScene::AdoptPhysical(), TGLViewer::DoSecondarySelect(), TGLScene::RenderElements(), and TGLLogicalShape::UnrefFirstPhysical().
Initialise the colors, using basic RGBA diffuse material color supplied.
Definition at line 207 of file TGLPhysicalShape.cxx.
Referenced by TGLPhysicalShape().
void TGLPhysicalShape::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'.
Definition at line 510 of file TGLPhysicalShape.cxx.
Referenced by TGLEventHandler::PopupContextMenu().
|
inline |
Definition at line 117 of file TGLPhysicalShape.h.
|
inline |
Definition at line 107 of file TGLPhysicalShape.h.
|
inline |
Definition at line 110 of file TGLPhysicalShape.h.
|
inline |
Definition at line 116 of file TGLPhysicalShape.h.
Referenced by TGLScene::ResolveSelectRecord(), and TGLScene::TSceneInfo::UpdateDrawStats().
void TGLPhysicalShape::Modified | ( | ) |
Call this after modifying the physical so that the information can be propagated to the object referencing it.
Definition at line 180 of file TGLPhysicalShape.cxx.
Referenced by TGLClip::Modified(), Rotate(), Scale(), SetColor(), SetDiffuseColor(), SetTransform(), SetTranslation(), and Translate().
|
private |
|
virtual |
Factor in scene/vierer LOD and Quantize ...
forward to logical shape.
Definition at line 501 of file TGLPhysicalShape.cxx.
void TGLPhysicalShape::RemoveReference | ( | TGLPShapeRef * | ref | ) |
Remove reference ref.
Definition at line 150 of file TGLPhysicalShape.cxx.
Referenced by TGLPShapeRef::SetPShape().
|
inline |
Definition at line 199 of file TGLPhysicalShape.h.
Referenced by TGLRotateManip::HandleMotion().
|
inline |
Definition at line 187 of file TGLPhysicalShape.h.
Referenced by TGLPShapeObjEditor::DoGeoButton(), TGLScaleManip::HandleMotion(), and TGLClipSet::SetClipState().
Definition at line 112 of file TGLPhysicalShape.h.
Referenced by TEveSceneList::ProcessSceneChanges(), and TEveScene::Repaint().
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 227 of file TGLPhysicalShape.cxx.
Referenced by TGLPShapeObjEditor::DoColorButton(), and SetColorOnFamily().
Set full color attributes to all physicals sharing the same logical with this object.
Definition at line 241 of file TGLPhysicalShape.cxx.
Referenced by TGLPShapeObjEditor::DoColorButton().
Set color from ROOT color index and transparency [0,100].
Definition at line 254 of file TGLPhysicalShape.cxx.
Referenced by TEveSceneList::ProcessSceneChanges(), TGLScene::UpdatePhysical(), and TGLScene::UpdatePhysioLogical().
Set color from RGBA quadruplet.
Definition at line 264 of file TGLPhysicalShape.cxx.
Set color from standard ROOT representation, that is color index.
Definition at line 275 of file TGLPhysicalShape.cxx.
Definition at line 103 of file TGLPhysicalShape.h.
Referenced by TGLClipPlane::TGLClipPlane().
Definition at line 155 of file TGLPhysicalShape.h.
Referenced by TEveSceneList::ProcessSceneChanges(), TGLClipSetSubEditor::ResetViewerClip(), TGLClipPlane::Set(), TGLClipPlane::Setup(), TGLScene::UpdatePhysical(), and TGLScene::UpdatePhysioLogical().
Definition at line 163 of file TGLPhysicalShape.h.
|
inline |
Definition at line 171 of file TGLPhysicalShape.h.
Referenced by TGLPShapeObjEditor::DoGeoButton().
Setup colors - avoid setting things not required for current draw flags.
Definition at line 292 of file TGLPhysicalShape.cxx.
Referenced by Draw().
|
inline |
Definition at line 179 of file TGLPhysicalShape.h.
Referenced by TGLTransManip::HandleMotion(), Scale(), and TGLClipSet::SetClipState().
|
private |
cache
Update our internal bounding box (in global frame).
Definition at line 193 of file TGLPhysicalShape.cxx.
Referenced by Rotate(), Scale(), SetTransform(), SetTranslation(), TGLPhysicalShape(), Translate(), and TGLLogicalShape::UpdateBoundingBoxesOfPhysicals().
|
friend |
Definition at line 35 of file TGLPhysicalShape.h.
|
private |
transform (placement) of physical instance
Definition at line 65 of file TGLPhysicalShape.h.
Referenced by BoundingBox(), Scale(), and UpdateBoundingBox().
|
private |
bounding box of the physical (transformed)
Definition at line 66 of file TGLPhysicalShape.h.
Referenced by Color(), Draw(), InitColor(), SetColor(), SetDiffuseColor(), and SetupGLColors().
|
private |
pointer to next replica
Definition at line 61 of file TGLPhysicalShape.h.
Referenced by AddReference(), Modified(), RemoveReference(), and ~TGLPhysicalShape().
|
private |
|
private |
|
private |
has been modified - retain across scene rebuilds
Definition at line 71 of file TGLPhysicalShape.h.
Referenced by Draw(), and UpdateBoundingBox().
|
private |
Definition at line 59 of file TGLPhysicalShape.h.
Referenced by CalculateShapeLOD(), TGLLogicalShape::DestroyPhysicals(), Draw(), GetLogical(), InvokeContextMenu(), QuantizeShapeLOD(), SetColorOnFamily(), TGLPhysicalShape(), TGLLogicalShape::UnrefFirstPhysical(), UpdateBoundingBox(), and ~TGLPhysicalShape().
|
private |
|
private |
face winding TODO: can get directly from fTransform?
Definition at line 70 of file TGLPhysicalShape.h.
Referenced by IsModified(), and Modified().
|
private |
the associated logical shape
Definition at line 60 of file TGLPhysicalShape.h.
Referenced by TGLLogicalShape::AddRef(), TGLLogicalShape::DestroyPhysicals(), GetNextPhysical(), SetColorOnFamily(), TGLLogicalShape::SubRef(), TGLLogicalShape::UnrefFirstPhysical(), and TGLLogicalShape::UpdateBoundingBoxesOfPhysicals().
|
private |
permitted manipulation bitflags - see EManip
Definition at line 68 of file TGLPhysicalShape.h.
Referenced by GetSelected().
|
private |
unique physical ID within containing scene
Definition at line 64 of file TGLPhysicalShape.h.
Referenced by Draw(), GetScale(), GetTranslation(), Rotate(), Scale(), SetTransform(), SetTranslation(), TGLPhysicalShape(), Translate(), and UpdateBoundingBox().