Open CASCADE Technology 7.8.0
Public Member Functions
RWMesh_TriangulationSource Class Reference

Mesh data wrapper for delayed triangulation loading. Class inherits Poly_Triangulation so that it can be put temporarily into TopoDS_Face within assembly structure. More...

#include <RWMesh_TriangulationSource.hxx>

Inheritance diagram for RWMesh_TriangulationSource:
Inheritance graph
[legend]

Public Member Functions

 RWMesh_TriangulationSource ()
 Constructor.
 
virtual ~RWMesh_TriangulationSource ()
 Destructor.
 
const Handle< RWMesh_TriangulationReader > & Reader () const
 Returns reader allowing to read data from the buffer.
 
void SetReader (const Handle< RWMesh_TriangulationReader > &theReader)
 Sets reader allowing to read data from the buffer.
 
Standard_Integer DegeneratedTriNb () const
 Returns number of degenerated triangles collected during data reading. Used for debug statistic purpose.
 
Standard_IntegerChangeDegeneratedTriNb ()
 Gets access to number of degenerated triangles to collect them during data reading.
 
- Public Member Functions inherited from Poly_Triangulation
 Poly_Triangulation ()
 Constructs an empty triangulation.
 
 Poly_Triangulation (const Standard_Integer theNbNodes, const Standard_Integer theNbTriangles, const Standard_Boolean theHasUVNodes, const Standard_Boolean theHasNormals=false)
 Constructs a triangulation from a set of triangles. The triangulation is initialized without a triangle or a node, but capable of containing specified number of nodes and triangles.
 
 Poly_Triangulation (const TColgp_Array1OfPnt &Nodes, const Poly_Array1OfTriangle &Triangles)
 Constructs a triangulation from a set of triangles. The triangulation is initialized with 3D points from Nodes and triangles from Triangles.
 
 Poly_Triangulation (const TColgp_Array1OfPnt &Nodes, const TColgp_Array1OfPnt2d &UVNodes, const Poly_Array1OfTriangle &Triangles)
 Constructs a triangulation from a set of triangles. The triangulation is initialized with 3D points from Nodes, 2D points from UVNodes and triangles from Triangles, where coordinates of a 2D point from UVNodes are the (u, v) parameters of the corresponding 3D point from Nodes on the surface approximated by the constructed triangulation.
 
virtual ~Poly_Triangulation ()
 Destructor.
 
virtual Handle< Poly_TriangulationCopy () const
 Creates full copy of current triangulation.
 
 Poly_Triangulation (const Handle< Poly_Triangulation > &theTriangulation)
 Copy constructor for triangulation.
 
Standard_Real Deflection () const
 Returns the deflection of this triangulation.
 
void Deflection (const Standard_Real theDeflection)
 Sets the deflection of this triangulation to theDeflection. See more on deflection in Polygon2D.
 
const Handle< Poly_TriangulationParameters > & Parameters () const
 Returns initial set of parameters used to generate this triangulation.
 
void Parameters (const Handle< Poly_TriangulationParameters > &theParams)
 Updates initial set of parameters used to generate this triangulation.
 
virtual void Clear ()
 Clears internal arrays of nodes and all attributes.
 
virtual Standard_Boolean HasGeometry () const
 Returns TRUE if triangulation has some geometry.
 
Standard_Integer NbNodes () const
 Returns the number of nodes for this triangulation.
 
Standard_Integer NbTriangles () const
 Returns the number of triangles for this triangulation.
 
Standard_Boolean HasUVNodes () const
 Returns Standard_True if 2D nodes are associated with 3D nodes for this triangulation.
 
Standard_Boolean HasNormals () const
 Returns Standard_True if nodal normals are defined.
 
gp_Pnt Node (Standard_Integer theIndex) const
 Returns a node at the given index.
 
void SetNode (Standard_Integer theIndex, const gp_Pnt &thePnt)
 Sets a node coordinates.
 
gp_Pnt2d UVNode (Standard_Integer theIndex) const
 Returns UV-node at the given index.
 
void SetUVNode (Standard_Integer theIndex, const gp_Pnt2d &thePnt)
 Sets an UV-node coordinates.
 
const Poly_TriangleTriangle (Standard_Integer theIndex) const
 Returns triangle at the given index.
 
void SetTriangle (Standard_Integer theIndex, const Poly_Triangle &theTriangle)
 Sets a triangle.
 
gp_Dir Normal (Standard_Integer theIndex) const
 Returns normal at the given index.
 
void Normal (Standard_Integer theIndex, gp_Vec3f &theVec3) const
 Returns normal at the given index.
 
void SetNormal (const Standard_Integer theIndex, const gp_Vec3f &theNormal)
 Changes normal at the given index.
 
void SetNormal (const Standard_Integer theIndex, const gp_Dir &theNormal)
 Changes normal at the given index.
 
Poly_MeshPurpose MeshPurpose () const
 Returns mesh purpose bits.
 
void SetMeshPurpose (const Poly_MeshPurpose thePurpose)
 Sets mesh purpose bits.
 
const Bnd_BoxCachedMinMax () const
 Returns cached min - max range of triangulation data, which is VOID by default (e.g, no cached information).
 
void SetCachedMinMax (const Bnd_Box &theBox)
 Sets a cached min - max range of this triangulation. The bounding box should exactly match actual range of triangulation data without a gap or transformation, or otherwise undefined behavior will be observed. Passing a VOID range invalidates the cache.
 
Standard_Boolean HasCachedMinMax () const
 Returns TRUE if there is some cached min - max range of this triangulation.
 
void UpdateCachedMinMax ()
 Updates cached min - max range of this triangulation with bounding box of nodal data.
 
Standard_Boolean MinMax (Bnd_Box &theBox, const gp_Trsf &theTrsf, const bool theIsAccurate=false) const
 Extends the passed box with bounding box of this triangulation. Uses cached min - max range when available and:
 
virtual void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const
 Dumps the content of me into the stream.
 
bool IsDoublePrecision () const
 Returns TRUE if node positions are defined with double precision; TRUE by default.
 
void SetDoublePrecision (bool theIsDouble)
 Set if node positions should be defined with double or single precision for 3D and UV nodes. Raises exception if data was already allocated.
 
void ResizeNodes (Standard_Integer theNbNodes, Standard_Boolean theToCopyOld)
 Method resizing internal arrays of nodes (synchronously for all attributes).
 
void ResizeTriangles (Standard_Integer theNbTriangles, Standard_Boolean theToCopyOld)
 Method resizing an internal array of triangles.
 
void AddUVNodes ()
 If an array for UV coordinates is not allocated yet, do it now.
 
void RemoveUVNodes ()
 Deallocates the UV nodes array.
 
void AddNormals ()
 If an array for normals is not allocated yet, do it now.
 
void RemoveNormals ()
 Deallocates the normals array.
 
void ComputeNormals ()
 Compute smooth normals by averaging triangle normals.
 
Handle< TColgp_HArray1OfPntMapNodeArray () const
 Returns the table of 3D points for read-only access or NULL if nodes array is undefined. Poly_Triangulation::Node() should be used instead when possible. Returned object should not be used after Poly_Triangulation destruction.
 
Handle< Poly_HArray1OfTriangleMapTriangleArray () const
 Returns the triangle array for read-only access or NULL if triangle array is undefined. Poly_Triangulation::Triangle() should be used instead when possible. Returned object should not be used after Poly_Triangulation destruction.
 
Handle< TColgp_HArray1OfPnt2dMapUVNodeArray () const
 Returns the table of 2D nodes for read-only access or NULL if UV nodes array is undefined. Poly_Triangulation::UVNode() should be used instead when possible. Returned object should not be used after Poly_Triangulation destruction.
 
Handle< TShort_HArray1OfShortRealMapNormalArray () const
 Returns the table of per-vertex normals for read-only access or NULL if normals array is undefined. Poly_Triangulation::Normal() should be used instead when possible. Returned object should not be used after Poly_Triangulation destruction.
 
Poly_Array1OfTriangleInternalTriangles ()
 Returns an internal array of triangles. Triangle()/SetTriangle() should be used instead in portable code.
 
Poly_ArrayOfNodesInternalNodes ()
 Returns an internal array of nodes. Node()/SetNode() should be used instead in portable code.
 
Poly_ArrayOfUVNodesInternalUVNodes ()
 Returns an internal array of UV nodes. UBNode()/SetUVNode() should be used instead in portable code.
 
NCollection_Array1< gp_Vec3f > & InternalNormals ()
 Return an internal array of normals. Normal()/SetNormal() should be used instead in portable code.
 
void SetNormals (const Handle< TShort_HArray1OfShortReal > &theNormals)
 
const Poly_Array1OfTriangleTriangles () const
 
Poly_Array1OfTriangleChangeTriangles ()
 
Poly_TriangleChangeTriangle (const Standard_Integer theIndex)
 
virtual Standard_Boolean HasDeferredData () const
 Returns TRUE if there is some triangulation data that can be loaded using LoadDeferredData().
 
virtual Standard_Boolean LoadDeferredData (const Handle< OSD_FileSystem > &theFileSystem=Handle< OSD_FileSystem >())
 Loads triangulation data into itself from some deferred storage using specified shared input file system.
 
virtual Handle< Poly_TriangulationDetachedLoadDeferredData (const Handle< OSD_FileSystem > &theFileSystem=Handle< OSD_FileSystem >()) const
 Loads triangulation data into new Poly_Triangulation object from some deferred storage using specified shared input file system.
 
virtual Standard_Boolean UnloadDeferredData ()
 Releases triangulation data if it has connected deferred storage.
 
- 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.
 

late-load deferred data interface

Handle< RWMesh_TriangulationReadermyReader
 Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Standard_Integer myNbDefNodes
 Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Standard_Integer myNbDefTriangles
 Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Standard_Integer myStatisticOfDegeneratedTriNb
 Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
virtual Standard_Integer NbDeferredNodes () const override
 Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
void SetNbDeferredNodes (const Standard_Integer theNbNodes)
 Sets number of nodes for deferred loading.
 
virtual Standard_Integer NbDeferredTriangles () const override
 Returns number of triangles for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
void SetNbDeferredTriangles (const Standard_Integer theNbTris)
 Sets number of triangles for deferred loading.
 
virtual Standard_Boolean loadDeferredData (const Handle< OSD_FileSystem > &theFileSystem, const Handle< Poly_Triangulation > &theDestTriangulation) const override
 Loads triangulation data from deferred storage using specified shared input file system.
 

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.
 
- Protected Member Functions inherited from Poly_Triangulation
virtual Handle< Poly_TriangulationcreateNewEntity () const
 Creates new triangulation object (can be inheritor of Poly_Triangulation).
 
void unsetCachedMinMax ()
 Clears cached min - max range saved previously.
 
virtual Bnd_Box computeBoundingBox (const gp_Trsf &theTrsf) const
 Calculates bounding box of nodal data.
 
- Protected Attributes inherited from Poly_Triangulation
Bnd_BoxmyCachedMinMax
 Returns number of deferred nodes that can be loaded using LoadDeferredData(). Note: this is estimated values, which might be different from actually loaded values. Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Standard_Real myDeflection
 Returns number of deferred nodes that can be loaded using LoadDeferredData(). Note: this is estimated values, which might be different from actually loaded values. Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Poly_ArrayOfNodes myNodes
 Returns number of deferred nodes that can be loaded using LoadDeferredData(). Note: this is estimated values, which might be different from actually loaded values. Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Poly_Array1OfTriangle myTriangles
 Returns number of deferred nodes that can be loaded using LoadDeferredData(). Note: this is estimated values, which might be different from actually loaded values. Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Poly_ArrayOfUVNodes myUVNodes
 Returns number of deferred nodes that can be loaded using LoadDeferredData(). Note: this is estimated values, which might be different from actually loaded values. Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
NCollection_Array1< gp_Vec3fmyNormals
 Returns number of deferred nodes that can be loaded using LoadDeferredData(). Note: this is estimated values, which might be different from actually loaded values. Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Poly_MeshPurpose myPurpose
 Returns number of deferred nodes that can be loaded using LoadDeferredData(). Note: this is estimated values, which might be different from actually loaded values. Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 
Handle< Poly_TriangulationParametersmyParams
 Returns number of deferred nodes that can be loaded using LoadDeferredData(). Note: this is estimated values, which might be different from actually loaded values. Always check triangulation size of actually loaded data in code to avoid out-of-range issues.
 

Detailed Description

Mesh data wrapper for delayed triangulation loading. Class inherits Poly_Triangulation so that it can be put temporarily into TopoDS_Face within assembly structure.

Constructor & Destructor Documentation

◆ RWMesh_TriangulationSource()

RWMesh_TriangulationSource::RWMesh_TriangulationSource ( )

Constructor.

◆ ~RWMesh_TriangulationSource()

virtual RWMesh_TriangulationSource::~RWMesh_TriangulationSource ( )
virtual

Destructor.

Member Function Documentation

◆ ChangeDegeneratedTriNb()

Standard_Integer & RWMesh_TriangulationSource::ChangeDegeneratedTriNb ( )
inline

Gets access to number of degenerated triangles to collect them during data reading.

◆ DegeneratedTriNb()

Standard_Integer RWMesh_TriangulationSource::DegeneratedTriNb ( ) const
inline

Returns number of degenerated triangles collected during data reading. Used for debug statistic purpose.

◆ loadDeferredData()

virtual Standard_Boolean RWMesh_TriangulationSource::loadDeferredData ( const Handle< OSD_FileSystem > &  theFileSystem,
const Handle< Poly_Triangulation > &  theDestTriangulation 
) const
overrideprotectedvirtual

Loads triangulation data from deferred storage using specified shared input file system.

Reimplemented from Poly_Triangulation.

◆ NbDeferredNodes()

virtual Standard_Integer RWMesh_TriangulationSource::NbDeferredNodes ( ) const
inlineoverridevirtual

Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.

Reimplemented from Poly_Triangulation.

◆ NbDeferredTriangles()

virtual Standard_Integer RWMesh_TriangulationSource::NbDeferredTriangles ( ) const
inlineoverridevirtual

Returns number of triangles for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.

Reimplemented from Poly_Triangulation.

◆ Reader()

const Handle< RWMesh_TriangulationReader > & RWMesh_TriangulationSource::Reader ( ) const
inline

Returns reader allowing to read data from the buffer.

◆ SetNbDeferredNodes()

void RWMesh_TriangulationSource::SetNbDeferredNodes ( const Standard_Integer  theNbNodes)
inline

Sets number of nodes for deferred loading.

◆ SetNbDeferredTriangles()

void RWMesh_TriangulationSource::SetNbDeferredTriangles ( const Standard_Integer  theNbTris)
inline

Sets number of triangles for deferred loading.

◆ SetReader()

void RWMesh_TriangulationSource::SetReader ( const Handle< RWMesh_TriangulationReader > &  theReader)
inline

Sets reader allowing to read data from the buffer.

Field Documentation

◆ myNbDefNodes

Standard_Integer RWMesh_TriangulationSource::myNbDefNodes
protected

Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.

◆ myNbDefTriangles

Standard_Integer RWMesh_TriangulationSource::myNbDefTriangles
protected

Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.

◆ myReader

Handle< RWMesh_TriangulationReader > RWMesh_TriangulationSource::myReader
protected

Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.

◆ myStatisticOfDegeneratedTriNb

Standard_Integer RWMesh_TriangulationSource::myStatisticOfDegeneratedTriNb
mutableprotected

Returns number of nodes for deferred loading. Note: this is estimated values defined in object header, which might be different from actually loaded values (due to broken header or extra mesh processing). Always check triangulation size of actually loaded data in code to avoid out-of-range issues.


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