CMLTriDelaunay Class Reference

The tri-delaunay mesher fills a parametric surface with triangles using a hybrid advancing-front and constrained-Delaunay algorithm.. More...

#include <CMLTriDelaunay.hpp>

Inheritance diagram for CMLTriDelaunay:

CMLMesher List of all members.

Public Member Functions

Constructor/Destructor
 CMLTriDelaunay (CMLSurfEval *geom_eval, CMLSizeEval *size_eval, CML::OutputMsg msg_level=CML::STANDARD, bool guaranteed_quality=false)
 A class constructor.
virtual ~CMLTriDelaunay ()
 A virtual destructor for the class.
bool set_boundary_mesh (int num_points_in, double *const points, int num_loops, int *const loop_size, int *const loops)
 Supply the surface mesh describing the surface boundary.
Core mesher
bool generate_mesh (int &num_points_out, int &num_tris)
 Generate a triangle mesh for the surface.
Mesh output
bool get_mesh (int num_points_out, double *const points, int &num_tris, int *const tris)
 Retrieve the generated triangle mesh.
int get_points_buf (int buf_size, double *const points, int start_index=0)
 Retrieve the generated points one buffer at a time.
int get_tris_buf (int buf_size, int *const tris, int start_index=0)
 Retrieve the generated triangles one buffer at a time.
Message output control
virtual CML::OutputMsg get_msg_level () const
 Get the value of the message level flag.
virtual void set_msg_level (CML::OutputMsg level)
 Set the value of the message level flag.
virtual void open_log_file (const char *filename, bool append=false)
 Open a log file to record algorithm output.
virtual void close_log_file ()
 Close an open log file.
virtual void set_message_handler (CubitMessageHandler *h)
 Use an alternate output message handler.
virtual void set_progress_handler (CMLProgress *h)
 Use an alternate progress handler.
CAMAL version
virtual int get_major_version () const
 Returns the major version number.
virtual int get_minor_version () const
 Returns the minor version number.
virtual int get_subminor_version () const
 Returns the subminor version (patch) number.
virtual int get_allint_version () const
 Returns version number as one integer.
virtual const char * get_version_string ()
 Returns version number as a string.
Mesher properties
virtual void set_sizing_function (CML::SizingType type, double size1=-1.0, double size2=-1.0)
 Set a sizing function and its parameters.

Detailed Description

The tri-delaunay mesher fills a parametric surface with triangles using a hybrid advancing-front and constrained-Delaunay algorithm..

The surface is defined by a loops of points that are the surface's boundary. The tri-mesher uses parametric information provided by a CMLSurfEval object to mesh exclusively in parameter space. The tri-mesher also uses the sizing information provided by CMLSizeEval to accomplish appropriate sizing of the mesh. Aniostropic, as well as isotropic, meshes my be generated with the appropriate functions defined in the size evaluator,


Constructor & Destructor Documentation

CMLTriDelaunay::CMLTriDelaunay ( CMLSurfEval geom_eval,
CMLSizeEval size_eval,
CML::OutputMsg  msg_level = CML::STANDARD,
bool  guaranteed_quality = false 
)

A class constructor.

Parameters:
geom_eval A pointer to the parametric surface evaluator object that performs uv_from_position, position_from_uv, and distortion_at_uv functions.
size_eval A pointer to the size evaluator object the determines element size at a point.
msg_level An enumerated constant that controls the amount of output. The default value is CML::STANDARD. A value of CML::NONE (zero) causes the tri-advance mesher to suppress all output.
See also:
set_msg_level()
Parameters:
guaranteed_quality If true, use the guaranteed quality criteria for placing interior nodes. The default is to use an advancing-front method for interior node placement.
Note:
This mesher will fail if the surface geometry does not have a u-v parametrization.


Member Function Documentation

virtual void CMLTriDelaunay::close_log_file (  )  [virtual]

Close an open log file.

See also:
open_log_file()

Implements CMLMesher.

bool CMLTriDelaunay::generate_mesh ( int &  num_points_out,
int &  num_tris 
)

Generate a triangle mesh for the surface.

Parameters:
num_points_out The total number of points generated including the input points
num_tris The number of triangles generated
Returns:
true if successful, false otherwise
Note:
These two output values are useful for dynamically allocating the memory necessary to retrieve the triangle mesh with get_mesh().

bool CMLTriDelaunay::get_mesh ( int  num_points_out,
double *const   points,
int &  num_tris,
int *const   tris 
)

Retrieve the generated triangle mesh.

Parameters:
num_points_out The number of points to retrieve. This should be the same number returned by generate_mesh().
points An array of points in the generated mesh (array size = 3 * num_points_out.)
The first three array values are the x, y and z coordinates of the first point. The next three are for the second point, then the third, etc.
num_tris The number of triangles to retrieve. This should be the same number returned by generate_mesh().
tris An array defining the connectivity of the generated mesh (array size = 3 * num_tris.)
The first three array values are the indices to the points array of the first triangle's corner points. The second three describes the second triangle, then the third, etc. The three indices of a triangle are entered in a counter-clockwise direction around the face when viewed from a positive distance along the surface normal through the triangle. Indices range from 0 to num_points_out - 1 since the points array is zero-based.
Returns:
true if successful, false otherwise

virtual CML::OutputMsg CMLTriDelaunay::get_msg_level (  )  const [virtual]

Get the value of the message level flag.

Returns:
The current message level flag.
See also:
set_msg_level()

Implements CMLMesher.

int CMLTriDelaunay::get_points_buf ( int  buf_size,
double *const   points,
int  start_index = 0 
)

Retrieve the generated points one buffer at a time.

Parameters:
buf_size The length of the points array.
points The output buffer for points. A maximum of buf_size/3 points will be copied to this buffer.
start_index The index of the first output point.
Returns:
The number of points returned in points buffer. Returns zero if start_index is greater than the number of points in the array.
Note:
To return all points, begin with start_index = 0 and increment it by the return value until the return value is zero.

int CMLTriDelaunay::get_tris_buf ( int  buf_size,
int *const   tris,
int  start_index = 0 
)

Retrieve the generated triangles one buffer at a time.

Parameters:
buf_size The length of the tris buffer array
tris The output buffer for triangles. A maximum of buf_size/3 triangles will be copied to this buffer.
start_index The index of the first out triangle.
Returns:
The number of triangles returned in tris buffer. Returns zero if start_index is greater than the number of triangles in the array.
Note:
To return all triangles, begin with start_index = 0 and increment it by the return value until the return value is zero.

virtual void CMLTriDelaunay::open_log_file ( const char *  filename,
bool  append = false 
) [virtual]

Open a log file to record algorithm output.

Parameters:
filename The log file name
append Appends to the file filename if it exists
See also:
close_log_file()

Implements CMLMesher.

bool CMLTriDelaunay::set_boundary_mesh ( int  num_points_in,
double *const   points,
int  num_loops,
int *const   loop_size,
int *const   loops 
)

Supply the surface mesh describing the surface boundary.

Parameters:
num_points_in The number of points in the boundary mesh plus any optional free interior (hard) points.
points An array of points (array size = 3 * num_points_in.)
The first three array values are the x, y and z coordinates of the first point. The next three are for the second point, then the third, etc. Interior hard points are treated the same as boundary points.
num_loops The number of loops that describe the boundary of the surface.
loop_size The number of unique point ids in each loop in loops. (array size = num_loops)
loops connectivity of boundary mesh (array size = sum of values in loop_sizes)
Returns:
true if successful, false otherwise.

virtual void CMLTriDelaunay::set_message_handler ( CubitMessageHandler *  h  )  [virtual]

Use an alternate output message handler.

Parameters:
h A pointer to a message handler derived from CubitMessageHandler.

Implements CMLMesher.

virtual void CMLTriDelaunay::set_msg_level ( CML::OutputMsg  level  )  [virtual]

Set the value of the message level flag.

Parameters:
level The value of the message level is an enumerated constant. The default value is CML::STANDARD and generates minimal output. A value of CML::VERBOSE generates more output, and a value of CML::DEBUG generates output helpful to developers. A value of CML::NONE causes the mesher to suppress all output.
See also:
get_msg_level()

Implements CMLMesher.

virtual void CMLTriDelaunay::set_progress_handler ( CMLProgress *  h  )  [virtual]

Use an alternate progress handler.

Parameters:
h A pointer to a progress hander derived from CMLProgress.

Implements CMLMesher.

virtual void CMLTriDelaunay::set_sizing_function ( CML::SizingType  type,
double  size1 = -1.0,
double  size2 = -1.0 
) [virtual]

Set a sizing function and its parameters.

Parameters:
type The enum of sizing function for the triangle mesher or paver.
size1 The constant size for CONSTANT_SIZING function and the minimum size for all others.
size2 The maximum size for all sizing functions.

Implements CMLMesher.


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

CAMAL 5.2-0 documentation created on 1 Jun 2010
Comments to csimsoft.com