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

FoundationClasses
TKMath
Poly


Poly_Triangulation Class Reference

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:
- A table of 3D nodes (3D points on the surface).
- A table of triangles. Each triangle (Poly_Triangle
object) comprises a triplet of indices in the table of 3D
nodes specific to the triangulation.
- A table of 2D nodes (2D points), parallel to the table of
3D nodes. This table is optional. If it exists, the
coordinates of a 2D point are the (u, v) parameters
of the corresponding 3D point on the surface
approximated by the triangulation.
- A deflection (optional), which maximizes the distance
from a point on the surface to the corresponding point
on its approximate triangulation.
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.
.

#include <Poly_Triangulation.hxx>

Inheritance diagram for Poly_Triangulation:

Inheritance graph
[legend]

Public Member Functions

Standard_EXPORT Poly_Triangulation (const Standard_Integer nbNodes, const Standard_Integer nbTriangles, const Standard_Boolean UVNodes)
 Constructs a triangulation from a set of triangles. The
triangulation is initialized without a triangle or a node, but capable of
containing nbNodes nodes, and nbTriangles
triangles. Here the UVNodes flag indicates whether
2D nodes will be associated with 3D ones, (i.e. to
enable a 2D representation).
.
Standard_EXPORT 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.
.
Standard_EXPORT 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.
.
Standard_EXPORT Standard_Real Deflection () const
 Returns the deflection of this triangulation.
.
Standard_EXPORT void Deflection (const Standard_Real D)
 Sets the deflection of this triangulation to D.
See more on deflection in Polygon2D
.
Standard_EXPORT void RemoveUVNodes ()
 Deallocates the UV nodes.
.
Standard_Integer NbNodes () const
 Returns the number of nodes for this triangulation.
Null if the nodes are not yet defined.
.
Standard_Integer NbTriangles () const
 Returns the number of triangles for this triangulation.
Null if the Triangles are not yet defined.
.
Standard_Boolean HasUVNodes () const
 Returns true if 2D nodes are associated with 3D nodes for
this triangulation.
.
Standard_EXPORT const TColgp_Array1OfPntNodes () const
 Returns the table of 3D nodes (3D points) for this triangulation.
.
Standard_EXPORT TColgp_Array1OfPntChangeNodes ()
 Returns the table of 3D nodes (3D points) for this triangulation.
The returned array is
shared. Therefore if the table is selected by reference, you
can, by simply modifying it, directly modify the data
structure of this triangulation.
.
Standard_EXPORT const TColgp_Array1OfPnt2dUVNodes () const
 Returns the table of 2D nodes (2D points) associated with
each 3D node of this triangulation.
The function HasUVNodes checks if 2D nodes
are associated with the 3D nodes of this triangulation.
Const reference on the 2d nodes values.
.
Standard_EXPORT TColgp_Array1OfPnt2dChangeUVNodes ()
 Returns the table of 2D nodes (2D points) associated with
each 3D node of this triangulation.
Function ChangeUVNodes shares the returned array.
Therefore if the table is selected by reference,
you can, by simply modifying it, directly modify the data
structure of this triangulation.
.
Standard_EXPORT const Poly_Array1OfTriangleTriangles () const
 Returns the table of triangles for this triangulation.
.
Standard_EXPORT Poly_Array1OfTriangleChangeTriangles ()
 Returns the table of triangles for this triangulation.
Function ChangeUVNodes shares the returned array.
Therefore if the table is selected by reference,
you can, by simply modifying it, directly modify the data
structure of this triangulation.
.
Standard_EXPORT void SetNormals (const Handle(TShort_HArray1OfShortReal)&theNormals)
 Sets the table of node normals.
raises exception if length of theNormals != 3*NbNodes
.
Standard_EXPORT const TShort_Array1OfShortRealNormals () const
Standard_EXPORT TShort_Array1OfShortRealChangeNormals ()
Standard_EXPORT Standard_Boolean HasNormals () const
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Private Attributes

Standard_Real myDeflection
Standard_Integer myNbNodes
Standard_Integer myNbTriangles
TColgp_Array1OfPnt myNodes
Handle_TColgp_HArray1OfPnt2d myUVNodes
Poly_Array1OfTriangle myTriangles
Handle_TShort_HArray1OfShortReal myNormals

Constructor & Destructor Documentation

Standard_EXPORT Poly_Triangulation::Poly_Triangulation const Standard_Integer  nbNodes,
const Standard_Integer  nbTriangles,
const Standard_Boolean  UVNodes
 

Standard_EXPORT Poly_Triangulation::Poly_Triangulation const TColgp_Array1OfPnt Nodes,
const Poly_Array1OfTriangle Triangles
 

Standard_EXPORT Poly_Triangulation::Poly_Triangulation const TColgp_Array1OfPnt Nodes,
const TColgp_Array1OfPnt2d UVNodes,
const Poly_Array1OfTriangle Triangles
 


Member Function Documentation

Standard_EXPORT TColgp_Array1OfPnt& Poly_Triangulation::ChangeNodes  ) 
 

Standard_EXPORT TShort_Array1OfShortReal& Poly_Triangulation::ChangeNormals  ) 
 

Standard_EXPORT Poly_Array1OfTriangle& Poly_Triangulation::ChangeTriangles  ) 
 

Standard_EXPORT TColgp_Array1OfPnt2d& Poly_Triangulation::ChangeUVNodes  ) 
 

Standard_EXPORT void Poly_Triangulation::Deflection const Standard_Real  D  ) 
 

Standard_EXPORT Standard_Real Poly_Triangulation::Deflection  )  const
 

Standard_EXPORT const Poly_Triangulation::Handle Standard_Type   )  const
 

Reimplemented from MMgt_TShared.

Standard_EXPORT Standard_Boolean Poly_Triangulation::HasNormals  )  const
 

Standard_Boolean Poly_Triangulation::HasUVNodes  )  const [inline]
 

Standard_Integer Poly_Triangulation::NbNodes  )  const [inline]
 

Standard_Integer Poly_Triangulation::NbTriangles  )  const [inline]
 

Standard_EXPORT const TColgp_Array1OfPnt& Poly_Triangulation::Nodes  )  const
 

Standard_EXPORT const TShort_Array1OfShortReal& Poly_Triangulation::Normals  )  const
 

Standard_EXPORT void Poly_Triangulation::RemoveUVNodes  ) 
 

Standard_EXPORT void Poly_Triangulation::SetNormals const Handle(TShort_HArray1OfShortReal)&  theNormals  ) 
 

Standard_EXPORT const Poly_Array1OfTriangle& Poly_Triangulation::Triangles  )  const
 

Standard_EXPORT const TColgp_Array1OfPnt2d& Poly_Triangulation::UVNodes  )  const
 


Field Documentation

Standard_Real Poly_Triangulation::myDeflection [private]
 

Standard_Integer Poly_Triangulation::myNbNodes [private]
 

Standard_Integer Poly_Triangulation::myNbTriangles [private]
 

TColgp_Array1OfPnt Poly_Triangulation::myNodes [private]
 

Handle_TShort_HArray1OfShortReal Poly_Triangulation::myNormals [private]
 

Poly_Array1OfTriangle Poly_Triangulation::myTriangles [private]
 

Handle_TColgp_HArray1OfPnt2d Poly_Triangulation::myUVNodes [private]
 


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