Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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 occ::handle< Graphic3d_StructureManager > &theStructureManager)
 Creates a framework to manage displays and graphic entities with the 3D view theStructureManager.
 
void Display (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int 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.
 
void Erase (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode=0)
 erases the presentation of the object in the given Presentation manager with the given mode. If @theMode is -1, then erases all presentations of the object.
 
virtual void Clear (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode=0)
 Clears the presentation of the presentable object thePrsObject in this framework with the display mode theMode.
 
void SetVisibility (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode, const bool theValue)
 Sets the visibility of presentable object.
 
void Unhighlight (const occ::handle< PrsMgr_PresentableObject > &thePrsObject)
 Removes highlighting from the presentation of the presentable object.
 
void SetDisplayPriority (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode, const Graphic3d_DisplayPriority theNewPrior) const
 Sets the display priority theNewPrior of the presentable object thePrsObject in this framework with the display mode theMode.
 
Graphic3d_DisplayPriority DisplayPriority (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode) const
 Returns the display priority of the presentable object thePrsObject in this framework with the display mode theMode.
 
void SetZLayer (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const Graphic3d_ZLayerId theLayerId)
 Set Z layer ID for all presentations of the object.
 
Graphic3d_ZLayerId GetZLayer (const occ::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.
 
bool IsDisplayed (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode=0) const
 
bool IsHighlighted (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode=0) const
 Returns true if the presentation of the presentable object thePrsObject in this framework with the display mode theMode is highlighted.
 
void Update (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode=0) const
 Updates the presentation of the presentable object thePrsObject in this framework with the display mode theMode.
 
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.
 
void ClearImmediateDraw ()
 Resets the transient list of presentations previously displayed in immediate mode.
 
void AddToImmediateList (const occ::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 EndImmediateDraw (const occ::handle< V3d_Viewer > &theViewer)
 Allows rapid drawing of the each view in theViewer by avoiding an update of the whole background.
 
void RedrawImmediate (const occ::handle< V3d_Viewer > &theViewer)
 Clears and redisplays immediate structures of the viewer taking into account its affinity.
 
bool IsImmediateModeOn () const
 Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
 
void Color (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const occ::handle< Prs3d_Drawer > &theStyle, const int theMode=0, const occ::handle< PrsMgr_PresentableObject > &theSelObj=nullptr, const Graphic3d_ZLayerId theImmediateStructLayerId=Graphic3d_ZLayerId_Topmost)
 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 Connect (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const occ::handle< PrsMgr_PresentableObject > &theOtherObject, const int theMode=0, const int theOtherMode=0)
 
void Transform (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const occ::handle< TopLoc_Datum3D > &theTransformation, const int 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.
 
const occ::handle< Graphic3d_StructureManager > & StructureManager () const
 Returns the structure manager.
 
bool HasPresentation (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode=0) const
 Returns true if there is a presentation of the presentable object thePrsObject in this framework, thePrsObject having the display mode theMode.
 
occ::handle< PrsMgr_PresentationPresentation (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode=0, const bool theToCreate=false, const occ::handle< PrsMgr_PresentableObject > &theSelObj=nullptr) 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.
 
void UpdateHighlightTrsf (const occ::handle< V3d_Viewer > &theViewer, const occ::handle< PrsMgr_PresentableObject > &theObj, const int theMode=0, const occ::handle< PrsMgr_PresentableObject > &theSelObj=nullptr)
 Allows to apply location transformation to shadow highlight presentation immediately.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::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.
 
bool IsKind (const char *const 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.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Member Functions

bool RemovePresentation (const occ::handle< PrsMgr_PresentableObject > &thePrsObject, const int theMode=0)
 Removes a presentation of the presentable object thePrsObject to this framework. thePrsObject has the display mode theMode.
 

Protected Attributes

occ::handle< Graphic3d_StructureManagermyStructureManager
 
int myImmediateModeOn
 
NCollection_List< occ::handle< Prs3d_Presentation > > myImmediateList
 
NCollection_List< occ::handle< Prs3d_Presentation > > myViewDependentImmediateList
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

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::PrsMgr_PresentationManager ( const occ::handle< Graphic3d_StructureManager > & theStructureManager)

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

Member Function Documentation

◆ AddToImmediateList()

void PrsMgr_PresentationManager::AddToImmediateList ( const occ::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.

◆ BeginImmediateDraw()

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.

◆ Clear()

virtual void PrsMgr_PresentationManager::Clear ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode = 0 )
virtual

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

◆ ClearImmediateDraw()

void PrsMgr_PresentationManager::ClearImmediateDraw ( )

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

◆ Color()

void PrsMgr_PresentationManager::Color ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const occ::handle< Prs3d_Drawer > & theStyle,
const int theMode = 0,
const occ::handle< PrsMgr_PresentableObject > & theSelObj = nullptr,
const Graphic3d_ZLayerId theImmediateStructLayerId = Graphic3d_ZLayerId_Topmost )

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.

◆ Connect()

void PrsMgr_PresentationManager::Connect ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const occ::handle< PrsMgr_PresentableObject > & theOtherObject,
const int theMode = 0,
const int theOtherMode = 0 )

◆ Display()

void PrsMgr_PresentationManager::Display ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int 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.

◆ DisplayPriority()

Graphic3d_DisplayPriority PrsMgr_PresentationManager::DisplayPriority ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode ) const

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

◆ EndImmediateDraw()

void PrsMgr_PresentationManager::EndImmediateDraw ( const occ::handle< V3d_Viewer > & theViewer)

Allows rapid drawing of the each view in theViewer by avoiding an update of the whole background.

◆ Erase()

void PrsMgr_PresentationManager::Erase ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode = 0 )

erases the presentation of the object in the given Presentation manager with the given mode. If @theMode is -1, then erases all presentations of the object.

◆ GetZLayer()

Graphic3d_ZLayerId PrsMgr_PresentationManager::GetZLayer ( const occ::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.

◆ HasPresentation()

bool PrsMgr_PresentationManager::HasPresentation ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode = 0 ) const

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

◆ IsDisplayed()

bool PrsMgr_PresentationManager::IsDisplayed ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode = 0 ) const

◆ IsHighlighted()

bool PrsMgr_PresentationManager::IsHighlighted ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode = 0 ) const

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

◆ IsImmediateModeOn()

bool PrsMgr_PresentationManager::IsImmediateModeOn ( ) const
inline

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

◆ Presentation()

occ::handle< PrsMgr_Presentation > PrsMgr_PresentationManager::Presentation ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode = 0,
const bool theToCreate = false,
const occ::handle< PrsMgr_PresentableObject > & theSelObj = nullptr ) 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.

◆ RedrawImmediate()

void PrsMgr_PresentationManager::RedrawImmediate ( const occ::handle< V3d_Viewer > & theViewer)

Clears and redisplays immediate structures of the viewer taking into account its affinity.

◆ RemovePresentation()

bool PrsMgr_PresentationManager::RemovePresentation ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode = 0 )
protected

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

◆ SetDisplayPriority()

void PrsMgr_PresentationManager::SetDisplayPriority ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode,
const Graphic3d_DisplayPriority theNewPrior ) const

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

◆ SetVisibility()

void PrsMgr_PresentationManager::SetVisibility ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode,
const bool theValue )

Sets the visibility of presentable object.

◆ SetZLayer()

void PrsMgr_PresentationManager::SetZLayer ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const Graphic3d_ZLayerId theLayerId )

Set Z layer ID for all presentations of the object.

◆ StructureManager()

const occ::handle< Graphic3d_StructureManager > & PrsMgr_PresentationManager::StructureManager ( ) const
inline

Returns the structure manager.

◆ Transform()

void PrsMgr_PresentationManager::Transform ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const occ::handle< TopLoc_Datum3D > & theTransformation,
const int 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.

◆ Unhighlight()

void PrsMgr_PresentationManager::Unhighlight ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject)

Removes highlighting from the presentation of the presentable object.

◆ Update()

void PrsMgr_PresentationManager::Update ( const occ::handle< PrsMgr_PresentableObject > & thePrsObject,
const int theMode = 0 ) const

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

◆ UpdateHighlightTrsf()

void PrsMgr_PresentationManager::UpdateHighlightTrsf ( const occ::handle< V3d_Viewer > & theViewer,
const occ::handle< PrsMgr_PresentableObject > & theObj,
const int theMode = 0,
const occ::handle< PrsMgr_PresentableObject > & theSelObj = nullptr )

Allows to apply location transformation to shadow highlight presentation immediately.

Parameters
theObjdefines the base object, it local transformation will be applied to corresponding highlight structure
theModedefines display mode of the base object
theSelObjdefines the object produced after decomposition of the base object for local selection

Field Documentation

◆ myImmediateList

NCollection_List<occ::handle<Prs3d_Presentation> > PrsMgr_PresentationManager::myImmediateList
protected

◆ myImmediateModeOn

int PrsMgr_PresentationManager::myImmediateModeOn
protected

◆ myStructureManager

occ::handle<Graphic3d_StructureManager> PrsMgr_PresentationManager::myStructureManager
protected

◆ myViewDependentImmediateList

NCollection_List<occ::handle<Prs3d_Presentation> > PrsMgr_PresentationManager::myViewDependentImmediateList
protected

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