|
Purpose:
|
Shows an example of a mesh manager.
|
|
|
Derivation:
|
GLOBAL_MESH_MANAGER : MESH_MANAGER : ACIS_OBJECT : -
|
|
|
Filename:
|
fct/faceter/meshmgr/gmeshmg.hxx
|
|
|
Description:
|
The
GLOBAL_MESH_MANAGER class is an example of a mesh manager using the global indexed protocol. The mesh is written to the standard output. Because there are no graphics or permanent storage services, the entire mesh manager functionality resides compactly in a single file.
|
|
|
This example demonstrates the virtual member functions of
MESH_MANAGER that need to be redefined for this protocol.
|
|
|
Constructor:
|
public: GLOBAL_MESH_MANAGER::GLOBAL_MESH_MANAGER
();
|
|
|
C++ constructor, creating a
GLOBAL_MESH_MANAGER.
|
|
|
|
|
Methods:
|
public: virtual void
|
|
|
GLOBAL_MESH_MANAGER::announce_counts (
|
|
|
int npoly,
|
// number of polygons
|
|
|
int nnode,
|
// number of nodes
|
|
|
int npolynode
|
// number of node
|
|
|
|
|
// references
|
|
|
);
|
|
|
Announces the number of polygons, nodes, and node references by polygons, and prints them.
|
|
|
|
|
|
|
public: virtual void*
|
|
|
GLOBAL_MESH_MANAGER::announce_global_node (
|
|
|
int inode,
|
// node index
|
|
|
EDGE*,
|
// edge
|
|
|
const SPAposition& X,
|
// node coordinates
|
|
|
double t
|
// curve parameter
|
|
|
);
|
|
|
Announces a node on a model
EDGE with its curve parameter, and prints it.
|
|
|
|
|
|
|
public: virtual void*
|
|
|
GLOBAL_MESH_MANAGER::announce_global_node (
|
|
|
int inode,
|
// 0-based index of node
|
|
|
FACE*,
|
// face
|
|
|
const SPAposition& X,
|
// node coordinates
|
|
|
const SPApar_pos& uv
|
// surface parameter
|
|
|
);
|
|
|
Announces a node on a model
FACE with its surface parameters, and prints it.
|
|
|
|
|
|
|
public: virtual void*
|
|
|
GLOBAL_MESH_MANAGER::announce_global_node (
|
|
|
int inode,
|
// node index
|
|
|
VERTEX*,
|
// vertex
|
|
|
const SPAposition& X
|
// node coordinates
|
|
|
);
|
|
|
Announces a node on a model
VERTEX, and prints it.
|
|
|
|
|
|
|
public: virtual void
|
|
|
GLOBAL_MESH_MANAGER::announce_indexed_polynode (
|
|
|
ENTITY*,
|
// entity
|
|
|
int,
|
// integer
|
|
|
int,
|
// integer
|
|
|
void*
|
// void
|
|
|
);
|
|
|
Gets a polynode of a polygon and prints the identification.
|
|
|
|
|
|
|
public: virtual void
|
|
|
GLOBAL_MESH_MANAGER::announce_indexed_polynode (
|
|
|
ENTITY*,
|
// coedge along node to
|
|
|
|
|
// next node
|
|
|
int,
|
// polygon index
|
|
|
int,
|
// local node index
|
|
|
void*,
|
// node identifier
|
|
|
const double&,
|
// if the node lies on an
|
|
|
|
|
// edge then returns tpar
|
|
|
const SPApar_pos&,
|
// parametric coordinates
|
|
|
const SPAposition&,
|
// Cartesian coordinates
|
|
|
const SPAunit_vector&
|
// surface normal
|
|
|
);
|
|
|
Gets a polynode of a polygon and prints the identification.
|
|
|
|
|
|
|
public: virtual void
|
|
|
GLOBAL_MESH_MANAGER::announce_indexed_polynode (
|
|
|
int ipoly,
|
|
// polygon index
|
|
|
int i,
|
|
// counter in polygon
|
|
|
void* id
|
|
// node ID
|
|
|
);
|
|
|
Gets a polynode of a polygon and prints the identification. The polygon index and counter are zero-based. The counter increments sequentially on successive calls. The node identifier is as previously received from
announce_indexed_node.
|
|
|
|
|
|
|
public: virtual void
|
|
|
GLOBAL_MESH_MANAGER::end_indexed_polygon (
|
|
|
int ipoly
|
// polygon index
|
|
|
);
|
|
|
The indexed polygon is complete. Prints a new line.
|
|
|
|
|
|
|
public: virtual logical GLOBAL_MESH_MANAGER::
|
|
|
need_global_indexed_polygons ();
|
|
|
Tells faceter that globally indexed polygon output is needed.
|
|
|
|
|
|
|
public: virtual logical GLOBAL_MESH_MANAGER::
|
|
|
need_precount_of_global_indexed_polygons ();
|
|
|
If this function returns
TRUE, the number of polygons, nodes, and node references by polygons are announced before other output. The default returns
FALSE.
|
|
|
|
|
|
|
public: virtual void*
|
|
|
GLOBAL_MESH_MANAGER::null_node_id ();
|
|
|
Returns the node id value that is guaranteed to be invalid. Applications using indices will typically return -1. Applications using pointers will typically return 0. The default returns -1.
|
|
|
|
|
|
|
public: virtual void
|
|
|
GLOBAL_MESH_MANAGER::start_indexed_polygon (
|
|
|
int ipoly,
|
// polygon index
|
|
|
int npolynode,
|
// number of nodes
|
|
|
int ishare
|
// info about which edge
|
|
|
|
= -2
|
// of previous polygon is
|
|
|
|
|
// is shared with this
|
|
|
|
|
// one
|
|
|
);
|
|
|
A new polygon starts and prints the polygon header.
|