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

This class provides methods to compute base mesh presentation. More...

#include <MeshVS_MeshPrsBuilder.hxx>

Inheritance diagram for MeshVS_MeshPrsBuilder:
Inheritance graph
[legend]

Public Member Functions

 MeshVS_MeshPrsBuilder (const occ::handle< MeshVS_Mesh > &Parent, const MeshVS_DisplayModeFlags &Flags=MeshVS_DMF_OCCMask, const occ::handle< MeshVS_DataSource > &DS=nullptr, const int Id=-1, const MeshVS_BuilderPriority &Priority=MeshVS_BP_Mesh)
 Creates builder with certain display mode flags, data source, ID and priority.
 
void Build (const occ::handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const bool IsElement, const int DisplayMode) const override
 Builds base mesh presentation by calling the methods below.
 
virtual void BuildNodes (const occ::handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const int DisplayMode) const
 Builds nodes presentation.
 
virtual void BuildElements (const occ::handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const int DisplayMode) const
 Builds elements presentation.
 
virtual void BuildHilightPrs (const occ::handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, const bool IsElement) const
 Builds presentation of hilighted entity.
 
- Public Member Functions inherited from MeshVS_PrsBuilder
virtual void CustomBuild (const occ::handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const int DisplayMode) const
 This method is called to build presentation of custom elements (they have MeshVS_ET_0D type). IDs is set of numeric identificators of elements for custom building. IDsToExclude is set of IDs to exclude from processing. If some entity has been excluded, it is not processed by other builders. DisplayMode is numeric constant describing display mode (see MeshVS_DisplayModeFlags.hxx)
 
virtual occ::handle< Select3D_SensitiveEntityCustomSensitiveEntity (const occ::handle< SelectMgr_EntityOwner > &Owner, const int SelectMode) const
 This method is called to build sensitive of custom elements ( they have MeshVS_ET_0D type )
 
int GetFlags () const
 Returns flags, assigned with builder during creation.
 
virtual bool TestFlags (const int DisplayMode) const
 Test whether display mode has flags assigned with this builder. This method has default implementation and can be redefined for advance behavior Returns true only if display mode is appropriate for this builder.
 
int GetId () const
 Returns builder ID.
 
int GetPriority () const
 Returns priority; as priority bigger, as soon builder will be called.
 
occ::handle< MeshVS_DataSourceGetDataSource () const
 Returns custom data source or default ( from MeshVS_Mesh ) if custom is NULL.
 
void SetDataSource (const occ::handle< MeshVS_DataSource > &newDS)
 Change custom data source.
 
occ::handle< MeshVS_DrawerGetDrawer () const
 Returns custom drawer or default ( from MeshVS_Mesh ) if custom is NULL.
 
void SetDrawer (const occ::handle< MeshVS_Drawer > &newDr)
 Change custom drawer.
 
void SetExcluding (const bool state)
 Set excluding state. If it is true, the nodes or elements, processed by current builder will be noted and next builder won't process its.
 
bool IsExcludingOn () const
 Read excluding state.
 
void SetPresentationManager (const occ::handle< PrsMgr_PresentationManager > &thePrsMgr)
 Set presentation manager for builder.
 
occ::handle< PrsMgr_PresentationManagerGetPresentationManager () const
 Get presentation manager of builder.
 
- 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.
 

Static Public Member Functions

static void AddVolumePrs (const occ::handle< NCollection_HArray1< NCollection_Sequence< int > > > &Topo, const NCollection_Array1< double > &Nodes, const int NbNodes, const occ::handle< Graphic3d_ArrayOfPrimitives > &Array, const bool IsReflected, const bool IsShrinked, const bool IsSelect, const double ShrinkCoef)
 Add to array polygons or polylines representing volume.
 
static void HowManyPrimitives (const occ::handle< NCollection_HArray1< NCollection_Sequence< int > > > &Topo, const bool AsPolygons, const bool IsSelect, const int NbNodes, int &Vertices, int &Bounds)
 Calculate how many polygons or polylines are necessary to draw passed topology.
 
- 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.
 

Protected Member Functions

void AddLinkPrs (const NCollection_Array1< double > &theCoords, const occ::handle< Graphic3d_ArrayOfSegments > &theLines, const bool IsShrinked, const double ShrinkCoef) const
 Add to array of polylines some lines representing link.
 
void AddFaceWirePrs (const NCollection_Array1< double > &theCoords, const int theNbNodes, const occ::handle< Graphic3d_ArrayOfSegments > &theLines, const bool theIsShrinked, const double theShrinkingCoef) const
 Add to array of segments representing face's wire.
 
void AddFaceSolidPrs (const int ID, const NCollection_Array1< double > &theCoords, const int theNbNodes, const int theMaxNodes, const occ::handle< Graphic3d_ArrayOfTriangles > &theTriangles, const bool theIsReflected, const bool theIsShrinked, const double theShrinkCoef, const bool theIsMeshSmoothShading) const
 Add to array of polygons a polygon representing face.
 
void DrawArrays (const occ::handle< Prs3d_Presentation > &Prs, const occ::handle< Graphic3d_ArrayOfPrimitives > &thePolygons, const occ::handle< Graphic3d_ArrayOfPrimitives > &theLines, const occ::handle< Graphic3d_ArrayOfPrimitives > &theLinkLines, const occ::handle< Graphic3d_ArrayOfPrimitives > &theVolumesInShad, const bool IsPolygonsEdgesOff, const bool IsSelected, const occ::handle< Graphic3d_AspectFillArea3d > &theFillAsp, const occ::handle< Graphic3d_AspectLine3d > &theLineAsp) const
 Draw array of polygons and polylines in the certain order according to transparency.
 
- Protected Member Functions inherited from MeshVS_PrsBuilder
 MeshVS_PrsBuilder (const occ::handle< MeshVS_Mesh > &Parent, const MeshVS_DisplayModeFlags &Flags, const occ::handle< MeshVS_DataSource > &DS, const int Id, const MeshVS_BuilderPriority &Priority=MeshVS_BP_Default)
 Constructor Parent is pointer to MeshVS_Mesh object Flags is set of display modes corresponding to this builder DS is data source object, from which builder will pick geometry and topological information Id is numeric identificator of builder. You must set it to positive integer, but if you set it to -1, constructor will select the smallest integer, not occupied by other builders Priority is numerical priority constant. As priority bigger, as sooner builder starts during presentation construction.
 
occ::handle< MeshVS_DataSourceDataSource () const
 Returns only custom data source.
 
occ::handle< MeshVS_DrawerDrawer () const
 Returns only custom drawer.
 

Static Protected Member Functions

static void CalculateCenter (const NCollection_Array1< double > &theCoords, const int NbNodes, double &xG, double &yG, double &zG)
 Default calculation of center of face or link. This method if useful for shrink mode presentation theCoords is array of nodes coordinates in the strict order X1, Y1, Z1, X2... NbNodes is number of nodes an element consist of xG, yG, zG are coordinates of center whose will be returned.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Protected Attributes inherited from MeshVS_PrsBuilder
MeshVS_MeshPtr myParentMesh
 

Detailed Description

This class provides methods to compute base mesh presentation.

Constructor & Destructor Documentation

◆ MeshVS_MeshPrsBuilder()

MeshVS_MeshPrsBuilder::MeshVS_MeshPrsBuilder ( const occ::handle< MeshVS_Mesh > & Parent,
const MeshVS_DisplayModeFlags & Flags = MeshVS_DMF_OCCMask,
const occ::handle< MeshVS_DataSource > & DS = nullptr,
const int Id = -1,
const MeshVS_BuilderPriority & Priority = MeshVS_BP_Mesh )

Creates builder with certain display mode flags, data source, ID and priority.

Member Function Documentation

◆ AddFaceSolidPrs()

void MeshVS_MeshPrsBuilder::AddFaceSolidPrs ( const int ID,
const NCollection_Array1< double > & theCoords,
const int theNbNodes,
const int theMaxNodes,
const occ::handle< Graphic3d_ArrayOfTriangles > & theTriangles,
const bool theIsReflected,
const bool theIsShrinked,
const double theShrinkCoef,
const bool theIsMeshSmoothShading ) const
protected

Add to array of polygons a polygon representing face.

◆ AddFaceWirePrs()

void MeshVS_MeshPrsBuilder::AddFaceWirePrs ( const NCollection_Array1< double > & theCoords,
const int theNbNodes,
const occ::handle< Graphic3d_ArrayOfSegments > & theLines,
const bool theIsShrinked,
const double theShrinkingCoef ) const
protected

Add to array of segments representing face's wire.

◆ AddLinkPrs()

void MeshVS_MeshPrsBuilder::AddLinkPrs ( const NCollection_Array1< double > & theCoords,
const occ::handle< Graphic3d_ArrayOfSegments > & theLines,
const bool IsShrinked,
const double ShrinkCoef ) const
protected

Add to array of polylines some lines representing link.

◆ AddVolumePrs()

static void MeshVS_MeshPrsBuilder::AddVolumePrs ( const occ::handle< NCollection_HArray1< NCollection_Sequence< int > > > & Topo,
const NCollection_Array1< double > & Nodes,
const int NbNodes,
const occ::handle< Graphic3d_ArrayOfPrimitives > & Array,
const bool IsReflected,
const bool IsShrinked,
const bool IsSelect,
const double ShrinkCoef )
static

Add to array polygons or polylines representing volume.

◆ Build()

void MeshVS_MeshPrsBuilder::Build ( const occ::handle< Prs3d_Presentation > & Prs,
const TColStd_PackedMapOfInteger & IDs,
TColStd_PackedMapOfInteger & IDsToExclude,
const bool IsElement,
const int DisplayMode ) const
overridevirtual

Builds base mesh presentation by calling the methods below.

Implements MeshVS_PrsBuilder.

◆ BuildElements()

virtual void MeshVS_MeshPrsBuilder::BuildElements ( const occ::handle< Prs3d_Presentation > & Prs,
const TColStd_PackedMapOfInteger & IDs,
TColStd_PackedMapOfInteger & IDsToExclude,
const int DisplayMode ) const
virtual

Builds elements presentation.

◆ BuildHilightPrs()

virtual void MeshVS_MeshPrsBuilder::BuildHilightPrs ( const occ::handle< Prs3d_Presentation > & Prs,
const TColStd_PackedMapOfInteger & IDs,
const bool IsElement ) const
virtual

Builds presentation of hilighted entity.

◆ BuildNodes()

virtual void MeshVS_MeshPrsBuilder::BuildNodes ( const occ::handle< Prs3d_Presentation > & Prs,
const TColStd_PackedMapOfInteger & IDs,
TColStd_PackedMapOfInteger & IDsToExclude,
const int DisplayMode ) const
virtual

Builds nodes presentation.

◆ CalculateCenter()

static void MeshVS_MeshPrsBuilder::CalculateCenter ( const NCollection_Array1< double > & theCoords,
const int NbNodes,
double & xG,
double & yG,
double & zG )
staticprotected

Default calculation of center of face or link. This method if useful for shrink mode presentation theCoords is array of nodes coordinates in the strict order X1, Y1, Z1, X2... NbNodes is number of nodes an element consist of xG, yG, zG are coordinates of center whose will be returned.

◆ DrawArrays()

void MeshVS_MeshPrsBuilder::DrawArrays ( const occ::handle< Prs3d_Presentation > & Prs,
const occ::handle< Graphic3d_ArrayOfPrimitives > & thePolygons,
const occ::handle< Graphic3d_ArrayOfPrimitives > & theLines,
const occ::handle< Graphic3d_ArrayOfPrimitives > & theLinkLines,
const occ::handle< Graphic3d_ArrayOfPrimitives > & theVolumesInShad,
const bool IsPolygonsEdgesOff,
const bool IsSelected,
const occ::handle< Graphic3d_AspectFillArea3d > & theFillAsp,
const occ::handle< Graphic3d_AspectLine3d > & theLineAsp ) const
protected

Draw array of polygons and polylines in the certain order according to transparency.

◆ HowManyPrimitives()

static void MeshVS_MeshPrsBuilder::HowManyPrimitives ( const occ::handle< NCollection_HArray1< NCollection_Sequence< int > > > & Topo,
const bool AsPolygons,
const bool IsSelect,
const int NbNodes,
int & Vertices,
int & Bounds )
static

Calculate how many polygons or polylines are necessary to draw passed topology.


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