OCC Main Page | FoundationClasses | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FoundationClasses
TKMath
Poly


Poly_Connect Class Reference

Provides an algorithm to explore, inside a triangulation, the
adjacency data for a node or a triangle.
Adjacency data for a node consists of triangles which
contain the node.
Adjacency data for a triangle consists of:
- the 3 adjacent triangles which share an edge of the triangle,
- and the 3 nodes which are the other nodes of these adjacent triangles.
Example
Inside a triangulation, a triangle T
has nodes n1, n2 and n3.
It has adjacent triangles AT1, AT2 and AT3 where:
- AT1 shares the nodes n2 and n3,
- AT2 shares the nodes n3 and n1,
- AT3 shares the nodes n1 and n2.
It has adjacent nodes an1, an2 and an3 where:
- an1 is the third node of AT1,
- an2 is the third node of AT2,
- an3 is the third node of AT3.
So triangle AT1 is composed of nodes n2, n3 and an1.
There are two ways of using this algorithm.
- From a given node you can look for one triangle that
passes through the node, then look for the triangles
adjacent to this triangle, then the adjacent nodes. You
can thus explore the triangulation step by step (functions
Triangle, Triangles and Nodes).
- From a given node you can look for all the triangles
that pass through the node (iteration method, using the
functions Initialize, More, Next and Value).
A Connect object can be seen as a tool which analyzes a
triangulation and translates it into a series of triangles. By
doing this, it provides an interface with other tools and
applications working on basic triangles, and which do not
work directly with a Poly_Triangulation.
.

#include <Poly_Connect.hxx>


Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT Poly_Connect (const Handle(Poly_Triangulation)&T)
 Constructs an algorithm to explore the adjacency data of
nodes or triangles for the triangulation T.
.
Handle_Poly_Triangulation Triangulation () const
 Returns the triangulation analyzed by this tool.
.
Standard_Integer Triangle (const Standard_Integer N) const
 Returns the index of a triangle containing the node at
index N in the nodes table specific to the triangulation analyzed by this tool
.
Standard_EXPORT void Triangles (const Standard_Integer T, Standard_Integer &t1, Standard_Integer &t2, Standard_Integer &t3) const
 Returns in t1, t2 and t3, the indices of the 3 triangles
adjacent to the triangle at index T in the triangles table
specific to the triangulation analyzed by this tool.
Warning
Null indices are returned when there are fewer than 3
adjacent triangles.
.
Standard_EXPORT void Nodes (const Standard_Integer T, Standard_Integer &n1, Standard_Integer &n2, Standard_Integer &n3) const
 Returns, in n1, n2 and n3, the indices of the 3 nodes
adjacent to the triangle referenced at index T in the
triangles table specific to the triangulation analyzed by this tool.
Warning
Null indices are returned when there are fewer than 3 adjacent nodes.
.
Standard_EXPORT void Initialize (const Standard_Integer N)
 Initializes an iterator to search for all the triangles
containing the node referenced at index N in the nodes
table, for the triangulation analyzed by this tool.
The iterator is managed by the following functions:
- More, which checks if there are still elements in the iterator
- Next, which positions the iterator on the next element
- Value, which returns the current element.
The use of such an iterator provides direct access to the
triangles around a particular node, i.e. it avoids iterating on
all the component triangles of a triangulation.
Example
Poly_Connect C(Tr);
for
(C.Initialize(n1);C.More();C.Next())
{
t = C.Value();
}
.
Standard_Boolean More () const
 Returns true if there is another element in the iterator
defined with the function Initialize (i.e. if there is another
triangle containing the given node).
.
Standard_EXPORT void Next ()
 Advances the iterator defined with the function Initialize to
access the next triangle.
Note: There is no action if the iterator is empty (i.e. if the
function More returns false).-
.
Standard_EXPORT Standard_Integer Value () const
 Returns the index of the current triangle to which the
iterator, defined with the function Initialize, points. This is
an index in the triangles table specific to the triangulation
analyzed by this tool
.

Private Attributes

Handle_Poly_Triangulation myTriangulation
TColStd_Array1OfInteger myTriangles
TColStd_Array1OfInteger myAdjacents
Standard_Integer mytr
Standard_Integer myfirst
Standard_Integer mynode
Standard_Integer myothernode
Standard_Boolean mysense
Standard_Boolean mymore


Constructor & Destructor Documentation

Standard_EXPORT Poly_Connect::Poly_Connect const Handle(Poly_Triangulation)&  T  ) 
 


Member Function Documentation

Standard_EXPORT void Poly_Connect::Initialize const Standard_Integer  N  ) 
 

Standard_Boolean Poly_Connect::More  )  const [inline]
 

Standard_EXPORT void Poly_Connect::Next  ) 
 

Standard_EXPORT void Poly_Connect::Nodes const Standard_Integer  T,
Standard_Integer n1,
Standard_Integer n2,
Standard_Integer n3
const
 

void Poly_Connect::operator delete void *  anAddress  )  [inline]
 

void* Poly_Connect::operator new size_t  size  )  [inline]
 

void* Poly_Connect::operator new size_t  ,
void *  anAddress
[inline]
 

Standard_Integer Poly_Connect::Triangle const Standard_Integer  N  )  const [inline]
 

Standard_EXPORT void Poly_Connect::Triangles const Standard_Integer  T,
Standard_Integer t1,
Standard_Integer t2,
Standard_Integer t3
const
 

Handle_Poly_Triangulation Poly_Connect::Triangulation  )  const
 

Standard_EXPORT Standard_Integer Poly_Connect::Value  )  const
 


Field Documentation

TColStd_Array1OfInteger Poly_Connect::myAdjacents [private]
 

Standard_Integer Poly_Connect::myfirst [private]
 

Standard_Boolean Poly_Connect::mymore [private]
 

Standard_Integer Poly_Connect::mynode [private]
 

Standard_Integer Poly_Connect::myothernode [private]
 

Standard_Boolean Poly_Connect::mysense [private]
 

Standard_Integer Poly_Connect::mytr [private]
 

TColStd_Array1OfInteger Poly_Connect::myTriangles [private]
 

Handle_Poly_Triangulation Poly_Connect::myTriangulation [private]
 


The documentation for this class was generated from the following files:
Generated on Mon Aug 25 13:13:13 2008 for OpenCASCADE by  doxygen 1.4.1