Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
MeshVS_DataSource Class Referenceabstract

The deferred class using for the following tasks: 1) Receiving geometry data about single element of node by its number; 2) Receiving type of element or node by its number; 3) Receiving topological information about links between element and nodes it consist of; 4) Receiving information about what element cover this node; 5) Receiving information about all nodes and elements the object consist of 6) Activation of advanced mesh selection. In the advanced mesh selection mode there is created: More...

#include <MeshVS_DataSource.hxx>

Inheritance diagram for MeshVS_DataSource:
Inheritance graph
[legend]

Public Member Functions

virtual bool GetGeom (const int ID, const bool IsElement, NCollection_Array1< double > &Coords, int &NbNodes, MeshVS_EntityType &Type) const =0
 Returns geometry information about node or element ID is the numerical identificator of node or element IsElement indicates this ID describe node ( if false ) or element ( if true ) Coords is an array of coordinates of node(s). For node it is only 3 numbers: X, Y, Z in the strict order For element it is 3*n numbers, where n is number of this element vertices The order is strict also: X1, Y1, Z1, X2,...., where Xi, Yi, Zi are coordinates of vertices NbNodes is number of nodes. It is recommended this parameter to be set to 1 for node. Type is type of node or element (from enumeration). It is recommended this parameter to be set to MeshVS_ET_Node for node.
 
virtual bool GetGeomType (const int ID, const bool IsElement, MeshVS_EntityType &Type) const =0
 This method is similar to GetGeom, but returns only element or node type.
 
virtual bool Get3DGeom (const int ID, int &NbNodes, occ::handle< NCollection_HArray1< NCollection_Sequence< int > > > &Data) const
 This method returns topology information about 3D-element Returns false if element with ID isn't 3D or because other troubles.
 
virtual voidGetAddr (const int ID, const bool IsElement) const =0
 This method returns pointer which represents element or node data structure. This address will be saved in MeshVS_MeshEntityOwner, so that you can access to data structure fast by the method Owner(). In the redefined method you can return NULL. ID is the numerical identificator of node or element IsElement indicates this ID describe node ( if false ) or element ( if true )
 
virtual bool GetNodesByElement (const int ID, NCollection_Array1< int > &NodeIDs, int &NbNodes) const =0
 This method returns information about nodes this element consist of. ID is the numerical identificator of element. NodeIDs is the output array of nodes IDs in correct order, the same as coordinates returned by GetGeom(). NbNodes is number of nodes (number of items set in NodeIDs). Returns False if element does not exist.
 
virtual const TColStd_PackedMapOfIntegerGetAllNodes () const =0
 This method returns map of all nodes the object consist of.
 
virtual const TColStd_PackedMapOfIntegerGetAllElements () const =0
 This method returns map of all elements the object consist of.
 
virtual bool GetNormal (const int Id, const int Max, double &nx, double &ny, double &nz) const
 This method calculates normal of face, which is using for correct reflection presentation. There is default method, for advance reflection this method can be redefined. Id is the numerical identificator of only element! Max is maximal number of nodes an element can consist of nx, ny, nz are values whose represent coordinates of normal (will be returned) In the redefined method you can return normal with length more then 1, but in this case the appearance of element will be more bright than usual. For ordinary brightness you must return normal with length 1.
 
virtual bool GetNodeNormal (const int ranknode, const int ElementId, double &nx, double &ny, double &nz) const
 This method return normal of node ranknode of face Id, which is using for smooth shading presentation. Returns false if normal isn't defined.
 
virtual bool GetNormalsByElement (const int Id, const bool IsNodal, const int MaxNodes, occ::handle< NCollection_HArray1< double > > &Normals) const
 This method puts components of normal vectors at each node of a mesh face (at each face of a mesh volume) into the output array. Returns false if some problem was detected during calculation of normals. Id is an identifier of the mesh element. IsNodal, when true, means that normals at mesh element nodes are needed. If nodal normals are not available, or IsNodal is false, or the mesh element is a volume, then the output array contents depend on the element type: face: a normal calculated by GetNormal() is duplicated for each node of the face; volume: normals to all faces of the volume are computed (not for each node!). MaxNodes is maximal number of nodes an element can consist of. Normals contains the result.
 
virtual void GetAllGroups (TColStd_PackedMapOfInteger &Ids) const
 This method returns map of all groups the object contains.
 
virtual bool GetGroup (const int Id, MeshVS_EntityType &Type, TColStd_PackedMapOfInteger &Ids) const
 This method returns map of all group elements.
 
virtual voidGetGroupAddr (const int ID) const
 This method returns pointer which represents group data structure. This address will be saved in MeshVS_MeshOwner, so that you can access to data structure fast by the method Owner(). In the redefined method you can return NULL. ID is the numerical identificator of group.
 
virtual bool IsAdvancedSelectionEnabled () const
 Returns True if advanced mesh selection is enabled. Default implementation returns False. It should be redefined to return True for advanced mesh selection activation.
 
virtual Bnd_Box GetBoundingBox () const
 Returns the bounding box of the whole mesh. It is used in advanced selection mode to define roughly the sensitive area of the mesh. It can be redefined to get access to a box computed in advance.
 
virtual bool GetDetectedEntities (const occ::handle< MeshVS_Mesh > &Prs, const double X, const double Y, const double aTol, occ::handle< TColStd_HPackedMapOfInteger > &Nodes, occ::handle< TColStd_HPackedMapOfInteger > &Elements, double &DMin)
 Returns maps of entities (nodes and elements) detected by mouse click at the point (X,Y) on the current view plane, with the tolerance aTol. DMin - is out argument should return actual detection tolerance. Returns True if something is detected. It should be redefined if the advanced mesh selection is activated. Default implementation returns False.
 
virtual bool GetDetectedEntities (const occ::handle< MeshVS_Mesh > &Prs, const double XMin, const double YMin, const double XMax, const double YMax, const double aTol, occ::handle< TColStd_HPackedMapOfInteger > &Nodes, occ::handle< TColStd_HPackedMapOfInteger > &Elements)
 Returns maps of entities (nodes and elements) detected by mouse selection with rectangular box (XMin, YMin, XMax, YMax) on the current view plane, with the tolerance aTol. Returns True if something is detected. It should be redefined if the advanced mesh selection is activated. Default implementation returns False.
 
virtual bool GetDetectedEntities (const occ::handle< MeshVS_Mesh > &Prs, const NCollection_Array1< gp_Pnt2d > &Polyline, const Bnd_Box2d &aBox, const double aTol, occ::handle< TColStd_HPackedMapOfInteger > &Nodes, occ::handle< TColStd_HPackedMapOfInteger > &Elements)
 Returns maps of entities (nodes and elements) detected by mouse selection with the polyline <Polyline> on the current view plane, with the tolerance aTol. Returns True if something is detected. It should be redefined if the advanced mesh selection is activated. Default implementation returns False.
 
virtual bool GetDetectedEntities (const occ::handle< MeshVS_Mesh > &Prs, occ::handle< TColStd_HPackedMapOfInteger > &Nodes, occ::handle< TColStd_HPackedMapOfInteger > &Elements)
 Filter out the maps of mesh entities so as to keep only the entities that are allowed to be selected according to the current context. Returns True if any of the maps has been changed. It should be redefined if the advanced mesh selection is activated. Default implementation returns False.
 
- 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.
 

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

The deferred class using for the following tasks: 1) Receiving geometry data about single element of node by its number; 2) Receiving type of element or node by its number; 3) Receiving topological information about links between element and nodes it consist of; 4) Receiving information about what element cover this node; 5) Receiving information about all nodes and elements the object consist of 6) Activation of advanced mesh selection. In the advanced mesh selection mode there is created:

Member Function Documentation

◆ Get3DGeom()

virtual bool MeshVS_DataSource::Get3DGeom ( const int ID,
int & NbNodes,
occ::handle< NCollection_HArray1< NCollection_Sequence< int > > > & Data ) const
virtual

This method returns topology information about 3D-element Returns false if element with ID isn't 3D or because other troubles.

Reimplemented in MeshVS_DeformedDataSource, and XSDRAWSTL_DataSource3D.

◆ GetAddr()

virtual void * MeshVS_DataSource::GetAddr ( const int ID,
const bool IsElement ) const
pure virtual

This method returns pointer which represents element or node data structure. This address will be saved in MeshVS_MeshEntityOwner, so that you can access to data structure fast by the method Owner(). In the redefined method you can return NULL. ID is the numerical identificator of node or element IsElement indicates this ID describe node ( if false ) or element ( if true )

Implemented in XSDRAWSTL_DataSource, MeshVS_DeformedDataSource, and XSDRAWSTL_DataSource3D.

◆ GetAllElements()

virtual const TColStd_PackedMapOfInteger & MeshVS_DataSource::GetAllElements ( ) const
pure virtual

This method returns map of all elements the object consist of.

Implemented in XSDRAWSTL_DataSource, XSDRAWSTL_DataSource3D, and MeshVS_DeformedDataSource.

◆ GetAllGroups()

virtual void MeshVS_DataSource::GetAllGroups ( TColStd_PackedMapOfInteger & Ids) const
virtual

This method returns map of all groups the object contains.

◆ GetAllNodes()

virtual const TColStd_PackedMapOfInteger & MeshVS_DataSource::GetAllNodes ( ) const
pure virtual

This method returns map of all nodes the object consist of.

Implemented in XSDRAWSTL_DataSource, XSDRAWSTL_DataSource3D, and MeshVS_DeformedDataSource.

◆ GetBoundingBox()

virtual Bnd_Box MeshVS_DataSource::GetBoundingBox ( ) const
virtual

Returns the bounding box of the whole mesh. It is used in advanced selection mode to define roughly the sensitive area of the mesh. It can be redefined to get access to a box computed in advance.

◆ GetDetectedEntities() [1/4]

virtual bool MeshVS_DataSource::GetDetectedEntities ( const occ::handle< MeshVS_Mesh > & Prs,
const double X,
const double Y,
const double aTol,
occ::handle< TColStd_HPackedMapOfInteger > & Nodes,
occ::handle< TColStd_HPackedMapOfInteger > & Elements,
double & DMin )
virtual

Returns maps of entities (nodes and elements) detected by mouse click at the point (X,Y) on the current view plane, with the tolerance aTol. DMin - is out argument should return actual detection tolerance. Returns True if something is detected. It should be redefined if the advanced mesh selection is activated. Default implementation returns False.

◆ GetDetectedEntities() [2/4]

virtual bool MeshVS_DataSource::GetDetectedEntities ( const occ::handle< MeshVS_Mesh > & Prs,
const double XMin,
const double YMin,
const double XMax,
const double YMax,
const double aTol,
occ::handle< TColStd_HPackedMapOfInteger > & Nodes,
occ::handle< TColStd_HPackedMapOfInteger > & Elements )
virtual

Returns maps of entities (nodes and elements) detected by mouse selection with rectangular box (XMin, YMin, XMax, YMax) on the current view plane, with the tolerance aTol. Returns True if something is detected. It should be redefined if the advanced mesh selection is activated. Default implementation returns False.

◆ GetDetectedEntities() [3/4]

virtual bool MeshVS_DataSource::GetDetectedEntities ( const occ::handle< MeshVS_Mesh > & Prs,
const NCollection_Array1< gp_Pnt2d > & Polyline,
const Bnd_Box2d & aBox,
const double aTol,
occ::handle< TColStd_HPackedMapOfInteger > & Nodes,
occ::handle< TColStd_HPackedMapOfInteger > & Elements )
virtual

Returns maps of entities (nodes and elements) detected by mouse selection with the polyline <Polyline> on the current view plane, with the tolerance aTol. Returns True if something is detected. It should be redefined if the advanced mesh selection is activated. Default implementation returns False.

◆ GetDetectedEntities() [4/4]

virtual bool MeshVS_DataSource::GetDetectedEntities ( const occ::handle< MeshVS_Mesh > & Prs,
occ::handle< TColStd_HPackedMapOfInteger > & Nodes,
occ::handle< TColStd_HPackedMapOfInteger > & Elements )
virtual

Filter out the maps of mesh entities so as to keep only the entities that are allowed to be selected according to the current context. Returns True if any of the maps has been changed. It should be redefined if the advanced mesh selection is activated. Default implementation returns False.

◆ GetGeom()

virtual bool MeshVS_DataSource::GetGeom ( const int ID,
const bool IsElement,
NCollection_Array1< double > & Coords,
int & NbNodes,
MeshVS_EntityType & Type ) const
pure virtual

Returns geometry information about node or element ID is the numerical identificator of node or element IsElement indicates this ID describe node ( if false ) or element ( if true ) Coords is an array of coordinates of node(s). For node it is only 3 numbers: X, Y, Z in the strict order For element it is 3*n numbers, where n is number of this element vertices The order is strict also: X1, Y1, Z1, X2,...., where Xi, Yi, Zi are coordinates of vertices NbNodes is number of nodes. It is recommended this parameter to be set to 1 for node. Type is type of node or element (from enumeration). It is recommended this parameter to be set to MeshVS_ET_Node for node.

Implemented in XSDRAWSTL_DataSource, MeshVS_DeformedDataSource, and XSDRAWSTL_DataSource3D.

◆ GetGeomType()

virtual bool MeshVS_DataSource::GetGeomType ( const int ID,
const bool IsElement,
MeshVS_EntityType & Type ) const
pure virtual

This method is similar to GetGeom, but returns only element or node type.

Implemented in XSDRAWSTL_DataSource, MeshVS_DeformedDataSource, and XSDRAWSTL_DataSource3D.

◆ GetGroup()

virtual bool MeshVS_DataSource::GetGroup ( const int Id,
MeshVS_EntityType & Type,
TColStd_PackedMapOfInteger & Ids ) const
virtual

This method returns map of all group elements.

◆ GetGroupAddr()

virtual void * MeshVS_DataSource::GetGroupAddr ( const int ID) const
virtual

This method returns pointer which represents group data structure. This address will be saved in MeshVS_MeshOwner, so that you can access to data structure fast by the method Owner(). In the redefined method you can return NULL. ID is the numerical identificator of group.

◆ GetNodeNormal()

virtual bool MeshVS_DataSource::GetNodeNormal ( const int ranknode,
const int ElementId,
double & nx,
double & ny,
double & nz ) const
virtual

This method return normal of node ranknode of face Id, which is using for smooth shading presentation. Returns false if normal isn't defined.

◆ GetNodesByElement()

virtual bool MeshVS_DataSource::GetNodesByElement ( const int ID,
NCollection_Array1< int > & NodeIDs,
int & NbNodes ) const
pure virtual

This method returns information about nodes this element consist of. ID is the numerical identificator of element. NodeIDs is the output array of nodes IDs in correct order, the same as coordinates returned by GetGeom(). NbNodes is number of nodes (number of items set in NodeIDs). Returns False if element does not exist.

Implemented in XSDRAWSTL_DataSource, MeshVS_DeformedDataSource, and XSDRAWSTL_DataSource3D.

◆ GetNormal()

virtual bool MeshVS_DataSource::GetNormal ( const int Id,
const int Max,
double & nx,
double & ny,
double & nz ) const
virtual

This method calculates normal of face, which is using for correct reflection presentation. There is default method, for advance reflection this method can be redefined. Id is the numerical identificator of only element! Max is maximal number of nodes an element can consist of nx, ny, nz are values whose represent coordinates of normal (will be returned) In the redefined method you can return normal with length more then 1, but in this case the appearance of element will be more bright than usual. For ordinary brightness you must return normal with length 1.

Reimplemented in XSDRAWSTL_DataSource, and XSDRAWSTL_DataSource3D.

◆ GetNormalsByElement()

virtual bool MeshVS_DataSource::GetNormalsByElement ( const int Id,
const bool IsNodal,
const int MaxNodes,
occ::handle< NCollection_HArray1< double > > & Normals ) const
virtual

This method puts components of normal vectors at each node of a mesh face (at each face of a mesh volume) into the output array. Returns false if some problem was detected during calculation of normals. Id is an identifier of the mesh element. IsNodal, when true, means that normals at mesh element nodes are needed. If nodal normals are not available, or IsNodal is false, or the mesh element is a volume, then the output array contents depend on the element type: face: a normal calculated by GetNormal() is duplicated for each node of the face; volume: normals to all faces of the volume are computed (not for each node!). MaxNodes is maximal number of nodes an element can consist of. Normals contains the result.

◆ IsAdvancedSelectionEnabled()

virtual bool MeshVS_DataSource::IsAdvancedSelectionEnabled ( ) const
virtual

Returns True if advanced mesh selection is enabled. Default implementation returns False. It should be redefined to return True for advanced mesh selection activation.


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