Woolz Image Processing  Version 1.7.5
WlzMeshGen.c File Reference

Functions for 2D and 3D conforming simplical mesh generation. Meshes generated by these functions will conform approximately to an objects boundaries. More...

Macros

#define WLZ_FAST_CODE
 

Typedefs

typedef enum _WlzCMeshConformAction WlzCMeshConformAction
 

Enumerations

enum  _WlzCMeshConformAction {
  WLZ_CMESH_CONFORM_NONE,
  WLZ_CMESH_CONFORM_DELETE,
  WLZ_CMESH_CONFORM_MODIFY
}
 Possible mesh element conformation actions. Typedef: WlzCMeshConformAction. More...
 

Functions

WlzCMesh2DWlzCMeshNew2D (WlzErrorNum *dstErr)
 Creates a new 2D mesh data structure with the resources optimized for the given number of mesh elements and nodes. It is better to under estimate the number of elements and nodes rather than over estimate and if zero is given some reasonable defaults will be used. More...
 
WlzCMesh2D5WlzCMeshNew2D5 (WlzErrorNum *dstErr)
 Creates a new 2D5 mesh data structure with the resources optimized for the given number of mesh elements and nodes. It is better to under estimate the number of elements and nodes rather than over estimate and if zero is given some reasonable defaults will be used. More...
 
WlzCMesh3DWlzCMeshNew3D (WlzErrorNum *dstErr)
 Creates a new 3D mesh data structure with the resources optimized for the given number of mesh elements and nodes. It is better to under estimate the number of elements and nodes rather than over estimate and if zero is given some reasonable defaults will be used. More...
 
WlzErrorNum WlzCMeshAddNewNodCb2D (WlzCMesh2D *mesh, WlzCMeshCbFn fn, void *data)
 Adds a new 2D node callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddNewNodCb2D5 (WlzCMesh2D5 *mesh, WlzCMeshCbFn fn, void *data)
 Adds a new 2D5 node callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddNewNodCb3D (WlzCMesh3D *mesh, WlzCMeshCbFn fn, void *data)
 Adds a new 3D node callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddNewElmCb2D (WlzCMesh2D *mesh, WlzCMeshCbFn fn, void *data)
 Adds a new 2D element callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddNewElmCb2D5 (WlzCMesh2D5 *mesh, WlzCMeshCbFn fn, void *data)
 Adds a new 2D5 element callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddNewElmCb3D (WlzCMesh3D *mesh, WlzCMeshCbFn fn, void *data)
 Adds a new 3D element callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddDelNodCb2D (WlzCMesh2D *mesh, WlzCMeshCbFn fn, void *data)
 Adds a 2D deleted node callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddDelNodCb2D5 (WlzCMesh2D5 *mesh, WlzCMeshCbFn fn, void *data)
 Adds a 2D5 deleted node callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddDelNodCb3D (WlzCMesh3D *mesh, WlzCMeshCbFn fn, void *data)
 Adds a 3D deleted node callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddDelElmCb2D (WlzCMesh2D *mesh, WlzCMeshCbFn fn, void *data)
 Adds a 2D deleted element callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddDelElmCb2D5 (WlzCMesh2D5 *mesh, WlzCMeshCbFn fn, void *data)
 Adds a 2D5 deleted element callback to the mesh. More...
 
WlzErrorNum WlzCMeshAddDelElmCb3D (WlzCMesh3D *mesh, WlzCMeshCbFn fn, void *data)
 Adds a 3D deleted element callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemNewNodCb2D (WlzCMesh2D *mesh, WlzCMeshCbFn fn, void *data)
 Removes a new 2D node callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemNewNodCb2D5 (WlzCMesh2D5 *mesh, WlzCMeshCbFn fn, void *data)
 Removes a new 2D5 node callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemNewNodCb3D (WlzCMesh3D *mesh, WlzCMeshCbFn fn, void *data)
 Removes a new 3D node callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemNewElmCb2D (WlzCMesh2D *mesh, WlzCMeshCbFn fn, void *data)
 Removes a new 2D element callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemNewElmCb2D5 (WlzCMesh2D5 *mesh, WlzCMeshCbFn fn, void *data)
 Removes a new 2D5 element callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemNewElmCb3D (WlzCMesh3D *mesh, WlzCMeshCbFn fn, void *data)
 Removes a new 3D element callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemDelNodCb2D (WlzCMesh2D *mesh, WlzCMeshCbFn fn, void *data)
 Removes a deleted 2D node callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemDelNodCb2D5 (WlzCMesh2D5 *mesh, WlzCMeshCbFn fn, void *data)
 Removes a deleted 2D5 node callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemDelNodCb3D (WlzCMesh3D *mesh, WlzCMeshCbFn fn, void *data)
 Removes a deleted 3D node callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemDelElmCb2D (WlzCMesh2D *mesh, WlzCMeshCbFn fn, void *data)
 Removes a deleted 2D element callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemDelElmCb2D5 (WlzCMesh2D5 *mesh, WlzCMeshCbFn fn, void *data)
 Removes a deleted 2D5 element callback to the mesh. More...
 
WlzErrorNum WlzCMeshRemDelElmCb3D (WlzCMesh3D *mesh, WlzCMeshCbFn fn, void *data)
 Removes a deleted 3D element callback to the mesh. More...
 
WlzCMeshNod2DWlzCMeshNewNod2D (WlzCMesh2D *mesh, WlzDVertex2 pos, WlzErrorNum *dstErr)
 Creates a new 2D mesh node at the given position. It is assumed that a node does not already exist at the given position but for efficiency this is not checked. More...
 
WlzCMeshNod2D5WlzCMeshNewNod2D5 (WlzCMesh2D5 *mesh, WlzDVertex3 pos, WlzErrorNum *dstErr)
 Creates a new 2D5 mesh node at the given position. It is assumed that a node does not already exist at the given position but for efficiency this is not checked. More...
 
WlzCMeshNod3DWlzCMeshNewNod3D (WlzCMesh3D *mesh, WlzDVertex3 pos, WlzErrorNum *dstErr)
 Creates a new 3D mesh node at the given position. A node must not already exist at this position. More...
 
WlzCMeshNod2DWlzCMeshAllocNod2D (WlzCMesh2D *mesh)
 Allocates a new 2D mesh node and sets it's index. For efficiency this function does not check it's parameters. More...
 
WlzCMeshNod2D5WlzCMeshAllocNod2D5 (WlzCMesh2D5 *mesh)
 Allocates a new 2D5 mesh node and sets it's index. For efficiency this function does not check it's parameters. More...
 
WlzCMeshNod3DWlzCMeshAllocNod3D (WlzCMesh3D *mesh)
 Allocates a new 3D mesh node and sets it's index. For efficiency this function does not check it's parameters. More...
 
WlzCMeshElm2DWlzCMeshNewElm2D (WlzCMesh2D *mesh, WlzCMeshNod2D *nod0, WlzCMeshNod2D *nod1, WlzCMeshNod2D *nod2, int allowFlip, WlzErrorNum *dstErr)
 Creates a new 2D mesh element connecting the given mesh nodes but does not connect this new mesh element to the rest of the mesh apart from changing the parent edges of the mesh nodes. More...
 
WlzCMeshElm2D5WlzCMeshNewElm2D5 (WlzCMesh2D5 *mesh, WlzCMeshNod2D5 *nod0, WlzCMeshNod2D5 *nod1, WlzCMeshNod2D5 *nod2, int allowFlip, WlzErrorNum *dstErr)
 Creates a new 2D5 mesh element connecting the given mesh nodes but does not connect this new mesh element to the rest of the mesh apart from changing the parent edges of the mesh nodes. More...
 
WlzCMeshElm3DWlzCMeshNewElm3D (WlzCMesh3D *mesh, WlzCMeshNod3D *nod0, WlzCMeshNod3D *nod1, WlzCMeshNod3D *nod2, WlzCMeshNod3D *nod3, int allowFlip, WlzErrorNum *dstErr)
 Creates a new 3D mesh element connecting the given mesh nodes but does not connect this new mesh element to the rest of the mesh apart from changing the parent edges of the mesh nodes. Each mesh element is composed of 4 faces and 4 nodes, with each of the 4 faces having 3 edges. See the diagrams accompanying the definition of WlzCMeshElm3D. More...
 
WlzCMeshElm2DWlzCMeshAllocElm2D (WlzCMesh2D *mesh)
 Allocates a new 2D mesh element and sets it's index. Internal edge connectivities are set. For efficiency this function does not check it's parameters. More...
 
WlzCMeshElm2D5WlzCMeshAllocElm2D5 (WlzCMesh2D5 *mesh)
 Allocates a new 2D5 mesh element and sets it's index. Internal edge connectivities are set. For efficiency this function does not check it's parameters. More...
 
WlzCMeshElm3DWlzCMeshAllocElm3D (WlzCMesh3D *mesh)
 Allocates a new 3D mesh element and sets it's index. For efficiency this function does not check it's parameters. More...
 
WlzErrorNum WlzCMeshSetElm2D (WlzCMesh2D *mesh, WlzCMeshElm2D *elm, WlzCMeshNod2D *nod0, WlzCMeshNod2D *nod1, WlzCMeshNod2D *nod2, int allowFlip)
 Sets up the edge and node connectivities within the given 2D mesh element. The geometry of the element is checked to make sure that it's area is greater than the mesh tolerance and that the nodes are in CCW order. If this test fails an error is returned. More...
 
WlzErrorNum WlzCMeshSetElm2D5 (WlzCMesh2D5 *mesh, WlzCMeshElm2D5 *elm, WlzCMeshNod2D5 *nod0, WlzCMeshNod2D5 *nod1, WlzCMeshNod2D5 *nod2, int allowFlip)
 Sets up the edge and node connectivities within the given 2D5 mesh element. The geometry of the element is checked to make sure that it's area is greater than the mesh tolerance and that the nodes are in CCW order. If this test fails an error is returned. More...
 
WlzErrorNum WlzCMeshSetElm3D (WlzCMesh3D *mesh, WlzCMeshElm3D *elm, WlzCMeshNod3D *nod0, WlzCMeshNod3D *nod1, WlzCMeshNod3D *nod2, WlzCMeshNod3D *nod3, int allowFlip)
 Sets up the edge and node connectivities within the given 3D mesh element. No opposites are changed. The geometry of the element is checked to make sure that it's volume is greater than the mesh tolerance, ie that the nodes are correclty ordered and are not co planar. If this test fails an error is returned. More...
 
WlzErrorNum WlzCMeshFree (WlzCMeshP mesh)
 Free's the mesh, it's cells, nodes and elements. More...
 
WlzErrorNum WlzCMeshFree2D (WlzCMesh2D *mesh)
 Free's the 2D mesh, it's cells, nodes and elements. More...
 
WlzErrorNum WlzCMeshFree2D5 (WlzCMesh2D5 *mesh)
 Free's the 2D5 mesh, it's cells, nodes and elements. More...
 
WlzErrorNum WlzCMeshFree3D (WlzCMesh3D *mesh)
 Free's the 3D mesh, it's cells, nodes and elements. More...
 
WlzErrorNum WlzCMeshDelNod2D (WlzCMesh2D *mesh, WlzCMeshNod2D *nod)
 Deletes the 2D mesh node. This function assumes that the node is no longer used by any elements. More...
 
WlzErrorNum WlzCMeshDelNod2D5 (WlzCMesh2D5 *mesh, WlzCMeshNod2D5 *nod)
 Deletes the 2D5 mesh node. This function assumes that the node is no longer used by any elements. More...
 
WlzErrorNum WlzCMeshDelNod3D (WlzCMesh3D *mesh, WlzCMeshNod3D *nod)
 Deletes the 3D mesh node. This function assumes that the node is no longer used by any elements. More...
 
WlzErrorNum WlzCMeshDelElm2D (WlzCMesh2D *mesh, WlzCMeshElm2D *elm)
 Deletes the 2D mesh element and any mesh nodes that are used exclusively by this mesh element. More...
 
WlzErrorNum WlzCMeshDelElm2D5 (WlzCMesh2D5 *mesh, WlzCMeshElm2D5 *elm)
 Deletes the 2D5 mesh element and any mesh nodes that are used exclusively by this mesh element. More...
 
WlzErrorNum WlzCMeshDelElm3D (WlzCMesh3D *mesh, WlzCMeshElm3D *elm)
 Deletes the 3D mesh element and any mesh nodes that are used exclusively by this mesh element. More...
 
void WlzCMeshNodFree2D (WlzCMesh2D *mesh, WlzCMeshNod2D *nod)
 Free's the given 2D mesh node. Actually just sets the node's index to mark it freed and then decrements the number of mesh nodes. More...
 
void WlzCMeshNodFree2D5 (WlzCMesh2D5 *mesh, WlzCMeshNod2D5 *nod)
 Free's the given 2D5 mesh node. Actually just sets the node's index to mark it freed and then decrements the number of mesh nodes. More...
 
void WlzCMeshNodFree3D (WlzCMesh3D *mesh, WlzCMeshNod3D *nod)
 Free's the given 3D mesh node. Actually just sets the node's index to mark it freed and then decrements the number of mesh nodes. More...
 
void WlzCMeshElmFree2D (WlzCMesh2D *mesh, WlzCMeshElm2D *elm)
 Free's the given 2D mesh element. Actually just sets the element's index to mark it freed and then decrements the number of mesh elements. More...
 
void WlzCMeshElmFree2D5 (WlzCMesh2D5 *mesh, WlzCMeshElm2D5 *elm)
 Free's the given 2D5 mesh element. Actually just sets the element's index to mark it freed and then decrements the number of mesh elements. More...
 
void WlzCMeshElmFree3D (WlzCMesh3D *mesh, WlzCMeshElm3D *elm)
 Free's the given 3D mesh element. Actually just sets the element's index to mark it freed and then decrements the number of mesh elements. More...
 
void WlzCMeshDelUnusedNodes3D (WlzCMesh3D *mesh)
 Deletes any unused neodes, ie nodes that do not have edge uses, from the given mesh. More...
 
void WlzCMeshDelUnusedNodes2D5 (WlzCMesh2D5 *mesh)
 Deletes any unused neodes, ie nodes that do not have edge uses, from the given mesh. More...
 
void WlzCMeshDelUnusedNodes2D (WlzCMesh2D *mesh)
 Deletes any unused neodes, ie nodes that do not have edge uses, from the given mesh. More...
 
WlzErrorNum WlzCMeshAffineTransformMesh2D (WlzCMesh2D *mesh, WlzAffineTransform *tr)
 Affine transforms the node positions of the given 2D mesh. More...
 
WlzErrorNum WlzCMeshAffineTransformMesh2D5 (WlzCMesh2D5 *mesh, WlzAffineTransform *tr)
 Affine transforms the node positions of the given 2D5 mesh. More...
 
WlzErrorNum WlzCMeshAffineTransformMesh3D (WlzCMesh3D *mesh, WlzAffineTransform *tr)
 Affine transforms the node positions of the given 3D mesh. More...
 
WlzErrorNum WlzCMeshBoundConform2D (WlzCMesh2D *mesh, WlzObject *obj, int mtd, double tol)
 Examines all the mesh elements classifying the nodes as either inside or outside the object. Those elements which have either one or two nodes outside the domain object have their position modified so that they are just outside. All elements with all nodes outside the domain object are deleted. On return the mesh bounding box and location grid will be invalid and the following functions should be called: WlzCMeshUpdateBBox3D(), WlzCMeshUpdateMaxSqEdgLen3D() and WlzCMeshReassignGridCells3D(). More...
 
WlzErrorNum WlzCMeshBoundConform3D (WlzCMesh3D *mesh, WlzObject *obj, int mtd, double tol)
 Examines all the mesh elements deleting those with all elements outside and decomposing those on it's boundary. At the first pass boundary elements (those with between one and three nodes outside the object's domain) are decomposed into one or three new elements and elements which have all four nodes outside the domain are deleted. In the second pass new elements outside the domain are deleted. More...
 
double WlzCMeshElmMinEdgLnSq2D (WlzCMeshElm2D *elm)
 Computes the square of the minimum edge length for the element. More...
 
void WlzCMeshElmMinMaxEdgLnSq3D (WlzCMeshElm3D *elm, double *dstMinSq, double *dstMaxSq)
 Computes the square of the minimum and maximum edge length for the given element. More...
 
double WlzCMeshElmMinEdgLnSq3D (WlzCMeshElm3D *elm)
 Computes the square of the minimum edge length for the element. More...
 
WlzErrorNum WlzCMeshReassignGridCells2D (WlzCMesh2D *mesh, int newNumNod)
 Allocates a new cell grid and then reassigns the nodes to the cells. More...
 
WlzErrorNum WlzCMeshReassignGridCells2D5 (WlzCMesh2D5 *mesh, int newNumNod)
 Allocates a new cell grid and then reassigns the nodes and elements to the cells. More...
 
WlzErrorNum WlzCMeshReassignGridCells3D (WlzCMesh3D *mesh, int newNumNod)
 Allocates a new cell grid and then reassigns the nodes and elements to the cells. More...
 
int WlzCMeshLocateNod2D (WlzCMesh2D *mesh, WlzDVertex2 pos, double tol, WlzCMeshNod2D **dstNod)
 Locates the matching node and for the given vertex position. The matched node is the mesh node which has the same position (within WLZ_MESH_TOLERANCE distance) of the given vertex. This function also gives access to the grid cell containing the node. More...
 
int WlzCMeshLocateNod2D5 (WlzCMesh2D5 *mesh, WlzDVertex3 pos, double tol, WlzCMeshNod2D5 **dstNod)
 Locates the matching node and for the given vertex position. The matched node is the mesh node which has the same position (within WLZ_MESH_TOLERANCE distance) of the given vertex. This function also gives access to the grid cell containing the node. More...
 
int WlzCMeshLocateNod3D (WlzCMesh3D *mesh, WlzDVertex3 pos, WlzIVertex3 *dstGPos, WlzCMeshNod3D **dstPrev, double tol, WlzCMeshNod3D **dstNod)
 Locates the matching node and for the given vertex position. The matched node is the mesh node which has the same position (within WLZ_MESH_TOLERANCE distance) of the given vertex. This function also gives access to the grid cell containing the node. More...
 
WlzCMeshNod2DWlzCMeshMatchNod2D (WlzCMesh2D *mesh, WlzDVertex2 nPos, double tol)
 Locates the matching node and for the given vertex position. The matched node is the mesh node which has the same position (within WLZ_MESH_TOLERANCE distance) of the given vertex. More...
 
WlzCMeshNod2D5WlzCMeshMatchNod2D5 (WlzCMesh2D5 *mesh, WlzDVertex3 nPos, double tol)
 Locates the matching node and for the given vertex position. The matched node is the mesh node which has the same position (within WLZ_MESH_TOLERANCE distance) of the given vertex. More...
 
WlzCMeshNod3DWlzCMeshMatchNod3D (WlzCMesh3D *mesh, WlzDVertex3 nPos, double tol)
 Locates the matching node and for the given vertex position. The matched node is the mesh node which has the same position (within WLZ_MESH_TOLERANCE distance) of the given vertex. More...
 
int WlzCMeshMatchNNod2D (WlzCMesh2D *mesh, int nNod, WlzDVertex2 *nPos, double tol, WlzCMeshNod2D **mNod)
 Locates the nodes matching the given vertex positions. The matched nodes are the mesh nodes which have the same positions (within WLZ_MESH_TOLERANCE distance) of the given vertices. More...
 
int WlzCMeshMatchNNod2D5 (WlzCMesh2D5 *mesh, int nNod, WlzDVertex3 *nPos, double tol, WlzCMeshNod2D5 **mNod)
 Locates the nodes matching the given vertex positions. The matched nodes are the mesh nodes which have the same positions (within given tolerance distance) of the given vertices. More...
 
int WlzCMeshMatchNNod3D (WlzCMesh3D *mesh, int nNod, WlzDVertex3 *nPos, double tol, WlzCMeshNod3D **mNod)
 Locates the nodes matching the given vertex positions. The matched nodes are the mesh nodes which have the same positions (within given tolerance distance) of the given vertices. More...
 
int WlzCMeshMatchNNodIdx2D (WlzCMesh2D *mesh, int nNod, WlzDVertex2 *nPos, double tol, int *mIdx)
 Locates the nodes matching the given vertex positions. The matched nodes are the mesh nodes which have the same positions (within given tolerance distance) of the given vertices. More...
 
int WlzCMeshMatchNNodIdx2D5 (WlzCMesh2D5 *mesh, int nNod, WlzDVertex3 *nPos, double tol, int *mIdx)
 Locates the nodes matching the given vertex positions. The matched nodes are the mesh nodes which have the same positions (within WLZ_MESH_TOLERANCE distance) of the given vertices. More...
 
int WlzCMeshMatchNNodIdx3D (WlzCMesh3D *mesh, int nNod, WlzDVertex3 *nPos, double tol, int *mIdx)
 Locates the nodes matching the given vertex positions. The matched nodes are the mesh nodes which have the same positions (within WLZ_MESH_TOLERANCE distance) of the given vertices. More...
 
int WlzCMeshElmEnclosingPos (WlzCMeshP mesh, int lastElmIdx, double pX, double pY, double pZ, int exhaustive, int *dstCloseNod)
 Locates the element of the conforming mesh which encloses the given position. More...
 
int WlzCMeshElmEnclosingPos2D (WlzCMesh2D *mesh, int lastElmIdx, double pX, double pY, int exhaustive, int *dstCloseNod)
 Locates the element of the conforming mesh which encloses the given position. More...
 
int WlzCMeshElmEnclosingPos2D5 (WlzCMesh2D5 *mesh, int dummyLastElmIdx, double pX, double pY, double pZ, int exhaustive, int *dstCloseNod)
 Locates the element of the conforming mesh which encloses the given position. More...
 
int WlzCMeshElmEnclosingPos3D (WlzCMesh3D *mesh, int lastElmIdx, double pX, double pY, double pZ, int exhaustive, int *dstCloseNod)
 Locates the element of the conforming mesh which encloses the given position. More...
 
int WlzCMeshElmClosestPosIn (WlzCMeshP mesh, WlzVertexP dstPos, WlzVertex pos, double dMax)
 Locates the element in the conforming mesh which encloses or is closest to the vertex with the given position. The computed position will be inside the mesh by a distance of more than WLZ_MESH_TOLERANCE provided that an enclosing or close element is found. More...
 
int WlzCMeshElmClosestPosIn2D (WlzCMesh2D *mesh, WlzDVertex2 *dstPos, WlzDVertex2 pos, double dMax)
 Locates the element in the conforming mesh which encloses or is closest to the given vertex position, provided that the distance is no more than the maximum distance. The position within the element will always be more than WLZ_MESH_TOLERANCE from the mesh boundary provided that an enclosing or close element is found. More...
 
int WlzCMeshElmClosestPosIn2D5 (WlzCMesh2D5 *mesh, WlzDVertex3 *dstPos, WlzDVertex3 pos, double dMax)
 
int WlzCMeshElmClosestPosIn3D (WlzCMesh3D *mesh, WlzDVertex3 *dstPos, WlzDVertex3 pos, double dMax)
 Locates the element in the conforming mesh which encloses or is closest to the given vertex position, provided that the distance is no more than the maximum distance. The position within the element will always be more than WLZ_MESH_TOLERANCE from the mesh boundary provided that an enclosing or close element is found. More...
 
int WlzCMeshClosestNod2D (WlzCMesh2D *mesh, WlzDVertex2 pos)
 Finds the index of the closest node to the given position. More...
 
int WlzCMeshClosestNod2D5 (WlzCMesh2D5 *mesh, WlzDVertex3 p)
 Finds the index of the closest node to the given position. More...
 
int WlzCMeshClosestNod3D (WlzCMesh3D *mesh, WlzDVertex3 pos)
 Finds the index of the closest node to the given position. More...
 
int WlzCMeshElmEnclosesPos2D (WlzCMeshElm2D *elm, WlzDVertex2 gPos)
 Checks whether the vertex at the given position is within the given mesh element. More...
 
int WlzCMeshElmEnclosesPos2D5 (WlzCMeshElm2D5 *elm, WlzDVertex3 gPos)
 Checks whether the vertex at the given position is within the given mesh element. More...
 
int WlzCMeshElmEnclosesPos3D (WlzCMeshElm3D *elm, WlzDVertex3 gPos)
 Checks whether the vertex at the given position is within the given mesh element. More...
 
WlzObjectWlzCMeshExtract2D (WlzObject *gObj, int applyDsp, WlzErrorNum *dstErr)
 Makes a 2D conforming mesh from the given 2D or 2D5 conforming mesh by simply ignoring the z component (if it exists) as the node positions are copied. Node and element indices are preserved by this function. More...
 
WlzCMeshP WlzCMeshFromObj (WlzObject *obj, double minElmSz, double maxElmSz, WlzObject **dstDilObj, int conform, WlzErrorNum *dstErr)
 Constructs a 2D or 3D mesh from a 2D or 3D domain object. Because of the difficulty in computing a mesh which conforms to the domain of the given object, the resulting mesh will instead cover the given domain with some nodes of the mesh outside the given domain. All mesh nodes will however be within the dilated domain, where the dilation is by a sphere of radius twice the minimum element size. More...
 
WlzCMesh2DWlzCMeshFromObj2D (WlzObject *obj, double minElmSz, double maxElmSz, WlzObject **dstDilObj, int conform, WlzErrorNum *dstErr)
 Constructs a 2D mesh from a 2D domain object. Because of the difficulty in computing a mesh which conforms to the domain of the given object, the resulting mesh will instead cover the given domain with some nodes of the mesh outside the given domain. All mesh nodes will however be within the dilated domain, where the dilation is by a sphere of radius twice the minimum element size. More...
 
WlzCMesh3DWlzCMeshFromObj3D (WlzObject *obj, double minElmSz, double maxElmSz, WlzObject **dstDilObj, int conform, WlzErrorNum *dstErr)
 Constructs a 3D mesh from a 3D domain object. More...
 
WlzCMesh2D5WlzCMeshFromGM (WlzGMModel *model, WlzErrorNum *dstErr)
 Constructs a 2D5 mesh from a 3D geometric model. More...
 
WlzCMesh2DWlzCMeshFromBalLBTDom2D (WlzLBTDomain2D *lDom, WlzObject *iObj, WlzErrorNum *dstErr)
 Constructs a 2D mesh from a balanced 2D linear binary tree domain. More...
 
WlzCMesh3DWlzCMeshFromBalLBTDom3D (WlzLBTDomain3D *lDom, WlzObject *iObj, WlzErrorNum *dstErr)
 Constructs a 3D mesh from a balanced 3D linear binary tree domain. More...
 
WlzObjectWlzCMeshComputeNormalsIxv2D5 (WlzObject *gObj, int nrmFlg, WlzErrorNum *dstErr)
 Computes the normals at the nodes of the given mesh. The normals are computed for each node by computing the area and normal of each face which uses the node and then using a linear combination of the face normals with a weight proportional to the area. More...
 
void WlzCMeshDbgOutVTK2D (FILE *fP, WlzCMesh2D *mesh)
 Debuging function for 2D mesh output in VTK format. More...
 
void WlzCMeshDbgOutVTK3D (FILE *fP, WlzCMesh3D *mesh)
 Debuging function for 3D mesh output in VTK format. More...
 
void WlzCMeshDbgOutVTK (FILE *fP, WlzCMeshP mesh)
 Debuging function for mesh output in VTK format. More...
 
WlzErrorNum WlzCMeshElmFuse2D (WlzCMesh2D *mesh, WlzCMeshElm2D *gElm)
 Fuses the given element in the mesh. More...
 

Detailed Description

Functions for 2D and 3D conforming simplical mesh generation. Meshes generated by these functions will conform approximately to an objects boundaries.

Author
Bill Hill
Date
June 2003
Version
Id
2318aa4a95c23f5ba47372052a8d0f57e7ee6b69
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Macro Definition Documentation

#define WLZ_FAST_CODE

Typedef Documentation

Function Documentation

WlzErrorNum WlzCMeshAddDelNodCb2D ( WlzCMesh2D mesh,
WlzCMeshCbFn  fn,
void *  data 
)

Adds a 2D deleted node callback to the mesh.

Returns
Woolz error code.
Parameters
meshGiven mesh.
fnFunction to be called.
dataCallback data for function.

References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh2D::res, and WLZ_ERR_NONE.

WlzErrorNum WlzCMeshAddDelNodCb2D5 ( WlzCMesh2D5 mesh,
WlzCMeshCbFn  fn,
void *  data 
)

Adds a 2D5 deleted node callback to the mesh.

Returns
Woolz error code.
Parameters
meshGiven mesh.
fnFunction to be called.
dataCallback data for function.

References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh2D5::res, and WLZ_ERR_NONE.

WlzErrorNum WlzCMeshAddDelNodCb3D ( WlzCMesh3D mesh,
WlzCMeshCbFn  fn,
void *  data 
)

Adds a 3D deleted node callback to the mesh.

Returns
Woolz error code.
Parameters
meshGiven mesh.
fnFunction to be called.
dataCallback data for function.

References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh3D::res, and WLZ_ERR_NONE.

int WlzCMeshElmClosestPosIn2D5 ( WlzCMesh2D5 mesh,
WlzDVertex3 dstPos,
WlzDVertex3  pos,
double  dMax 
)

Referenced by WlzCMeshElmClosestPosIn().

void WlzCMeshDbgOutVTK ( FILE *  fP,
WlzCMeshP  mesh 
)

Debuging function for mesh output in VTK format.

ingroup WlzTransform

Parameters
fPGiven file pointer.
meshGiven mesh.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WlzCMeshDbgOutVTK2D(), and WlzCMeshDbgOutVTK3D().