Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes
Graphic3d_StructureManager Class Reference

This class allows the definition of a manager to which the graphic objects are associated. It allows them to be globally manipulated. It defines the global attributes. Keywords: Structure, Structure Manager, Update Mode, Destroy, Highlight, Visible. More...

#include <Graphic3d_StructureManager.hxx>

Inheritance diagram for Graphic3d_StructureManager:
Inheritance graph
[legend]

Public Member Functions

 Graphic3d_StructureManager (const occ::handle< Graphic3d_GraphicDriver > &theDriver)
 Initializes the ViewManager. Currently creating of more than 100 viewer instances is not supported and leads to InitializationError and initialization failure. This limitation might be addressed in some future OCCT releases. Warning: Raises InitialisationError if the initialization of the ViewManager failed.
 
 ~Graphic3d_StructureManager () override
 Deletes the manager <me>.
 
virtual void Update (const Graphic3d_ZLayerId theLayerId=Graphic3d_ZLayerId_UNKNOWN) const
 Invalidates bounding box of specified ZLayerId.
 
virtual void Remove ()
 Deletes and erases the 3D structure manager.
 
virtual void Erase ()
 Erases all the structures.
 
void DisplayedStructures (NCollection_Map< occ::handle< Graphic3d_Structure > > &SG) const
 Returns the set of structures displayed in visualiser <me>.
 
void HighlightedStructures (NCollection_Map< occ::handle< Graphic3d_Structure > > &SG) const
 Returns the set of highlighted structures in a visualiser <me>.
 
virtual void ReCompute (const occ::handle< Graphic3d_Structure > &theStructure)
 Forces a new construction of the structure. if <theStructure> is displayed and TOS_COMPUTED.
 
virtual void ReCompute (const occ::handle< Graphic3d_Structure > &theStructure, const occ::handle< Graphic3d_DataStructureManager > &theProjector)
 Forces a new construction of the structure. if <theStructure> is displayed in <theProjector> and TOS_COMPUTED.
 
virtual void Clear (Graphic3d_Structure *theStructure, const bool theWithDestruction)
 Clears the structure.
 
virtual void Connect (const Graphic3d_Structure *theMother, const Graphic3d_Structure *theDaughter)
 Connects the structures.
 
virtual void Disconnect (const Graphic3d_Structure *theMother, const Graphic3d_Structure *theDaughter)
 Disconnects the structures.
 
virtual void Display (const occ::handle< Graphic3d_Structure > &theStructure)
 Display the structure.
 
virtual void Erase (const occ::handle< Graphic3d_Structure > &theStructure)
 Erases the structure.
 
virtual void Highlight (const occ::handle< Graphic3d_Structure > &theStructure)
 Highlights the structure.
 
virtual void SetTransform (const occ::handle< Graphic3d_Structure > &theStructure, const occ::handle< TopLoc_Datum3D > &theTrsf)
 Transforms the structure.
 
virtual void ChangeDisplayPriority (const occ::handle< Graphic3d_Structure > &theStructure, const Graphic3d_DisplayPriority theOldPriority, const Graphic3d_DisplayPriority theNewPriority)
 Changes the display priority of the structure <AStructure>.
 
virtual void ChangeZLayer (const occ::handle< Graphic3d_Structure > &theStructure, const Graphic3d_ZLayerId theLayerId)
 Change Z layer for structure. The Z layer mechanism allows to display structures in higher layers in overlay of structures in lower layers.
 
const occ::handle< Graphic3d_GraphicDriver > & GraphicDriver () const
 Returns the graphic driver of <me>.
 
int Identification (Graphic3d_CView *theView)
 Attaches the view to this structure manager and sets its identification number within the manager.
 
void UnIdentification (Graphic3d_CView *theView)
 Detach the view from this structure manager and release its identification.
 
const NCollection_IndexedMap< Graphic3d_CView * > & DefinedViews () const
 Returns the group of views defined in the structure manager.
 
int MaxNumOfViews () const
 Returns the theoretical maximum number of definable views in the manager. Warning: It's not possible to accept an infinite number of definable views because each view must have an identification and we have different managers.
 
virtual occ::handle< Graphic3d_StructureIdentification (const int AId) const
 Returns the structure with the identification number <AId>.
 
virtual void UnHighlight (const occ::handle< Graphic3d_Structure > &AStructure)
 Suppress the highlighting on the structure <AStructure>.
 
virtual void UnHighlight ()
 Suppresses the highlighting on all the structures in <me>.
 
void RecomputeStructures ()
 Recomputes all structures in the manager. Resets Device Lost flag.
 
void RecomputeStructures (const NCollection_Map< Graphic3d_Structure * > &theStructures)
 Recomputes all structures from theStructures.
 
void RegisterObject (const occ::handle< Standard_Transient > &theObject, const occ::handle< Graphic3d_ViewAffinity > &theAffinity)
 
void UnregisterObject (const occ::handle< Standard_Transient > &theObject)
 
const occ::handle< Graphic3d_ViewAffinity > & ObjectAffinity (const occ::handle< Standard_Transient > &theObject) const
 
bool IsDeviceLost () const
 Returns TRUE if Device Lost flag has been set and presentation data should be reuploaded onto graphics driver.
 
void SetDeviceLost ()
 Sets Device Lost flag.
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
- 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

int NumberOfDisplayedStructures () const
 Returns the number of structures displayed in visualizer <me>. Returns the structure displayed in visualizer <me>.
 

Protected Attributes

Aspect_GenId myViewGenId
 
NCollection_Map< occ::handle< Graphic3d_Structure > > myDisplayedStructure
 
NCollection_Map< occ::handle< Graphic3d_Structure > > myHighlightedStructure
 
NCollection_DataMap< const Standard_Transient *, occ::handle< Graphic3d_ViewAffinity > > myRegisteredObjects
 
occ::handle< Graphic3d_GraphicDrivermyGraphicDriver
 
NCollection_IndexedMap< Graphic3d_CView * > myDefinedViews
 
bool myDeviceLostFlag
 

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

This class allows the definition of a manager to which the graphic objects are associated. It allows them to be globally manipulated. It defines the global attributes. Keywords: Structure, Structure Manager, Update Mode, Destroy, Highlight, Visible.

Constructor & Destructor Documentation

◆ Graphic3d_StructureManager()

Graphic3d_StructureManager::Graphic3d_StructureManager ( const occ::handle< Graphic3d_GraphicDriver > & theDriver)

Initializes the ViewManager. Currently creating of more than 100 viewer instances is not supported and leads to InitializationError and initialization failure. This limitation might be addressed in some future OCCT releases. Warning: Raises InitialisationError if the initialization of the ViewManager failed.

◆ ~Graphic3d_StructureManager()

Graphic3d_StructureManager::~Graphic3d_StructureManager ( )
override

Deletes the manager <me>.

Member Function Documentation

◆ ChangeDisplayPriority()

virtual void Graphic3d_StructureManager::ChangeDisplayPriority ( const occ::handle< Graphic3d_Structure > & theStructure,
const Graphic3d_DisplayPriority theOldPriority,
const Graphic3d_DisplayPriority theNewPriority )
virtual

Changes the display priority of the structure <AStructure>.

◆ ChangeZLayer()

virtual void Graphic3d_StructureManager::ChangeZLayer ( const occ::handle< Graphic3d_Structure > & theStructure,
const Graphic3d_ZLayerId theLayerId )
virtual

Change Z layer for structure. The Z layer mechanism allows to display structures in higher layers in overlay of structures in lower layers.

◆ Clear()

virtual void Graphic3d_StructureManager::Clear ( Graphic3d_Structure * theStructure,
const bool theWithDestruction )
virtual

Clears the structure.

◆ Connect()

virtual void Graphic3d_StructureManager::Connect ( const Graphic3d_Structure * theMother,
const Graphic3d_Structure * theDaughter )
virtual

Connects the structures.

◆ DefinedViews()

const NCollection_IndexedMap< Graphic3d_CView * > & Graphic3d_StructureManager::DefinedViews ( ) const

Returns the group of views defined in the structure manager.

◆ Disconnect()

virtual void Graphic3d_StructureManager::Disconnect ( const Graphic3d_Structure * theMother,
const Graphic3d_Structure * theDaughter )
virtual

Disconnects the structures.

◆ Display()

virtual void Graphic3d_StructureManager::Display ( const occ::handle< Graphic3d_Structure > & theStructure)
virtual

Display the structure.

◆ DisplayedStructures()

void Graphic3d_StructureManager::DisplayedStructures ( NCollection_Map< occ::handle< Graphic3d_Structure > > & SG) const

Returns the set of structures displayed in visualiser <me>.

◆ DumpJson()

void Graphic3d_StructureManager::DumpJson ( Standard_OStream & theOStream,
int theDepth = -1 ) const

Dumps the content of me into the stream.

◆ Erase() [1/2]

virtual void Graphic3d_StructureManager::Erase ( )
virtual

Erases all the structures.

◆ Erase() [2/2]

virtual void Graphic3d_StructureManager::Erase ( const occ::handle< Graphic3d_Structure > & theStructure)
virtual

Erases the structure.

◆ GraphicDriver()

const occ::handle< Graphic3d_GraphicDriver > & Graphic3d_StructureManager::GraphicDriver ( ) const

Returns the graphic driver of <me>.

◆ Highlight()

virtual void Graphic3d_StructureManager::Highlight ( const occ::handle< Graphic3d_Structure > & theStructure)
virtual

Highlights the structure.

◆ HighlightedStructures()

void Graphic3d_StructureManager::HighlightedStructures ( NCollection_Map< occ::handle< Graphic3d_Structure > > & SG) const

Returns the set of highlighted structures in a visualiser <me>.

◆ Identification() [1/2]

virtual occ::handle< Graphic3d_Structure > Graphic3d_StructureManager::Identification ( const int AId) const
virtual

Returns the structure with the identification number <AId>.

◆ Identification() [2/2]

int Graphic3d_StructureManager::Identification ( Graphic3d_CView * theView)

Attaches the view to this structure manager and sets its identification number within the manager.

◆ IsDeviceLost()

bool Graphic3d_StructureManager::IsDeviceLost ( ) const
inline

Returns TRUE if Device Lost flag has been set and presentation data should be reuploaded onto graphics driver.

◆ MaxNumOfViews()

int Graphic3d_StructureManager::MaxNumOfViews ( ) const

Returns the theoretical maximum number of definable views in the manager. Warning: It's not possible to accept an infinite number of definable views because each view must have an identification and we have different managers.

◆ NumberOfDisplayedStructures()

int Graphic3d_StructureManager::NumberOfDisplayedStructures ( ) const
protected

Returns the number of structures displayed in visualizer <me>. Returns the structure displayed in visualizer <me>.

◆ ObjectAffinity()

const occ::handle< Graphic3d_ViewAffinity > & Graphic3d_StructureManager::ObjectAffinity ( const occ::handle< Standard_Transient > & theObject) const

◆ ReCompute() [1/2]

virtual void Graphic3d_StructureManager::ReCompute ( const occ::handle< Graphic3d_Structure > & theStructure)
virtual

Forces a new construction of the structure. if <theStructure> is displayed and TOS_COMPUTED.

◆ ReCompute() [2/2]

virtual void Graphic3d_StructureManager::ReCompute ( const occ::handle< Graphic3d_Structure > & theStructure,
const occ::handle< Graphic3d_DataStructureManager > & theProjector )
virtual

Forces a new construction of the structure. if <theStructure> is displayed in <theProjector> and TOS_COMPUTED.

◆ RecomputeStructures() [1/2]

void Graphic3d_StructureManager::RecomputeStructures ( )

Recomputes all structures in the manager. Resets Device Lost flag.

◆ RecomputeStructures() [2/2]

void Graphic3d_StructureManager::RecomputeStructures ( const NCollection_Map< Graphic3d_Structure * > & theStructures)

Recomputes all structures from theStructures.

◆ RegisterObject()

void Graphic3d_StructureManager::RegisterObject ( const occ::handle< Standard_Transient > & theObject,
const occ::handle< Graphic3d_ViewAffinity > & theAffinity )

◆ Remove()

virtual void Graphic3d_StructureManager::Remove ( )
virtual

Deletes and erases the 3D structure manager.

◆ SetDeviceLost()

void Graphic3d_StructureManager::SetDeviceLost ( )
inline

Sets Device Lost flag.

◆ SetTransform()

virtual void Graphic3d_StructureManager::SetTransform ( const occ::handle< Graphic3d_Structure > & theStructure,
const occ::handle< TopLoc_Datum3D > & theTrsf )
virtual

Transforms the structure.

◆ UnHighlight() [1/2]

virtual void Graphic3d_StructureManager::UnHighlight ( )
virtual

Suppresses the highlighting on all the structures in <me>.

◆ UnHighlight() [2/2]

virtual void Graphic3d_StructureManager::UnHighlight ( const occ::handle< Graphic3d_Structure > & AStructure)
virtual

Suppress the highlighting on the structure <AStructure>.

◆ UnIdentification()

void Graphic3d_StructureManager::UnIdentification ( Graphic3d_CView * theView)

Detach the view from this structure manager and release its identification.

◆ UnregisterObject()

void Graphic3d_StructureManager::UnregisterObject ( const occ::handle< Standard_Transient > & theObject)

◆ Update()

virtual void Graphic3d_StructureManager::Update ( const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN) const
virtual

Invalidates bounding box of specified ZLayerId.

Field Documentation

◆ myDefinedViews

NCollection_IndexedMap<Graphic3d_CView*> Graphic3d_StructureManager::myDefinedViews
protected

◆ myDeviceLostFlag

bool Graphic3d_StructureManager::myDeviceLostFlag
protected

◆ myDisplayedStructure

NCollection_Map<occ::handle<Graphic3d_Structure> > Graphic3d_StructureManager::myDisplayedStructure
protected

◆ myGraphicDriver

occ::handle<Graphic3d_GraphicDriver> Graphic3d_StructureManager::myGraphicDriver
protected

◆ myHighlightedStructure

NCollection_Map<occ::handle<Graphic3d_Structure> > Graphic3d_StructureManager::myHighlightedStructure
protected

◆ myRegisteredObjects

NCollection_DataMap<const Standard_Transient*, occ::handle<Graphic3d_ViewAffinity> > Graphic3d_StructureManager::myRegisteredObjects
protected

◆ myViewGenId

Aspect_GenId Graphic3d_StructureManager::myViewGenId
protected

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