Open CASCADE Technology  6.9.0
Public Member Functions | Protected Member Functions | Protected Attributes
PrsMgr_PresentationManager Class Reference

A framework to manage 3D displays, graphic entities and their updates. Used in the AIS package (Application Interactive Services), to enable the advanced user to define the default display mode of a new interactive object which extends the list of signatures and types. Definition of new display types is handled by calling the presentation algorithms provided by the StdPrs package. More...

#include <PrsMgr_PresentationManager.hxx>

Inheritance diagram for PrsMgr_PresentationManager:
Inheritance graph
[legend]

Public Member Functions

 PrsMgr_PresentationManager (const Handle< Visual3d_ViewManager > &theStructureManager)
 Creates a framework to manage displays and graphic entities with the 3D view theStructureManager. More...
 
void Display (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0)
 Displays the presentation of the object in the given Presentation manager with the given mode. The mode should be enumerated by the object which inherits PresentableObject. More...
 
void Erase (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0)
 erases the presentation of the object in the given Presentation manager with the given mode. More...
 
virtual void Clear (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0)
 Clears the presentation of the presentable object thePrsObject in this framework with the display mode theMode. More...
 
void SetVisibility (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode, const Standard_Boolean theValue)
 Sets the visibility of presentable object. More...
 
void Highlight (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0)
 Highlights the presentation of the presentable object thePrsObject in this framework with the display mode theMode. More...
 
void Unhighlight (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0)
 Removes highlighting from the presentation of the presentable object thePrsObject in this framework with the display mode theMode. More...
 
void SetDisplayPriority (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode, const Standard_Integer theNewPrior) const
 Sets the display priority theNewPrior of the presentable object thePrsObject in this framework with the display mode theMode. More...
 
Standard_Integer DisplayPriority (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode) const
 Returns the display priority of the presentable object thePrsObject in this framework with the display mode theMode. More...
 
void SetZLayer (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theLayerId)
 Set Z layer ID for all presentations of the object. More...
 
Standard_Integer GetZLayer (const Handle< PrsMgr_PresentableObject > &thePrsObject) const
 Get Z layer ID assigned to all presentations of the object. Method returns -1 value if object has no presentations and is impossible to get layer index. More...
 
Standard_Boolean IsDisplayed (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0) const
 
Standard_Boolean IsHighlighted (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0) const
 Returns true if the presentation of the presentable object thePrsObject in this framework with the display mode theMode is highlighted. More...
 
void Update (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0) const
 Updates the presentation of the presentable object thePrsObject in this framework with the display mode theMode. More...
 
void BeginImmediateDraw ()
 Resets the transient list of presentations previously displayed in immediate mode and begins accumulation of new list by following AddToImmediateList()/Color()/Highlight() calls. More...
 
void ClearImmediateDraw ()
 Resets the transient list of presentations previously displayed in immediate mode. More...
 
void AddToImmediateList (const Handle< Prs3d_Presentation > &thePrs)
 Stores thePrs in the transient list of presentations to be displayed in immediate mode. Will be taken in account in EndImmediateDraw method. More...
 
void EndImmediateDraw (const Handle< V3d_View > &theView)
 Allows rapid drawing of the view theView by avoiding an update of the whole background. More...
 
Standard_Boolean IsImmediateModeOn () const
 Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode. More...
 
void Color (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Quantity_NameOfColor theColor=Quantity_NOC_YELLOW, const Standard_Integer theMode=0, const Handle< PrsMgr_PresentableObject > &theSelObj=NULL)
 Highlights the graphic object thePrsObject in the color theColor. thePrsObject has the display mode theMode; this has the default value of 0, that is, the wireframe display mode. More...
 
void BoundBox (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0)
 highlights the boundbox of the presentation More...
 
void Connect (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Handle< PrsMgr_PresentableObject > &theOtherObject, const Standard_Integer theMode=0, const Standard_Integer theOtherMode=0)
 
void Transform (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Handle< Geom_Transformation > &theTransformation, const Standard_Integer theMode=0)
 Sets the transformation theTransformation for the presentable object thePrsObject. thePrsObject has the display mode theMode; this has the default value of 0, that is, the wireframe display mode. More...
 
const Handle
< Graphic3d_StructureManager > & 
StructureManager () const
 Returns the structure manager. More...
 
void SetShadingAspect (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Quantity_NameOfColor theColor, const Graphic3d_NameOfMaterial theMaterial, const Standard_Integer theMode=0)
 this method will change the color and the aspect of the presentations containing shaded structures. More...
 
void SetShadingAspect (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Handle< Prs3d_ShadingAspect > &theShadingAspect, const Standard_Integer theMode=0)
 this method will change the color and the aspect of the presentations containing shaded structures. More...
 
Standard_Boolean HasPresentation (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0) const
 Returns true if there is a presentation of the presentable object thePrsObject in this framework, thePrsObject having the display mode theMode. More...
 
Handle< PrsMgr_PresentationPresentation (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0, const Standard_Boolean theToCreate=Standard_False, const Handle< PrsMgr_PresentableObject > &theSelObj=NULL) const
 Returns the presentation Presentation of the presentable object thePrsObject in this framework. When theToCreate is true - automatically creates presentation for specified mode when not exist. Optional argument theSelObj specifies parent decomposed object to inherit its view affinity. More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Protected Member Functions

Standard_Boolean RemovePresentation (const Handle< PrsMgr_PresentableObject > &thePrsObject, const Standard_Integer theMode=0)
 Removes a presentation of the presentable object thePrsObject to this framework. thePrsObject has the display mode theMode. More...
 

Protected Attributes

Handle< Visual3d_ViewManagermyStructureManager
 
Standard_Integer myImmediateModeOn
 
PrsMgr_ListOfPresentations myImmediateList
 
Handle< V3d_ViewmyImmediateView
 
Quantity_Color mySelectionColor
 

Detailed Description

A framework to manage 3D displays, graphic entities and their updates. Used in the AIS package (Application Interactive Services), to enable the advanced user to define the default display mode of a new interactive object which extends the list of signatures and types. Definition of new display types is handled by calling the presentation algorithms provided by the StdPrs package.

Constructor & Destructor Documentation

PrsMgr_PresentationManager::PrsMgr_PresentationManager ( const Handle< Visual3d_ViewManager > &  theStructureManager)

Creates a framework to manage displays and graphic entities with the 3D view theStructureManager.

Member Function Documentation

void PrsMgr_PresentationManager::AddToImmediateList ( const Handle< Prs3d_Presentation > &  thePrs)

Stores thePrs in the transient list of presentations to be displayed in immediate mode. Will be taken in account in EndImmediateDraw method.

void PrsMgr_PresentationManager::BeginImmediateDraw ( )

Resets the transient list of presentations previously displayed in immediate mode and begins accumulation of new list by following AddToImmediateList()/Color()/Highlight() calls.

void PrsMgr_PresentationManager::BoundBox ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
)

highlights the boundbox of the presentation

virtual void PrsMgr_PresentationManager::Clear ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
)
virtual

Clears the presentation of the presentable object thePrsObject in this framework with the display mode theMode.

void PrsMgr_PresentationManager::ClearImmediateDraw ( )

Resets the transient list of presentations previously displayed in immediate mode.

void PrsMgr_PresentationManager::Color ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Quantity_NameOfColor  theColor = Quantity_NOC_YELLOW,
const Standard_Integer  theMode = 0,
const Handle< PrsMgr_PresentableObject > &  theSelObj = NULL 
)

Highlights the graphic object thePrsObject in the color theColor. thePrsObject has the display mode theMode; this has the default value of 0, that is, the wireframe display mode.

void PrsMgr_PresentationManager::Connect ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Handle< PrsMgr_PresentableObject > &  theOtherObject,
const Standard_Integer  theMode = 0,
const Standard_Integer  theOtherMode = 0 
)
void PrsMgr_PresentationManager::Display ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
)

Displays the presentation of the object in the given Presentation manager with the given mode. The mode should be enumerated by the object which inherits PresentableObject.

Standard_Integer PrsMgr_PresentationManager::DisplayPriority ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode 
) const

Returns the display priority of the presentable object thePrsObject in this framework with the display mode theMode.

void PrsMgr_PresentationManager::EndImmediateDraw ( const Handle< V3d_View > &  theView)

Allows rapid drawing of the view theView by avoiding an update of the whole background.

void PrsMgr_PresentationManager::Erase ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
)

erases the presentation of the object in the given Presentation manager with the given mode.

Standard_Integer PrsMgr_PresentationManager::GetZLayer ( const Handle< PrsMgr_PresentableObject > &  thePrsObject) const

Get Z layer ID assigned to all presentations of the object. Method returns -1 value if object has no presentations and is impossible to get layer index.

Standard_Boolean PrsMgr_PresentationManager::HasPresentation ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
) const

Returns true if there is a presentation of the presentable object thePrsObject in this framework, thePrsObject having the display mode theMode.

void PrsMgr_PresentationManager::Highlight ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
)

Highlights the presentation of the presentable object thePrsObject in this framework with the display mode theMode.

Standard_Boolean PrsMgr_PresentationManager::IsDisplayed ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
) const
Standard_Boolean PrsMgr_PresentationManager::IsHighlighted ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
) const

Returns true if the presentation of the presentable object thePrsObject in this framework with the display mode theMode is highlighted.

Standard_Boolean PrsMgr_PresentationManager::IsImmediateModeOn ( ) const

Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.

Handle< PrsMgr_Presentation > PrsMgr_PresentationManager::Presentation ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0,
const Standard_Boolean  theToCreate = Standard_False,
const Handle< PrsMgr_PresentableObject > &  theSelObj = NULL 
) const

Returns the presentation Presentation of the presentable object thePrsObject in this framework. When theToCreate is true - automatically creates presentation for specified mode when not exist. Optional argument theSelObj specifies parent decomposed object to inherit its view affinity.

Standard_Boolean PrsMgr_PresentationManager::RemovePresentation ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
)
protected

Removes a presentation of the presentable object thePrsObject to this framework. thePrsObject has the display mode theMode.

void PrsMgr_PresentationManager::SetDisplayPriority ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode,
const Standard_Integer  theNewPrior 
) const

Sets the display priority theNewPrior of the presentable object thePrsObject in this framework with the display mode theMode.

void PrsMgr_PresentationManager::SetShadingAspect ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Quantity_NameOfColor  theColor,
const Graphic3d_NameOfMaterial  theMaterial,
const Standard_Integer  theMode = 0 
)

this method will change the color and the aspect of the presentations containing shaded structures.

void PrsMgr_PresentationManager::SetShadingAspect ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Handle< Prs3d_ShadingAspect > &  theShadingAspect,
const Standard_Integer  theMode = 0 
)

this method will change the color and the aspect of the presentations containing shaded structures.

void PrsMgr_PresentationManager::SetVisibility ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode,
const Standard_Boolean  theValue 
)

Sets the visibility of presentable object.

void PrsMgr_PresentationManager::SetZLayer ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theLayerId 
)

Set Z layer ID for all presentations of the object.

const Handle< Graphic3d_StructureManager >& PrsMgr_PresentationManager::StructureManager ( ) const

Returns the structure manager.

void PrsMgr_PresentationManager::Transform ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Handle< Geom_Transformation > &  theTransformation,
const Standard_Integer  theMode = 0 
)

Sets the transformation theTransformation for the presentable object thePrsObject. thePrsObject has the display mode theMode; this has the default value of 0, that is, the wireframe display mode.

void PrsMgr_PresentationManager::Unhighlight ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
)

Removes highlighting from the presentation of the presentable object thePrsObject in this framework with the display mode theMode.

void PrsMgr_PresentationManager::Update ( const Handle< PrsMgr_PresentableObject > &  thePrsObject,
const Standard_Integer  theMode = 0 
) const

Updates the presentation of the presentable object thePrsObject in this framework with the display mode theMode.

Field Documentation

PrsMgr_ListOfPresentations PrsMgr_PresentationManager::myImmediateList
protected
Standard_Integer PrsMgr_PresentationManager::myImmediateModeOn
protected
Handle< V3d_View > PrsMgr_PresentationManager::myImmediateView
protected
Quantity_Color PrsMgr_PresentationManager::mySelectionColor
protected
Handle< Visual3d_ViewManager > PrsMgr_PresentationManager::myStructureManager
protected

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