OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    XSDRAWSTL_DataSource3D Class Reference

    The sample DataSource3D for working with STLMesh_Mesh. More...

    #include <XSDRAWSTL_DataSource3D.hxx>

    Inheritance diagram for XSDRAWSTL_DataSource3D:

    Public Member Functions

     XSDRAWSTL_DataSource3D ()
     Constructor.
    bool GetGeom (const int theID, const bool theIsElement, NCollection_Array1< double > &theCoords, int &theNbNodes, MeshVS_EntityType &theType) const override
     Returns geometry information about node (if IsElement is False) or element (IsElement is True) by coordinates. For element this method must return all its nodes coordinates in the strict order: X, Y, Z and with nodes order is the same as in wire bounding the face or link. NbNodes is number of nodes of element. It is recommended to return 1 for node. Type is an element type.
    bool Get3DGeom (const int theID, int &theNbNodes, occ::handle< NCollection_HArray1< NCollection_Sequence< int > > > &theData) const override
     This method returns topology information about 3D-element Returns false if element with ID isn't 3D or because other troubles.
    bool GetGeomType (const int theID, const bool theIsElement, MeshVS_EntityType &theType) const override
     This method is similar to GetGeom, but returns only element or node type. This method is provided for a fine performance.
    void * GetAddr (const int theID, const bool theIsElement) const override
     This method returns by number an address of any entity which represents element or node data structure.
    bool GetNodesByElement (const int theID, NCollection_Array1< int > &theNodeIDs, int &theNbNodes) const override
     This method returns information about what node this element consist of.
    const TColStd_PackedMapOfInteger & GetAllNodes () const override
     This method returns map of all nodes the object consist of.
    const TColStd_PackedMapOfInteger & GetAllElements () const override
     This method returns map of all elements the object consist of.
    bool GetNormal (const int theID, const int theMax, double &theNx, double &theNy, double &theNz) const override
     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.
    Public Member Functions inherited from MeshVS_DataSource
    virtual bool GetNodeNormal (const int ranknode, const int ElementId, double &nxnx, double &nyny, double &nznz) 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 void * GetGroupAddr (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_Transient & operator= (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_Transient * This () 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

    typedef void base_type
     Returns a type descriptor about this object.
    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.

    Detailed Description

    The sample DataSource3D for working with STLMesh_Mesh.

    Constructor & Destructor Documentation

    ◆ XSDRAWSTL_DataSource3D()

    XSDRAWSTL_DataSource3D::XSDRAWSTL_DataSource3D ( )

    Constructor.

    Member Function Documentation

    ◆ Get3DGeom()

    bool XSDRAWSTL_DataSource3D::Get3DGeom ( const int theID,
    int & theNbNodes,
    occ::handle< NCollection_HArray1< NCollection_Sequence< int > > > & theData ) const
    overridevirtual

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

    Reimplemented from MeshVS_DataSource.

    ◆ GetAddr()

    void * XSDRAWSTL_DataSource3D::GetAddr ( const int theID,
    const bool theIsElement ) const
    overridevirtual

    This method returns by number an address of any entity which represents element or node data structure.

    Implements MeshVS_DataSource.

    ◆ GetAllElements()

    const TColStd_PackedMapOfInteger & XSDRAWSTL_DataSource3D::GetAllElements ( ) const
    overridevirtual

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

    Implements MeshVS_DataSource.

    ◆ GetAllNodes()

    const TColStd_PackedMapOfInteger & XSDRAWSTL_DataSource3D::GetAllNodes ( ) const
    overridevirtual

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

    Implements MeshVS_DataSource.

    ◆ GetGeom()

    bool XSDRAWSTL_DataSource3D::GetGeom ( const int theID,
    const bool theIsElement,
    NCollection_Array1< double > & theCoords,
    int & theNbNodes,
    MeshVS_EntityType & theType ) const
    overridevirtual

    Returns geometry information about node (if IsElement is False) or element (IsElement is True) by coordinates. For element this method must return all its nodes coordinates in the strict order: X, Y, Z and with nodes order is the same as in wire bounding the face or link. NbNodes is number of nodes of element. It is recommended to return 1 for node. Type is an element type.

    Implements MeshVS_DataSource.

    ◆ GetGeomType()

    bool XSDRAWSTL_DataSource3D::GetGeomType ( const int theID,
    const bool theIsElement,
    MeshVS_EntityType & theType ) const
    overridevirtual

    This method is similar to GetGeom, but returns only element or node type. This method is provided for a fine performance.

    Implements MeshVS_DataSource.

    ◆ GetNodesByElement()

    bool XSDRAWSTL_DataSource3D::GetNodesByElement ( const int theID,
    NCollection_Array1< int > & theNodeIDs,
    int & theNbNodes ) const
    overridevirtual

    This method returns information about what node this element consist of.

    Implements MeshVS_DataSource.

    ◆ GetNormal()

    bool XSDRAWSTL_DataSource3D::GetNormal ( const int theID,
    const int theMax,
    double & theNx,
    double & theNy,
    double & theNz ) const
    overridevirtual

    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.

    Reimplemented from MeshVS_DataSource.


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