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

Provides a triangulation for a surface, a set of surfaces, or more generally a shape. More...

#include <Poly_Triangulation.hxx>

Inheritance diagram for Poly_Triangulation:
Inheritance graph
[legend]

Public Member Functions

 Poly_Triangulation ()
 Constructs an empty triangulation.
 
 Poly_Triangulation (const int theNbNodes, const int theNbTriangles, const bool theHasUVNodes, const bool 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 NCollection_Array1< gp_Pnt > &Nodes, const NCollection_Array1< Poly_Triangle > &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 NCollection_Array1< gp_Pnt > &Nodes, const NCollection_Array1< gp_Pnt2d > &UVNodes, const NCollection_Array1< Poly_Triangle > &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.
 
 ~Poly_Triangulation () override
 Destructor.
 
virtual occ::handle< Poly_TriangulationCopy () const
 Creates full copy of current triangulation.
 
 Poly_Triangulation (const occ::handle< Poly_Triangulation > &theTriangulation)
 Copy constructor for triangulation.
 
double Deflection () const
 Returns the deflection of this triangulation.
 
void Deflection (const double theDeflection)
 Sets the deflection of this triangulation to theDeflection. See more on deflection in Polygon2D.
 
const occ::handle< Poly_TriangulationParameters > & Parameters () const
 Returns initial set of parameters used to generate this triangulation.
 
void Parameters (const occ::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 bool HasGeometry () const
 Returns TRUE if triangulation has some geometry.
 
int NbNodes () const
 Returns the number of nodes for this triangulation.
 
int NbTriangles () const
 Returns the number of triangles for this triangulation.
 
bool HasUVNodes () const
 Returns true if 2D nodes are associated with 3D nodes for this triangulation.
 
bool HasNormals () const
 Returns true if nodal normals are defined.
 
gp_Pnt Node (int theIndex) const
 Returns a node at the given index.
 
void SetNode (int theIndex, const gp_Pnt &thePnt)
 Sets a node coordinates.
 
gp_Pnt2d UVNode (int theIndex) const
 Returns UV-node at the given index.
 
void SetUVNode (int theIndex, const gp_Pnt2d &thePnt)
 Sets an UV-node coordinates.
 
const Poly_TriangleTriangle (int theIndex) const
 Returns triangle at the given index.
 
void SetTriangle (int theIndex, const Poly_Triangle &theTriangle)
 Sets a triangle.
 
gp_Dir Normal (int theIndex) const
 Returns normal at the given index.
 
void Normal (int theIndex, NCollection_Vec3< float > &theVec3) const
 Returns normal at the given index.
 
void SetNormal (const int theIndex, const NCollection_Vec3< float > &theNormal)
 Changes normal at the given index.
 
void SetNormal (const int 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.
 
bool 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.
 
bool 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, int 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 (int theNbNodes, bool theToCopyOld)
 Method resizing internal arrays of nodes (synchronously for all attributes).
 
void ResizeTriangles (int theNbTriangles, bool 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.
 
occ::handle< NCollection_HArray1< gp_Pnt > > MapNodeArray () 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.
 
occ::handle< NCollection_HArray1< Poly_Triangle > > MapTriangleArray () 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.
 
occ::handle< NCollection_HArray1< gp_Pnt2d > > MapUVNodeArray () 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.
 
occ::handle< NCollection_HArray1< float > > MapNormalArray () 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.
 
NCollection_Array1< Poly_Triangle > & InternalTriangles ()
 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< NCollection_Vec3< float > > & InternalNormals ()
 Return an internal array of normals. Normal()/SetNormal() should be used instead in portable code.
 
void SetNormals (const occ::handle< NCollection_HArray1< float > > &theNormals)
 
const NCollection_Array1< Poly_Triangle > & Triangles () const
 
NCollection_Array1< Poly_Triangle > & ChangeTriangles ()
 
Poly_TriangleChangeTriangle (const int theIndex)
 
- 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.
 

late-load deferred data interface

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.

std::atomic< Bnd_Box * > myCachedMinMax {nullptr}
 Returns number of deferred triangles 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.
 
std::shared_mutex myCachedMinMaxMutex
 Returns number of deferred triangles 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.
 
double myDeflection
 Returns number of deferred triangles 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 triangles 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< Poly_TrianglemyTriangles
 Returns number of deferred triangles 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 triangles 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< NCollection_Vec3< float > > myNormals
 Returns number of deferred triangles 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 triangles 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.
 
occ::handle< Poly_TriangulationParametersmyParams
 Returns number of deferred triangles 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.
 
virtual int NbDeferredNodes () const
 Returns number of deferred triangles 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.
 
virtual int NbDeferredTriangles () const
 Returns number of deferred triangles 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.
 
virtual bool HasDeferredData () const
 Returns TRUE if there is some triangulation data that can be loaded using LoadDeferredData().
 
virtual bool LoadDeferredData (const occ::handle< OSD_FileSystem > &theFileSystem=occ::handle< OSD_FileSystem >())
 Loads triangulation data into itself from some deferred storage using specified shared input file system.
 
virtual occ::handle< Poly_TriangulationDetachedLoadDeferredData (const occ::handle< OSD_FileSystem > &theFileSystem=occ::handle< OSD_FileSystem >()) const
 Loads triangulation data into new Poly_Triangulation object from some deferred storage using specified shared input file system.
 
virtual bool UnloadDeferredData ()
 Releases triangulation data if it has connected deferred storage.
 
virtual occ::handle< Poly_TriangulationcreateNewEntity () const
 Creates new triangulation object (can be inheritor of Poly_Triangulation).
 
virtual bool loadDeferredData (const occ::handle< OSD_FileSystem > &theFileSystem, const occ::handle< Poly_Triangulation > &theDestTriangulation) const
 Load triangulation data from deferred storage using specified shared input file system.
 
void unsetCachedMinMax ()
 Clears cached min - max range saved previously.
 
virtual Bnd_Box computeBoundingBox (const gp_Trsf &theTrsf) const
 Calculates bounding box of nodal data.
 

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

Provides a triangulation for a surface, a set of surfaces, or more generally a shape.

A triangulation consists of an approximate representation of the actual shape, using a collection of points and triangles. The points are located on the surface. The edges of the triangles connect adjacent points with a straight line that approximates the true curve on the surface.

A triangulation comprises:

In many cases, algorithms do not need to work with the exact representation of a surface. A triangular representation induces simpler and more robust adjusting, faster performances, and the results are as good.

Constructor & Destructor Documentation

◆ Poly_Triangulation() [1/5]

Poly_Triangulation::Poly_Triangulation ( )

Constructs an empty triangulation.

◆ Poly_Triangulation() [2/5]

Poly_Triangulation::Poly_Triangulation ( const int theNbNodes,
const int theNbTriangles,
const bool theHasUVNodes,
const bool 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.

Parameters
[in]theNbNodesnumber of nodes to allocate
[in]theNbTrianglesnumber of triangles to allocate
[in]theHasUVNodesindicates whether 2D nodes will be associated with 3D ones, (i.e. to enable a 2D representation)
[in]theHasNormalsindicates whether normals will be given and associated with nodes

◆ Poly_Triangulation() [3/5]

Poly_Triangulation::Poly_Triangulation ( const NCollection_Array1< gp_Pnt > & Nodes,
const NCollection_Array1< Poly_Triangle > & Triangles )

Constructs a triangulation from a set of triangles. The triangulation is initialized with 3D points from Nodes and triangles from Triangles.

◆ Poly_Triangulation() [4/5]

Poly_Triangulation::Poly_Triangulation ( const NCollection_Array1< gp_Pnt > & Nodes,
const NCollection_Array1< gp_Pnt2d > & UVNodes,
const NCollection_Array1< Poly_Triangle > & 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.

◆ ~Poly_Triangulation()

Poly_Triangulation::~Poly_Triangulation ( )
override

Destructor.

◆ Poly_Triangulation() [5/5]

Poly_Triangulation::Poly_Triangulation ( const occ::handle< Poly_Triangulation > & theTriangulation)

Copy constructor for triangulation.

Member Function Documentation

◆ AddNormals()

void Poly_Triangulation::AddNormals ( )

If an array for normals is not allocated yet, do it now.

◆ AddUVNodes()

void Poly_Triangulation::AddUVNodes ( )

If an array for UV coordinates is not allocated yet, do it now.

◆ CachedMinMax()

const Bnd_Box & Poly_Triangulation::CachedMinMax ( ) const

Returns cached min - max range of triangulation data, which is VOID by default (e.g, no cached information).

◆ ChangeTriangle()

Poly_Triangle & Poly_Triangulation::ChangeTriangle ( const int theIndex)
inline
Deprecated
("Deprecated method, SetTriangle() should be used instead")

◆ ChangeTriangles()

NCollection_Array1< Poly_Triangle > & Poly_Triangulation::ChangeTriangles ( )
inline
Deprecated
("Deprecated method, SetTriangle() should be used instead")

◆ Clear()

virtual void Poly_Triangulation::Clear ( )
virtual

Clears internal arrays of nodes and all attributes.

◆ computeBoundingBox()

virtual Bnd_Box Poly_Triangulation::computeBoundingBox ( const gp_Trsf & theTrsf) const
protectedvirtual

Calculates bounding box of nodal data.

Parameters
[in]theTrsfoptional transformation.

◆ ComputeNormals()

void Poly_Triangulation::ComputeNormals ( )

Compute smooth normals by averaging triangle normals.

◆ Copy()

virtual occ::handle< Poly_Triangulation > Poly_Triangulation::Copy ( ) const
virtual

Creates full copy of current triangulation.

◆ createNewEntity()

virtual occ::handle< Poly_Triangulation > Poly_Triangulation::createNewEntity ( ) const
inlineprotectedvirtual

Creates new triangulation object (can be inheritor of Poly_Triangulation).

◆ Deflection() [1/2]

double Poly_Triangulation::Deflection ( ) const
inline

Returns the deflection of this triangulation.

◆ Deflection() [2/2]

void Poly_Triangulation::Deflection ( const double theDeflection)
inline

Sets the deflection of this triangulation to theDeflection. See more on deflection in Polygon2D.

◆ DetachedLoadDeferredData()

virtual occ::handle< Poly_Triangulation > Poly_Triangulation::DetachedLoadDeferredData ( const occ::handle< OSD_FileSystem > & theFileSystem = occ::handleOSD_FileSystem >()) const
virtual

Loads triangulation data into new Poly_Triangulation object from some deferred storage using specified shared input file system.

◆ DumpJson()

virtual void Poly_Triangulation::DumpJson ( Standard_OStream & theOStream,
int theDepth = -1 ) const
virtual

Dumps the content of me into the stream.

◆ HasCachedMinMax()

bool Poly_Triangulation::HasCachedMinMax ( ) const
inline

Returns TRUE if there is some cached min - max range of this triangulation.

◆ HasDeferredData()

virtual bool Poly_Triangulation::HasDeferredData ( ) const
inlinevirtual

Returns TRUE if there is some triangulation data that can be loaded using LoadDeferredData().

Reimplemented in RWGltf_GltfLatePrimitiveArray.

◆ HasGeometry()

virtual bool Poly_Triangulation::HasGeometry ( ) const
inlinevirtual

Returns TRUE if triangulation has some geometry.

Reimplemented in RWMesh_TriangulationSource.

◆ HasNormals()

bool Poly_Triangulation::HasNormals ( ) const
inline

Returns true if nodal normals are defined.

◆ HasUVNodes()

bool Poly_Triangulation::HasUVNodes ( ) const
inline

Returns true if 2D nodes are associated with 3D nodes for this triangulation.

◆ InternalNodes()

Poly_ArrayOfNodes & Poly_Triangulation::InternalNodes ( )
inline

Returns an internal array of nodes. Node()/SetNode() should be used instead in portable code.

◆ InternalNormals()

NCollection_Array1< NCollection_Vec3< float > > & Poly_Triangulation::InternalNormals ( )
inline

Return an internal array of normals. Normal()/SetNormal() should be used instead in portable code.

◆ InternalTriangles()

NCollection_Array1< Poly_Triangle > & Poly_Triangulation::InternalTriangles ( )
inline

Returns an internal array of triangles. Triangle()/SetTriangle() should be used instead in portable code.

◆ InternalUVNodes()

Poly_ArrayOfUVNodes & Poly_Triangulation::InternalUVNodes ( )
inline

Returns an internal array of UV nodes. UBNode()/SetUVNode() should be used instead in portable code.

◆ IsDoublePrecision()

bool Poly_Triangulation::IsDoublePrecision ( ) const
inline

Returns TRUE if node positions are defined with double precision; TRUE by default.

◆ loadDeferredData()

virtual bool Poly_Triangulation::loadDeferredData ( const occ::handle< OSD_FileSystem > & theFileSystem,
const occ::handle< Poly_Triangulation > & theDestTriangulation ) const
inlineprotectedvirtual

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

Reimplemented in RWMesh_TriangulationSource.

◆ LoadDeferredData()

virtual bool Poly_Triangulation::LoadDeferredData ( const occ::handle< OSD_FileSystem > & theFileSystem = occ::handleOSD_FileSystem >())
virtual

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

◆ MapNodeArray()

occ::handle< NCollection_HArray1< gp_Pnt > > Poly_Triangulation::MapNodeArray ( ) 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.

◆ MapNormalArray()

occ::handle< NCollection_HArray1< float > > Poly_Triangulation::MapNormalArray ( ) 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.

◆ MapTriangleArray()

occ::handle< NCollection_HArray1< Poly_Triangle > > Poly_Triangulation::MapTriangleArray ( ) 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.

◆ MapUVNodeArray()

occ::handle< NCollection_HArray1< gp_Pnt2d > > Poly_Triangulation::MapUVNodeArray ( ) 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.

◆ MeshPurpose()

Poly_MeshPurpose Poly_Triangulation::MeshPurpose ( ) const
inline

Returns mesh purpose bits.

◆ MinMax()

bool Poly_Triangulation::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:

  • input transformation theTrsf has no rotation part;
  • theIsAccurate is set to FALSE;
  • no triangulation data available (e.g. it is deferred and not loaded).
    Parameters
    [in]
    out] theBox bounding box to extend by this triangulation
    Parameters
    [in]theTrsfoptional transformation
    [in]theIsAccuratewhen FALSE, allows using a cached min - max range of this triangulation even for non-identity transformation.
    Returns
    FALSE if there is no any data to extend the passed box (no both triangulation and cached min - max range).

◆ NbDeferredNodes()

virtual int Poly_Triangulation::NbDeferredNodes ( ) const
inlinevirtual

Returns number of deferred triangles 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.

Reimplemented in RWMesh_TriangulationSource.

◆ NbDeferredTriangles()

virtual int Poly_Triangulation::NbDeferredTriangles ( ) const
inlinevirtual

Returns number of deferred triangles 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.

Reimplemented in RWMesh_TriangulationSource.

◆ NbNodes()

int Poly_Triangulation::NbNodes ( ) const
inline

Returns the number of nodes for this triangulation.

◆ NbTriangles()

int Poly_Triangulation::NbTriangles ( ) const
inline

Returns the number of triangles for this triangulation.

◆ Node()

gp_Pnt Poly_Triangulation::Node ( int theIndex) const
inline

Returns a node at the given index.

Parameters
[in]theIndexnode index within [1, NbNodes()] range
Returns
3D point coordinates

◆ Normal() [1/2]

gp_Dir Poly_Triangulation::Normal ( int theIndex) const
inline

Returns normal at the given index.

Parameters
[in]theIndexnode index within [1, NbNodes()] range
Returns
normalized 3D vector defining a surface normal

◆ Normal() [2/2]

void Poly_Triangulation::Normal ( int theIndex,
NCollection_Vec3< float > & theVec3 ) const
inline

Returns normal at the given index.

Parameters
[in]theIndexnode index within [1, NbNodes()] range
[out]theVec33D vector defining a surface normal

◆ Parameters() [1/2]

const occ::handle< Poly_TriangulationParameters > & Poly_Triangulation::Parameters ( ) const
inline

Returns initial set of parameters used to generate this triangulation.

◆ Parameters() [2/2]

void Poly_Triangulation::Parameters ( const occ::handle< Poly_TriangulationParameters > & theParams)
inline

Updates initial set of parameters used to generate this triangulation.

◆ RemoveNormals()

void Poly_Triangulation::RemoveNormals ( )

Deallocates the normals array.

◆ RemoveUVNodes()

void Poly_Triangulation::RemoveUVNodes ( )

Deallocates the UV nodes array.

◆ ResizeNodes()

void Poly_Triangulation::ResizeNodes ( int theNbNodes,
bool theToCopyOld )

Method resizing internal arrays of nodes (synchronously for all attributes).

Parameters
[in]theNbNodesnew number of nodes
[in]theToCopyOldcopy old nodes into the new array

◆ ResizeTriangles()

void Poly_Triangulation::ResizeTriangles ( int theNbTriangles,
bool theToCopyOld )

Method resizing an internal array of triangles.

Parameters
[in]theNbTrianglesnew number of triangles
[in]theToCopyOldcopy old triangles into the new array

◆ SetCachedMinMax()

void Poly_Triangulation::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.

◆ SetDoublePrecision()

void Poly_Triangulation::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.

◆ SetMeshPurpose()

void Poly_Triangulation::SetMeshPurpose ( const Poly_MeshPurpose thePurpose)
inline

Sets mesh purpose bits.

◆ SetNode()

void Poly_Triangulation::SetNode ( int theIndex,
const gp_Pnt & thePnt )
inline

Sets a node coordinates.

Parameters
[in]theIndexnode index within [1, NbNodes()] range
[in]thePnt3D point coordinates

◆ SetNormal() [1/2]

void Poly_Triangulation::SetNormal ( const int theIndex,
const gp_Dir & theNormal )
inline

Changes normal at the given index.

Parameters
[in]theIndexnode index within [1, NbNodes()] range
[in]theNormalnormalized 3D vector defining a surface normal

◆ SetNormal() [2/2]

void Poly_Triangulation::SetNormal ( const int theIndex,
const NCollection_Vec3< float > & theNormal )
inline

Changes normal at the given index.

Parameters
[in]theIndexnode index within [1, NbNodes()] range
[in]theVec3normalized 3D vector defining a surface normal

◆ SetNormals()

void Poly_Triangulation::SetNormals ( const occ::handle< NCollection_HArray1< float > > & theNormals)
Deprecated
("Deprecated method, SetNormal() should be used instead")

◆ SetTriangle()

void Poly_Triangulation::SetTriangle ( int theIndex,
const Poly_Triangle & theTriangle )
inline

Sets a triangle.

Parameters
[in]theIndextriangle index within [1, NbTriangles()] range
[in]theTriangletriangle node indices, with each node defined within [1, NbNodes()] range

◆ SetUVNode()

void Poly_Triangulation::SetUVNode ( int theIndex,
const gp_Pnt2d & thePnt )
inline

Sets an UV-node coordinates.

Parameters
[in]theIndexnode index within [1, NbNodes()] range
[in]thePntUV coordinates

◆ Triangle()

const Poly_Triangle & Poly_Triangulation::Triangle ( int theIndex) const
inline

Returns triangle at the given index.

Parameters
[in]theIndextriangle index within [1, NbTriangles()] range
Returns
triangle node indices, with each node defined within [1, NbNodes()] range

◆ Triangles()

const NCollection_Array1< Poly_Triangle > & Poly_Triangulation::Triangles ( ) const
inline
Deprecated
("Deprecated method, Triangle() should be used instead")

◆ UnloadDeferredData()

virtual bool Poly_Triangulation::UnloadDeferredData ( )
virtual

Releases triangulation data if it has connected deferred storage.

◆ unsetCachedMinMax()

void Poly_Triangulation::unsetCachedMinMax ( )
protected

Clears cached min - max range saved previously.

◆ UpdateCachedMinMax()

void Poly_Triangulation::UpdateCachedMinMax ( )
inline

Updates cached min - max range of this triangulation with bounding box of nodal data.

◆ UVNode()

gp_Pnt2d Poly_Triangulation::UVNode ( int theIndex) const
inline

Returns UV-node at the given index.

Parameters
[in]theIndexnode index within [1, NbNodes()] range
Returns
2D point defining UV coordinates

Field Documentation

◆ myCachedMinMax

std::atomic<Bnd_Box*> Poly_Triangulation::myCachedMinMax {nullptr}
mutableprotected

Returns number of deferred triangles 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.

◆ myCachedMinMaxMutex

std::shared_mutex Poly_Triangulation::myCachedMinMaxMutex
mutableprotected

Returns number of deferred triangles 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.

◆ myDeflection

double Poly_Triangulation::myDeflection
protected

Returns number of deferred triangles 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.

◆ myNodes

Poly_ArrayOfNodes Poly_Triangulation::myNodes
protected

Returns number of deferred triangles 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.

◆ myNormals

NCollection_Array1<NCollection_Vec3<float> > Poly_Triangulation::myNormals
protected

Returns number of deferred triangles 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.

◆ myParams

occ::handle<Poly_TriangulationParameters> Poly_Triangulation::myParams
protected

Returns number of deferred triangles 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.

◆ myPurpose

Poly_MeshPurpose Poly_Triangulation::myPurpose
protected

Returns number of deferred triangles 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.

◆ myTriangles

NCollection_Array1<Poly_Triangle> Poly_Triangulation::myTriangles
protected

Returns number of deferred triangles 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.

◆ myUVNodes

Poly_ArrayOfUVNodes Poly_Triangulation::myUVNodes
protected

Returns number of deferred triangles 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.


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