Open CASCADE Technology  6.9.0
Data Structures | Public Member Functions | Protected Attributes

Poly_CoherentTriangulation Class Reference

#include <Poly_CoherentTriangulation.hxx>

Inheritance diagram for Poly_CoherentTriangulation:
Inheritance graph

Data Structures

class  IteratorOfLink
class  IteratorOfNode
class  IteratorOfTriangle
struct  TwoIntegers
 Couple of integer indices (used in RemoveDegenerated()). More...

Public Member Functions

 Poly_CoherentTriangulation (const Handle< NCollection_BaseAllocator > &theAlloc=0L)
 Poly_CoherentTriangulation (const Handle< Poly_Triangulation > &theTriangulation, const Handle< NCollection_BaseAllocator > &theAlloc=0L)
virtual ~Poly_CoherentTriangulation ()
Handle< Poly_TriangulationGetTriangulation () const
Standard_Boolean RemoveDegenerated (const Standard_Real theTol, NCollection_List< TwoIntegers > *pLstRemovedNode=0L)
Standard_Boolean GetFreeNodes (NCollection_List< Standard_Integer > &lstNodes) const
Standard_Integer MaxNode () const
Standard_Integer MaxTriangle () const
void SetDeflection (const Standard_Real theDefl)
Standard_Real Deflection () const
Standard_Integer SetNode (const gp_XYZ &thePnt, const Standard_Integer iN=-1)
const Poly_CoherentNodeNode (const Standard_Integer i) const
Poly_CoherentNodeChangeNode (const Standard_Integer i)
Standard_Integer NNodes () const
const Poly_CoherentTriangleTriangle (const Standard_Integer i) const
Standard_Integer NTriangles () const
Standard_Integer NLinks () const
Standard_Boolean RemoveTriangle (Poly_CoherentTriangle &theTr)
void RemoveLink (Poly_CoherentLink &theLink)
Poly_CoherentTriangleAddTriangle (const Standard_Integer iNode0, const Standard_Integer iNode1, const Standard_Integer iNode2)
Standard_Boolean ReplaceNodes (Poly_CoherentTriangle &theTriangle, const Standard_Integer iNode0, const Standard_Integer iNode1, const Standard_Integer iNode2)
Poly_CoherentLinkAddLink (const Poly_CoherentTriangle &theTri, const Standard_Integer theConn)
Standard_Boolean FindTriangle (const Poly_CoherentLink &theLink, const Poly_CoherentTriangle *pTri[2]) const
Standard_Integer ComputeLinks ()
void ClearLinks ()
const Handle
< NCollection_BaseAllocator > & 
Allocator () const
< Poly_CoherentTriangulation
Clone (const Handle< NCollection_BaseAllocator > &theAlloc) const
void Dump (Standard_OStream &) const
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
virtual void Delete () const
 Memory deallocator for transient classes. More...
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
Standard_Boolean IsKind (const 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. More...
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. More...
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...

Protected Attributes

< Poly_CoherentTriangle
< Poly_CoherentNode
< Poly_CoherentLink
Handle< NCollection_BaseAllocatormyAlloc
Standard_Real myDeflection

Detailed Description

Triangulation structure that allows to:

This class is useful for algorithms that need to analyse and/or edit a triangulated mesh – for example for mesh refining. The connectivity model follows the idea that all Triangles in a mesh should have coherent orientation like on a surface of a solid body. Connections between more than 2 triangles are not suppoorted.

<> Architecture

The data types used in this structure are:

Constructor & Destructor Documentation

Poly_CoherentTriangulation::Poly_CoherentTriangulation ( const Handle< NCollection_BaseAllocator > &  theAlloc = 0L)

Empty constructor.

Poly_CoherentTriangulation::Poly_CoherentTriangulation ( const Handle< Poly_Triangulation > &  theTriangulation,
const Handle< NCollection_BaseAllocator > &  theAlloc = 0L 

Constructor. It does not create Links, you should call ComputeLinks following this constructor if you need these links.

virtual Poly_CoherentTriangulation::~Poly_CoherentTriangulation ( )


Member Function Documentation

Poly_CoherentLink* Poly_CoherentTriangulation::AddLink ( const Poly_CoherentTriangle theTri,
const Standard_Integer  theConn 

Add a single link to triangulation, based on a triangle and its side index. This method does not check for coincidence with already present links.

theTriTriangle that contains the link to be added.
theConnIndex of the side (i.e., 0, 1 0r 2) defining the added link.
Poly_CoherentTriangle* Poly_CoherentTriangulation::AddTriangle ( const Standard_Integer  iNode0,
const Standard_Integer  iNode1,
const Standard_Integer  iNode2 

Add a triangle to the triangulation.

Pointer to the added triangle instance or NULL if an error occurred.
const Handle< NCollection_BaseAllocator >& Poly_CoherentTriangulation::Allocator ( ) const

Query the allocator of elements, this allocator can be used for other objects

Poly_CoherentNode& Poly_CoherentTriangulation::ChangeNode ( const Standard_Integer  i)

Get the node at the given index 'i'.

void Poly_CoherentTriangulation::ClearLinks ( )

Clear all Links data from the Triangulation data.

Handle< Poly_CoherentTriangulation > Poly_CoherentTriangulation::Clone ( const Handle< NCollection_BaseAllocator > &  theAlloc) const

Create a copy of this Triangulation, using the given allocator.

Standard_Integer Poly_CoherentTriangulation::ComputeLinks ( )

(Re)Calculate all links in this Triangulation.

Standard_Real Poly_CoherentTriangulation::Deflection ( ) const

Query the Deflection parameter (default value 0. – if never initialized)

void Poly_CoherentTriangulation::Dump ( Standard_OStream ) const

Debugging output.

Standard_Boolean Poly_CoherentTriangulation::FindTriangle ( const Poly_CoherentLink theLink,
const Poly_CoherentTriangle pTri[2] 
) const

Find one or two triangles that share the given couple of nodes.

theLinkLink (in fact, just a couple of nodes) on which the triangle is searched.
pTri[out] Array of two pointers to triangle. pTri[0] stores the triangle to the left of the link, while pTri[1] stores the one to the right of the link.
True if at least one triangle is found and output as pTri.
Standard_Boolean Poly_CoherentTriangulation::GetFreeNodes ( NCollection_List< Standard_Integer > &  lstNodes) const

Create a list of free nodes. These nodes may appear as a result of any custom mesh decimation or RemoveDegenerated() call. This analysis is necessary if you support additional data structures based on the triangulation (e.g., edges on the surface boundary).

lstNodes[out] List that receives the indices of free nodes.
Handle< Poly_Triangulation > Poly_CoherentTriangulation::GetTriangulation ( ) const

Create an instance of Poly_Triangulation from this object.

Standard_Integer Poly_CoherentTriangulation::MaxNode ( ) const

Query the index of the last node in the triangulation

Standard_Integer Poly_CoherentTriangulation::MaxTriangle ( ) const

Query the index of the last triangle in the triangulation

Standard_Integer Poly_CoherentTriangulation::NLinks ( ) const

Query the total number of active Links.

Standard_Integer Poly_CoherentTriangulation::NNodes ( ) const

Query the total number of active nodes (i.e. nodes used by 1 or more triangles)

const Poly_CoherentNode& Poly_CoherentTriangulation::Node ( const Standard_Integer  i) const

Get the node at the given index 'i'.

Standard_Integer Poly_CoherentTriangulation::NTriangles ( ) const

Query the total number of active triangles (i.e. triangles that refer nodes, non-empty ones)

Standard_Boolean Poly_CoherentTriangulation::RemoveDegenerated ( const Standard_Real  theTol,
NCollection_List< TwoIntegers > *  pLstRemovedNode = 0L 

Find and remove degenerated triangles in Triangulation.

theTolTolerance for the degeneration case. If any two nodes of a triangle have the distance less than this tolerance, this triangle is considered degenerated and therefore removed by this method.
pLstRemovedNodeOptional parameter. If defined, then it will receive the list of arrays where the first number is the index of removed node and the seond - the index of remaining node to which the mesh was reconnected.
void Poly_CoherentTriangulation::RemoveLink ( Poly_CoherentLink theLink)

Removal of a single link from the triangulation.

Standard_Boolean Poly_CoherentTriangulation::RemoveTriangle ( Poly_CoherentTriangle theTr)

Removal of a single triangle from the triangulation.

Standard_Boolean Poly_CoherentTriangulation::ReplaceNodes ( Poly_CoherentTriangle theTriangle,
const Standard_Integer  iNode0,
const Standard_Integer  iNode1,
const Standard_Integer  iNode2 

Replace nodes in the given triangle.

True if operation succeeded.
void Poly_CoherentTriangulation::SetDeflection ( const Standard_Real  theDefl)

Set the Deflection value as the parameter of the given triangulation.

Standard_Integer Poly_CoherentTriangulation::SetNode ( const gp_XYZ thePnt,
const Standard_Integer  iN = -1 

Initialize a node

thePoint3D Coordinates of the node.
iNIndex of the node. If negative (default), the node is added to the end of the current array of nodes.
Index of the added node.
const Poly_CoherentTriangle& Poly_CoherentTriangulation::Triangle ( const Standard_Integer  i) const

Get the triangle at the given index 'i'.

Field Documentation

Handle< NCollection_BaseAllocator > Poly_CoherentTriangulation::myAlloc
Standard_Real Poly_CoherentTriangulation::myDeflection
NCollection_Vector<Poly_CoherentLink> Poly_CoherentTriangulation::myLinks
NCollection_Vector<Poly_CoherentNode> Poly_CoherentTriangulation::myNodes
NCollection_Vector<Poly_CoherentTriangle> Poly_CoherentTriangulation::myTriangles

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