Open CASCADE Technology 7.8.2.dev
PrsMgr_Presentation Class Reference

#include <PrsMgr_Presentation.hxx>

Inheritance diagram for PrsMgr_Presentation:

Public Member Functions

 ~PrsMgr_Presentation ()
 Destructor.
 
Prs3d_PresentationPresentation ()
 
const Handle< PrsMgr_PresentationManager > & PresentationManager () const
 returns the PresentationManager in which the presentation has been created.
 
void SetUpdateStatus (const Standard_Boolean theUpdateStatus)
 
Standard_Boolean MustBeUpdated () const
 
Standard_Integer Mode () const
 Return display mode index.
 
virtual void Display () override
 Display structure.
 
virtual void Erase () override
 Remove structure.
 
void Highlight (const Handle< Prs3d_Drawer > &theStyle)
 Highlight structure.
 
void Unhighlight ()
 Unhighlight structure.
 
virtual Standard_Boolean IsDisplayed () const override
 Return TRUE if structure has been displayed and in no hidden state.
 
virtual void Clear (const Standard_Boolean theWithDestruction=Standard_True) override
 removes the whole content of the presentation. Does not remove the other connected presentations.
 
virtual void Compute () override
 Compute structure using presentation manager.
 
virtual void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const override
 Dumps the content of me into the stream.
 
- Public Member Functions inherited from Graphic3d_Structure
 Graphic3d_Structure (const Handle< Graphic3d_StructureManager > &theManager, const Handle< Graphic3d_Structure > &theLinkPrs=Handle< Graphic3d_Structure >())
 Creates a graphic object in the manager theManager. It will appear in all the views of the visualiser. The structure is not displayed when it is created.
 
virtual ~Graphic3d_Structure ()
 Suppresses the structure <me>. It will be erased at the next screen update.
 
Graphic3d_DisplayPriority DisplayPriority () const
 Returns the current display priority for this structure.
 
void SetDisplayPriority (const Graphic3d_DisplayPriority thePriority)
 Modifies the order of displaying the structure. Values are between 0 and 10. Structures are drawn according to their display priorities in ascending order. A structure of priority 10 is displayed the last and appears over the others. The default value is 5. Warning: If structure is displayed then the SetDisplayPriority method erases it and displays with the new priority. Raises Graphic3d_PriorityDefinitionError if Priority is greater than 10 or a negative value.
 
void SetDisplayPriority (const Standard_Integer thePriority)
 
void ResetDisplayPriority ()
 Reset the current priority of the structure to the previous priority. Warning: If structure is displayed then the SetDisplayPriority() method erases it and displays with the previous priority.
 
void Highlight (const Handle< Graphic3d_PresentationAttributes > &theStyle, const Standard_Boolean theToUpdateMgr=Standard_True)
 Highlights the structure in all the views with the given style.
 
void Remove ()
 Suppress the structure <me>. It will be erased at the next screen update. Warning: No more graphic operations in <me> after this call. Category: Methods to modify the class definition.
 
virtual void CalculateBoundBox ()
 Computes axis-aligned bounding box of a structure.
 
void SetInfiniteState (const Standard_Boolean theToSet)
 Sets infinite flag. When TRUE, the MinMaxValues method returns: theXMin = theYMin = theZMin = RealFirst(). theXMax = theYMax = theZMax = RealLast(). By default, structure is created not infinite but empty.
 
void SetZLayer (const Graphic3d_ZLayerId theLayerId)
 Set Z layer ID for the structure. The Z layer mechanism allows to display structures presented in higher layers in overlay of structures in lower layers by switching off z buffer depth test between layers.
 
Graphic3d_ZLayerId GetZLayer () const
 Get Z layer ID of displayed structure. The method returns -1 if the structure has no ID (deleted from graphic driver).
 
void SetClipPlanes (const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes)
 Changes a sequence of clip planes slicing the structure on rendering.
 
const Handle< Graphic3d_SequenceOfHClipPlane > & ClipPlanes () const
 Get clip planes slicing the structure on rendering.
 
void SetVisible (const Standard_Boolean AValue)
 Modifies the visibility indicator to Standard_True or Standard_False for the structure <me>. The default value at the definition of <me> is Standard_True.
 
virtual void SetVisual (const Graphic3d_TypeOfStructure AVisual)
 Modifies the visualisation mode for the structure <me>.
 
void SetZoomLimit (const Standard_Real LimitInf, const Standard_Real LimitSup)
 Modifies the minimum and maximum zoom coefficients for the structure <me>. The default value at the definition of <me> is unlimited. Category: Methods to modify the class definition Warning: Raises StructureDefinitionError if <LimitInf> is greater than <LimitSup> or if <LimitInf> or <LimitSup> is a negative value.
 
void SetIsForHighlight (const Standard_Boolean isForHighlight)
 Marks the structure <me> representing wired structure needed for highlight only so it won't be added to BVH tree.
 
void UnHighlight ()
 Suppresses the highlight for the structure <me> in all the views of the visualiser.
 
void ReCompute ()
 Forces a new construction of the structure <me> if <me> is displayed and TOS_COMPUTED.
 
void ReCompute (const Handle< Graphic3d_DataStructureManager > &aProjector)
 Forces a new construction of the structure <me> if <me> is displayed in <aProjetor> and TOS_COMPUTED.
 
const Graphic3d_SequenceOfGroupGroups () const
 Returns the groups sequence included in this structure.
 
Standard_Integer NumberOfGroups () const
 Returns the current number of groups in this structure.
 
Handle< Graphic3d_GroupNewGroup ()
 Append new group to this structure.
 
Handle< Graphic3d_GroupCurrentGroup ()
 Returns the last created group or creates new one if list is empty.
 
const Handle< Graphic3d_PresentationAttributes > & HighlightStyle () const
 Returns the highlight attributes.
 
Standard_Boolean IsDeleted () const
 Returns TRUE if this structure is deleted (after Remove() call).
 
Standard_Boolean IsEmpty () const
 Returns Standard_True if the structure <me> is empty. Warning: A structure is empty if : it do not have group or all the groups are empties and it do not have descendant or all the descendants are empties.
 
Standard_Boolean IsInfinite () const
 Returns Standard_True if the structure <me> is infinite.
 
virtual Standard_Boolean IsHighlighted () const
 Returns the highlight indicator for this structure.
 
Standard_Boolean IsTransformed () const
 Returns TRUE if the structure is transformed.
 
Standard_Boolean IsVisible () const
 Returns the visibility indicator for this structure.
 
Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag=Standard_False) const
 Returns the coordinates of the boundary box of the structure <me>. If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical boundaries of the Graphic3d_Group components. Otherwise, the method returns boundaries taking into account infinite state of the structure. This approach generally used for application specific fit operation (e.g. fitting the model into screen, not taking into account infinite helper elements). Warning: If the structure <me> is empty then the empty box is returned, If the structure <me> is infinite then the whole box is returned.
 
Graphic3d_TypeOfStructure Visual () const
 Returns the visualisation mode for the structure <me>.
 
void Ancestors (Graphic3d_MapOfStructure &SG) const
 Returns the group of structures to which <me> is connected.
 
void Connect (Graphic3d_Structure *theStructure, Graphic3d_TypeOfConnection theType, Standard_Boolean theWithCheck=Standard_False)
 If Atype is TOC_DESCENDANT then add <AStructure> as a child structure of <me>. If Atype is TOC_ANCESTOR then add <AStructure> as a parent structure of <me>. The connection propagates Display, Highlight, Erase, Remove, and stacks the transformations. No connection if the graph of the structures contains a cycle and <WithCheck> is Standard_True;.
 
void Connect (const Handle< Graphic3d_Structure > &thePrs)
 
void Descendants (Graphic3d_MapOfStructure &SG) const
 Returns the group of structures connected to <me>.
 
void Disconnect (Graphic3d_Structure *theStructure)
 Suppress the connection between <AStructure> and <me>.
 
void Remove (const Handle< Graphic3d_Structure > &thePrs)
 
void DisconnectAll (const Graphic3d_TypeOfConnection AType)
 If Atype is TOC_DESCENDANT then suppress all the connections with the child structures of <me>. If Atype is TOC_ANCESTOR then suppress all the connections with the parent structures of <me>.
 
void RemoveAll ()
 
void SetOwner (const Standard_Address theOwner)
 
Standard_Address Owner () const
 
void SetHLRValidation (const Standard_Boolean theFlag)
 
Standard_Boolean HLRValidation () const
 Hidden parts stored in this structure are valid if: 1) the owner is defined. 2) they are not invalid.
 
const Handle< TopLoc_Datum3D > & Transformation () const
 Return local transformation.
 
void SetTransformation (const Handle< TopLoc_Datum3D > &theTrsf)
 Modifies the current local transformation.
 
void SetTransformPersistence (const Handle< Graphic3d_TransformPers > &theTrsfPers)
 Modifies the current transform persistence (pan, zoom or rotate)
 
const Handle< Graphic3d_TransformPers > & TransformPersistence () const
 
void SetMutable (const Standard_Boolean theIsMutable)
 Sets if the structure location has mutable nature (content or location will be changed regularly).
 
Standard_Boolean IsMutable () const
 Returns true if structure has mutable nature (content or location are be changed regularly). Mutable structure will be managed in different way than static ones.
 
Graphic3d_TypeOfStructure ComputeVisual () const
 
void GraphicClear (const Standard_Boolean WithDestruction)
 Clears the structure <me>.
 
void GraphicConnect (const Handle< Graphic3d_Structure > &theDaughter)
 
void GraphicDisconnect (const Handle< Graphic3d_Structure > &theDaughter)
 
void GraphicTransform (const Handle< TopLoc_Datum3D > &theTrsf)
 Internal method which sets new transformation without calling graphic manager callbacks.
 
Standard_Integer Identification () const
 Returns the identification number of this structure.
 
void Remove (Graphic3d_Structure *thePtr, const Graphic3d_TypeOfConnection theType)
 Suppress the structure in the list of descendants or in the list of ancestors.
 
void SetComputeVisual (const Graphic3d_TypeOfStructure theVisual)
 
const Handle< Graphic3d_CStructure > & CStructure () const
 Returns the low-level structure.
 
- 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 ()
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
Standard_Boolean 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.
 
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.
 
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.
 
Standard_Integer GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object.
 
Standard_Integer DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Member Functions

 PrsMgr_Presentation (const Handle< PrsMgr_PresentationManager > &thePresentationManager, const Handle< PrsMgr_PresentableObject > &thePresentableObject, const Standard_Integer theMode)
 Main constructor.
 
void display (const Standard_Boolean theIsHighlight)
 Displays myStructure.
 
virtual void computeHLR (const Handle< Graphic3d_Camera > &theProjector, Handle< Graphic3d_Structure > &theGivenStruct) override
 Returns the new Structure defined for the new visualization.
 
- Protected Member Functions inherited from Graphic3d_Structure
Standard_Boolean AppendDescendant (Graphic3d_Structure *theDescendant)
 Appends new descendant structure.
 
Standard_Boolean RemoveDescendant (Graphic3d_Structure *theDescendant)
 Removes the given descendant structure.
 
Standard_Boolean AppendAncestor (Graphic3d_Structure *theAncestor)
 Appends new ancestor structure.
 
Standard_Boolean RemoveAncestor (Graphic3d_Structure *theAncestor)
 Removes the given ancestor structure.
 
void clear (const Standard_Boolean WithDestruction)
 Clears all the groups of primitives in the structure.
 
void erase ()
 Erases this structure in all the views of the visualiser.
 

Protected Attributes

Handle< PrsMgr_PresentationManagermyPresentationManager
 
PrsMgr_PresentableObjectmyPresentableObject
 
Standard_Integer myBeforeHighlightState
 
Standard_Integer myMode
 
Standard_Boolean myMustBeUpdated
 
- Protected Attributes inherited from Graphic3d_Structure
Graphic3d_StructureManagermyStructureManager
 
Handle< Graphic3d_CStructuremyCStructure
 
NCollection_IndexedMap< Graphic3d_Structure * > myAncestors
 
NCollection_IndexedMap< Graphic3d_Structure * > myDescendants
 
Standard_Address myOwner
 
Graphic3d_TypeOfStructure myVisual
 
Graphic3d_TypeOfStructure myComputeVisual
 

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 Graphic3d_Structure
static Standard_Boolean AcceptConnection (Graphic3d_Structure *theStructure1, Graphic3d_Structure *theStructure2, Graphic3d_TypeOfConnection theType)
 Returns Standard_True if the connection is possible between <AStructure1> and <AStructure2> without a creation of a cycle.
 
static void Network (Graphic3d_Structure *theStructure, const Graphic3d_TypeOfConnection theType, NCollection_Map< Graphic3d_Structure * > &theSet)
 Returns <ASet> the group of structures :
 
static void PrintNetwork (const Handle< Graphic3d_Structure > &AStructure, const Graphic3d_TypeOfConnection AType)
 Prints information about the network associated with the structure <AStructure>.
 
static void Transforms (const gp_Trsf &theTrsf, const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ, Standard_Real &theNewX, Standard_Real &theNewY, Standard_Real &theNewZ)
 Transforms theX, theY, theZ with the transformation theTrsf.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const char * get_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.
 
- Static Protected Member Functions inherited from Graphic3d_Structure
static void TransformBoundaries (const gp_Trsf &theTrsf, Standard_Real &theXMin, Standard_Real &theYMin, Standard_Real &theZMin, Standard_Real &theXMax, Standard_Real &theYMax, Standard_Real &theZMax)
 Transforms boundaries with <theTrsf> transformation.
 

Constructor & Destructor Documentation

◆ ~PrsMgr_Presentation()

PrsMgr_Presentation::~PrsMgr_Presentation ( )

Destructor.

◆ PrsMgr_Presentation()

PrsMgr_Presentation::PrsMgr_Presentation ( const Handle< PrsMgr_PresentationManager > & thePresentationManager,
const Handle< PrsMgr_PresentableObject > & thePresentableObject,
const Standard_Integer theMode )
protected

Main constructor.

Member Function Documentation

◆ Clear()

virtual void PrsMgr_Presentation::Clear ( const Standard_Boolean theWithDestruction = Standard_True)
overridevirtual

removes the whole content of the presentation. Does not remove the other connected presentations.

Reimplemented from Graphic3d_Structure.

◆ Compute()

virtual void PrsMgr_Presentation::Compute ( )
overridevirtual

Compute structure using presentation manager.

Reimplemented from Graphic3d_Structure.

◆ computeHLR()

virtual void PrsMgr_Presentation::computeHLR ( const Handle< Graphic3d_Camera > & theProjector,
Handle< Graphic3d_Structure > & theStructure )
overrideprotectedvirtual

Returns the new Structure defined for the new visualization.

Reimplemented from Graphic3d_Structure.

◆ Display()

virtual void PrsMgr_Presentation::Display ( )
overridevirtual

Display structure.

Reimplemented from Graphic3d_Structure.

◆ display()

void PrsMgr_Presentation::display ( const Standard_Boolean theIsHighlight)
protected

Displays myStructure.

◆ DumpJson()

virtual void PrsMgr_Presentation::DumpJson ( Standard_OStream & theOStream,
Standard_Integer theDepth = -1 ) const
overridevirtual

Dumps the content of me into the stream.

Reimplemented from Graphic3d_Structure.

◆ Erase()

virtual void PrsMgr_Presentation::Erase ( )
overridevirtual

Remove structure.

Reimplemented from Graphic3d_Structure.

◆ Highlight()

void PrsMgr_Presentation::Highlight ( const Handle< Prs3d_Drawer > & theStyle)

Highlight structure.

◆ IsDisplayed()

virtual Standard_Boolean PrsMgr_Presentation::IsDisplayed ( ) const
inlineoverridevirtual

Return TRUE if structure has been displayed and in no hidden state.

Reimplemented from Graphic3d_Structure.

◆ Mode()

Standard_Integer PrsMgr_Presentation::Mode ( ) const
inline

Return display mode index.

◆ MustBeUpdated()

Standard_Boolean PrsMgr_Presentation::MustBeUpdated ( ) const
inline

◆ Presentation()

Prs3d_Presentation * PrsMgr_Presentation::Presentation ( )
inline
Deprecated
("Dummy to simplify porting - returns self")

◆ PresentationManager()

const Handle< PrsMgr_PresentationManager > & PrsMgr_Presentation::PresentationManager ( ) const
inline

returns the PresentationManager in which the presentation has been created.

◆ SetUpdateStatus()

void PrsMgr_Presentation::SetUpdateStatus ( const Standard_Boolean theUpdateStatus)
inline

◆ Unhighlight()

void PrsMgr_Presentation::Unhighlight ( )

Unhighlight structure.

Field Documentation

◆ myBeforeHighlightState

Standard_Integer PrsMgr_Presentation::myBeforeHighlightState
protected

◆ myMode

Standard_Integer PrsMgr_Presentation::myMode
protected

◆ myMustBeUpdated

Standard_Boolean PrsMgr_Presentation::myMustBeUpdated
protected

◆ myPresentableObject

PrsMgr_PresentableObject* PrsMgr_Presentation::myPresentableObject
protected

◆ myPresentationManager

Handle< PrsMgr_PresentationManager > PrsMgr_Presentation::myPresentationManager
protected

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