library: libRGL #include "TGLScene.h" |
TGLScene
class description - header file - source file
viewCVS header - viewCVS source
class TGLScene
Function Members (Methods)
Display options:
public:
| TGLScene() |
virtual | ~TGLScene() |
void | ActivateSecSelect() |
void | AdoptLogical(TGLLogicalShape& shape) |
void | AdoptPhysical(TGLPhysicalShape& shape) |
void | ApplySelection() |
void | BeginSmartRefresh() |
const TGLBoundingBox& | BoundingBox() const |
static TClass* | Class() |
void | ClearClips() |
TGLScene::ELock | CurrentLock() const |
Bool_t | DestroyLogical(ULong_t ID) |
UInt_t | DestroyLogicals() |
Bool_t | DestroyPhysical(ULong_t ID) |
UInt_t | DestroyPhysicals(Bool_t incModified, const TGLCamera* camera = 0) |
void | Draw(const TGLCamera& camera, TGLDrawFlags sceneFlags, Double_t timeout, Int_t axesType, const TGLVertex3* reference, Bool_t forSelect = kFALSE) |
void | Dump() const |
void | EndSmartRefresh() |
TGLLogicalShape* | FindLogical(ULong_t ID) const |
TGLLogicalShape* | FindLogicalSmartRefresh(ULong_t ID) const |
TGLPhysicalShape* | FindPhysical(ULong_t ID) const |
TGLCameraMarkupStyle* | GetCameraMarkup() const |
void | GetClipState(EClipType type, Double_t* data) const |
void | GetCurrentClip(EClipType& type, Bool_t& edit) const |
pair<UInt_t,UInt_t*> | GetHitRecord(Int_t i) const |
Int_t | GetNPrimHits() const |
Int_t | GetNSecHits() const |
TGLPhysicalShape* | GetSelected() const |
TGLPhysicalShape* | GetSelectionResult() const |
Bool_t | GetTriedSecSelect() const |
Bool_t | GetTrySecSelect() const |
Bool_t | HandleButton(const Event_t& event, const TGLCamera& camera) |
Bool_t | HandleMotion(const Event_t& event, const TGLCamera& camera) |
virtual TClass* | IsA() const |
Bool_t | IsLocked() const |
static const char* | LockName(TGLScene::ELock lock) |
static Bool_t | LockValid(TGLScene::ELock lock) |
void | PurgeNextLogical() |
Bool_t | ReleaseLock(TGLScene::ELock lock) const |
Bool_t | Select(const TGLCamera& camera, const TGLDrawFlags& sceneFlags) |
void | SetCameraMarkup(TGLCameraMarkupStyle* m) |
void | SetClipState(EClipType type, const Double_t* data) |
Bool_t | SetColorOnSelectedFamily(const Float_t* rgba) |
void | SetCurrentClip(EClipType type, Bool_t edit) |
void | SetCurrentManip(EManipType type) |
Bool_t | SetSelectedColor(const Float_t* rgba) |
Bool_t | SetSelectedGeom(const TGLVertex3& trans, const TGLVector3& scale) |
void | SetupClips() |
virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
UInt_t | SizeOf() const |
virtual void | Streamer(TBuffer& b) |
void | StreamerNVirtual(TBuffer& b) |
Bool_t | TakeLock(TGLScene::ELock lock) const |
Data Members
public:
enum ELock { | kUnlocked | |
| kDrawLock | |
| kSelectLock | |
| kModifyLock | |
}; | | |
private:
TGLScene::ELock | fLock | ! |
map<unsigned long,TGLLogicalShape*,less<unsigned long>,allocator<pair<const unsigned long,TGLLogicalShape*> > > | fLogicalShapes | ! |
map<unsigned long,TGLPhysicalShape*,less<unsigned long>,allocator<pair<const unsigned long,TGLPhysicalShape*> > > | fPhysicalShapes | ! |
vector<const TGLPhysicalShape*,allocator<const TGLPhysicalShape*> > | fDrawList | ! |
Bool_t | fDrawListValid | ! (do we need this & fBoundingBoxValid) |
Bool_t | fInSmartRefresh | ! |
map<unsigned long,TGLLogicalShape*,less<unsigned long>,allocator<pair<const unsigned long,TGLLogicalShape*> > > | fSmartRefreshCache | ! |
TGLBoundingBox | fBoundingBox | ! bounding box for scene (axis aligned) - lazy update - use BoundingBox() to access |
Bool_t | fBoundingBoxValid | ! bounding box valid? |
TGLPhysicalShape* | fSelectedPhysical | ! current selected physical shape |
TGLPhysicalShape* | fSelectionResult | ! physical shape found by last Select |
Int_t | fNPrimHits | ! number of primary selection hits |
Int_t | fNSecHits | ! number of secondary selection hits |
Bool_t | fTrySecSelect | ! flag controlling if secondary selection should be tried |
Bool_t | fTriedSecSelect | ! flag reporting if secondary selection was actually tried |
vector<UInt_t> | fSelectBuffer | ! buffer holding GL selection result |
vector<std::pair<UInt_t,UInt_t*> > | fSortedHits | ! depth-sorted selection result |
TGLClipPlane* | fClipPlane | |
TGLClipBox* | fClipBox | |
TGLClip* | fCurrentClip | ! the current clipping shape |
TGLCameraMarkupStyle* | fCameraMarkup | overlay GL text config |
TGLTransManip | fTransManip | ! translation manipulator |
TGLScaleManip | fScaleManip | ! scaling manipulator |
TGLRotateManip | fRotateManip | ! rotation manipulator |
TGLManip* | fCurrentManip | ! current manipulator |
TGLScene::DrawStats_t | fDrawStats | |
TGLScene
A GL scene is the container for all the viewable objects (shapes)
loaded into the viewer. It consists of two main stl::maps containing
the TGLLogicalShape and TGLPhysicalShape collections, and interface
functions enabling viewers to manage objects in these. The physical
shapes defined the placement of copies of the logical shapes - see
TGLLogicalShape/TGLPhysicalShape for more information on relationship
The scene can be drawn by owning viewer, passing camera, draw style
& quality (LOD), clipping etc - see Draw(). The scene can also be
drawn for selection in similar fashion - see Select(). The scene
keeps track of a single selected physical - which can be modified by
viewers.
The scene maintains a lazy calculated bounding box for the total
scene extents, axis aligned round TGLPhysicalShape shapes.
Currently a scene is owned exclusively by one viewer - however it is
intended that it could easily be shared by multiple viewers - for
efficiency and syncronisation reasons. Hence viewer variant objects
camera, clips etc being owned by viewer and passed at draw/select
~TGLScene()
Purge out the DL cache - when per drawable DL purging implemented
this no longer really required. However should be faster....
void AdoptLogical(TGLLogicalShape & shape)
Adopt dynamically created logical 'shape' - add to internal map and take
responsibility for deleting
Bool_t DestroyLogical(ULong_t ID)
Zero ID logical shapes are not unique - this simple means the external object
does not exist - should never be asked to destroy these singularly
TGLLogicalShape * FindLogical(ULong_t ID)
Zero ID logical shapes are not unique - this simple means the external object
does not exist - should never be asked to seach for this
void AdoptPhysical(TGLPhysicalShape & shape)
Adopt dynamically created physical 'shape' - add to internal map and take
responsibility for deleting
void Draw(const TGLCamera & camera, TGLDrawFlags sceneFlags, Double_t timeout, Int_t axesType, const TGLVertex3 * reference, Bool_t forSelect)
Draw out scene into current GL context, using passed arguments:
'camera' - used for for object culling, manip scalling
'sceneFlags' - draw flags for scene - see TGLDrawFlags
'timeout'- timeout for scene draw (in milliseconds) - if 0.0 unlimited
'axesType' - axis style - one of TGLViewer::EAxesType
'reference' - position of reference marker (or none if null)
'forSelect' - is draw for select? If kTRUE clip and manip objects (which
cannot be selected) are not drawn
void SortDrawList()
Sort the TGLPhysical draw list by shape bounding box volume, from
large to small. This makes dropout of shapes with time limited
Draw() calls must less noticable. As this does not use projected
size it only needs to be done after a scene content change - not
everytime scene drawn (potential camera/projection change).
void DrawGuides(const TGLCamera & camera, Int_t axesType, const TGLVertex3 * reference)
Draw out scene guides - axes and reference marker
'camera' - current active camera - required for calculating projection size
'axesType' - kAxesNone, kAxesOrigin (run through origin), kAxesEdge (at scene box edge)
'reference' - if not null, draw orange reference sphere at vertex
Bool_t Select(const TGLCamera & camera, const TGLDrawFlags & sceneFlags)
Perform select draw using arguments:
'camera' - used for for object culling
'style' - draw style kFill (filled polygons) kOutline (polygons + outlines)
kWireFrame
Arguments are passed on to Draw(), with unlimted time
Returns kTRUE if selected object is different then currently selected
fSelectedPhysical. The result is stored in fSelectionResult member.
One still has to call ApplySelection() to activate this change.
If secondary-selection is activated (by calling
ActivateSecSelect() prior requesting the selection another
selection pass is done on selected object if it supports
secondary selection. The secondary select records are then available in:
fTriedSecSelect, fNSecHits, fSelectBuffer and fSortedHits.
Bool_t SetSelectedColor(const Float_t color[17])
Set full color attributes on current selected physical shape:
0...3 - diffuse
4...7 - ambient
8...11 - specular
12..15 - emission
16 - shininess
see OpenGL documentation for details of materials
Bool_t SetColorOnSelectedFamily(const Float_t color[17])
Set full color attributes on all physical shapes sharing the same
logical shape as the selected physical
0...3 - diffuse
4...7 - ambient
8...11 - specular
12..15 - emission
16 - shininess
see OpenGL documentation for details of materials
Bool_t SetSelectedGeom(const TGLVertex3 & trans, const TGLVector3 & scale)
Update geometry of the selected physical. 'trans' and 'scale' specify the
translation and scaling components of the physical shapes translation matrix
See TGLMatrix for more details
void SetupClips()
Setup clipping objects for current scene bounding box
void ClearClips()
Clear out exising clipping objects
void GetClipState(EClipType type, Double_t data[6])
Get state of clip object 'type' into data vector:
'type' requested 'data' contents returned
kClipPlane 4 components - A,B,C,D - of plane eq : Ax+By+CZ+D = 0
kBoxPlane 6 components - Box Center X/Y/Z - Box Extents X/Y/Z
void SetClipState(EClipType type, const Double_t data[6])
Set state of clip object 'type' into data vector:
'type' specified 'data' contents interpretation
kClipNone ignored
kClipPlane 4 components - A,B,C,D - of plane eq : Ax+By+CZ+D = 0
kBoxPlane 6 components - Box Center X/Y/Z - Box Extents X/Y/Z
void GetCurrentClip(EClipType & type, Bool_t & edit)
Get current type active in viewer - returns one of kClipNone
kClipPlane or kClipBox
void SetCurrentClip(EClipType type, Bool_t edit)
Set current clip active in viewer - 'type' is one of kClipNone
kClipPlane or kClipBox. 'edit' indicates if clip object should
been shown/edited directly in viewer (current manipulator attached to it)
kTRUE if so (ignored for kClipNone), kFALSE otherwise
const TGLBoundingBox & BoundingBox()
Update (if required) and return the scene bounding box
Encapsulates all physical shapes bounding box with axes aligned box
void Dump()
Output simple scene stats to std::cout
UInt_t SizeOf()
Return memory cost of scene
Warning: NOT CORRECT at present - doesn't correctly calculate size
of logical shapes with dynamic internal contents
Bool_t TakeLock(ELock lock)
______________________________________________________________________________
Bool_t ReleaseLock(ELock lock)
______________________________________________________________________________
Bool_t IsLocked()
______________________________________________________________________________
const char * LockName(ELock lock)
______________________________________________________________________________
Bool_t LockValid(ELock lock)
______________________________________________________________________________
Test if lock is a valid type to take/release
kUnlocked is never valid in these cases
Author: Richard Maunder 25/05/2005
Last update: root/gl:$Name: $:$Id: TGLScene.cxx,v 1.45 2006/12/09 23:05:17 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.