Woolz Image Processing  Version 1.7.5
WlzMesh

Files

file  WlzCMeshCurvature.c
 Functions to compute curvatures on conforming simplical meshes.
 
file  WlzCMeshDispField.c
 Functions transferring displacements between meshes and displacement fields.
 
file  WlzCMeshExtrapolate.c
 Functions to extrapolate values within conforming meshes.
 
file  WlzCMeshFMar.c
 Fast marching methods within conforming meshes.
 
file  WlzCMeshIntersect.c
 Functions for computing the intersection with conforming meshes.
 
file  WlzCMeshScan.c
 Iterators for scanning through CMesh based objects and domains.
 
file  WlzCMeshUtils.c
 Utility functions for 2D and 3D graph based conforming simplical meshes.
 
file  WlzCMeshValueTransfer.c
 Functions for transfering values from one mesh to another.
 
file  WlzMeshGen.c
 Functions for 2D and 3D conforming simplical mesh generation. Meshes generated by these functions will conform approximately to an objects boundaries.
 

Data Structures

struct  _WlzCMeshExpEnt
 A FIFO queue active node/element entity for mesh value extrapolation workspace. Typedef: WlzCMeshExpEnt. More...
 
struct  _WlzCMeshExpWSp
 A mesh value extrapolation workspace with a FIFO queue for active nodes (or elements) during mesh value extrapolation along with matrices and vectors for SVD. Typedef: WlzCMeshExpWSp. More...
 
struct  _WlzCMeshFMarQEnt
 An entry of a AlcHeap based queue. Typedef: WlzCMeshFMarQEnt. More...
 
struct  _WlzCMeshFMarElmQEnt
 An entry of an element queue. Typedef: WlzCMeshFMarElmQEnt. More...
 
struct  _WlzCMeshEntCore
 A core node/element structure containing the initial fields common to all node and element structures. Typedef: WlzCMeshEntCore. More...
 
struct  _WlzCMeshNod2D
 A node of a 2D mesh. Typedef: WlzCMeshNod2D. More...
 
struct  _WlzCMeshNod2D5
 A node of a 2D5 mesh with a 3D position but 2D connectivity. Typedef: WlzCMeshNod2D5. More...
 
struct  _WlzCMeshNod3D
 A node of a 3D mesh. Typedef: WlzCMeshNod3D. More...
 
union  _WlzCMeshNodP
 A node pointer for a 2 or 3D mesh. Typedef: WlzCMeshNodP. More...
 
struct  _WlzCMeshEdgU2D
 A 2D CCW directed (half) edge within the parent simplex. Typedef: WlzCMeshEdgU2D. More...
 
struct  _WlzCMeshEdgU2D5
 A 2D CCW directed (half) edge within the parent simplex. Typedef: WlzCMeshEdgU2D5. More...
 
struct  _WlzCMeshEdgU3D
 A 3D directed (half) edge within the parent face. Typedef: WlzCMeshEdgU3D. More...
 
union  _WlzCMeshEdgUP
 An edge use pointer for a 2 or 3D mesh. Typedef: WlzCMeshEdgUP. More...
 
struct  _WlzCMeshFace
 A directed face within the parent simplex. Typedef: WlzCMeshFace. More...
 
struct  _WlzCMeshElm2D
 A single 2D triangular mesh element. Typedef: WlzCMeshElm2D. More...
 
struct  _WlzCMeshElm2D5
 A single 3D triangular mesh element. Typedef: WlzCMeshElm2D5. More...
 
struct  _WlzCMeshElm3D
 A single 3D tetrahedral mesh element. Typedef: WlzCMeshElm3D. More...
 
union  _WlzCMeshElmP
 A element pointer for a 2 or 3D mesh. Typedef: WlzCMeshElmP. More...
 
struct  _WlzCMeshCellElm2D
 Data structure which is used to link lists of 2D elements with the grid cells that they intersect. Typedef: WlzCMeshCell2D. More...
 
struct  _WlzCMeshCellElm2D5
 Data structure which is used to link lists of 2D5 elements with the grid cells that they intersect. Typedef: WlzCMeshCell2D5. More...
 
struct  _WlzCMeshCellElm3D
 Data structure which is used to link lists of 3D elements with the grid cells that they intersect. Typedef: WlzCMeshCell3D. More...
 
struct  _WlzCMeshCell2D
 A single cell of a spatial grid or array of 2D cells. Typedef: WlzCMeshCell2D. More...
 
struct  _WlzCMeshCell2D5
 A single cell of a spatial grid or array of 2D5 cells. Typedef: WlzCMeshCell2D5. More...
 
struct  _WlzCMeshCell3D
 A single cell of a spatial grid or array of 3D cells. Typedef: WlzCMeshCell3D. More...
 
struct  _WlzCMeshCellGrid2D
 A spatial grid or array of square 2D cells that are used for fast node and element location queries. Typedef: WlzCMeshCellGrid2D. More...
 
struct  _WlzCMeshCellGrid2D5
 A spatial grid or array of cubiod 3D cells that are used for fast 2D5 node and element location queries. Typedef: WlzCMeshCellGrid2D5. More...
 
struct  _WlzCMeshCellGrid3D
 A spatial grid or array of square 3D cells that are used for fast node and element location queries. Typedef: WlzCMeshCellGrid3D. More...
 
struct  _WlzCMeshCbEntry
 Callback entry for list of callbacks. Typedef: WlzCMeshCbEntry. More...
 
struct  _WlzCMeshEntRes
 Resources used for efficient allocation and recycling of mesh entities. Typedef: WlzCMeshEntRes. More...
 
struct  _WlzCMeshRes
 Resources used for efficient allocation, recycling and location of mesh elements and nodes. Typedef: WlzCMeshRes. More...
 
union  _WlzCMeshEntP
 Union of pointers to top level mesh entities. Typedef: WlzCMeshEntP. More...
 
union  _WlzCMeshEntPP
 Union of second level pointers to top level mesh entities. Typedef: WlzCMeshEntP. More...
 
struct  _WlzCMesh2D
 A graph based mesh model for 2D boundary conforming simplical meshes. The mesh inherits it's core fields from the Woolz core domain. Typedef: WlzCMesh2D. More...
 
struct  _WlzCMesh2D5
 A graph based mesh model for 2D5 boundary conforming simplical meshes. The mesh inherits it's core fields from the Woolz core domain. Typedef: WlzCMesh2D5. More...
 
struct  _WlzCMesh3D
 A graph based mesh model for 3D boundary conforming simplical meshes. The mesh inherits it's core fields from the Woolz core domain. Typedef: WlzCMesh3D. More...
 
union  _WlzCMeshP
 Union of 2D and 3D conforming simplical mesh pointers. More...
 

Typedefs

typedef WlzErrorNum(* WlzCMeshCbFn) (void *, void *, void *)
 A pointer to a function called to make mesh entity properties. Parameters passed are: mesh, entity, data. More...
 

Enumerations

enum  _WlzCMeshExpFlag {
  WLZ_CMESHEXP_FLAG_NONE = (0),
  WLZ_CMESHEXP_FLAG_UNKNOWN = (1),
  WLZ_CMESHEXP_FLAG_ACTIVE = (1<<1),
  WLZ_CMESHEXP_FLAG_UPDATED = (1<<2)
}
 Bit flags for extrapolation via an expanding front. Typedef: WlzCMeshExpFlag. More...
 
enum  _WlzCMeshConformAction {
  WLZ_CMESH_CONFORM_NONE,
  WLZ_CMESH_CONFORM_DELETE,
  WLZ_CMESH_CONFORM_MODIFY
}
 Possible mesh element conformation actions. Typedef: WlzCMeshConformAction. More...
 
enum  _WlzCMeshElmFlags {
  WLZ_CMESH_ELM_FLAG_NONE = (0),
  WLZ_CMESH_ELM_FLAG_BOUNDARY = (1),
  WLZ_CMESH_ELM_FLAG_OUTSIDE = (1<<1),
  WLZ_CMESH_ELM_FLAG_KNOWN = (1<<2),
  WLZ_CMESH_ELM_FLAG_ALL = (65535)
}
 Conforming mesh element flags. These are bit masks which are used in a conforming mesh's elements flags. Typedef: WlzCMeshElmFlags. More...
 
enum  _WlzCMeshNodFlags {
  WLZ_CMESH_NOD_FLAG_NONE = (0),
  WLZ_CMESH_NOD_FLAG_ADJUSTED = (1),
  WLZ_CMESH_NOD_FLAG_BOUNDARY = (1<<1),
  WLZ_CMESH_NOD_FLAG_UPWIND = (1<<2),
  WLZ_CMESH_NOD_FLAG_ACTIVE = (1<<3),
  WLZ_CMESH_NOD_FLAG_KNOWN = (1<<4),
  WLZ_CMESH_NOD_FLAG_OUTSIDE = (1<<5),
  WLZ_CMESH_NOD_FLAG_ALL = (65535)
}
 Conforming mesh node flags. These are bit masks which are used in a conforming mesh's node flags. Typedef: WlzCMeshNodFlags. More...
 

Functions

WlzObjectWlzCMeshCurvToImage (WlzObject *inObj, double scale, int meanCrv, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Creates a new 2D domain object with double values that covers the given WLZ_CMESH_2D5 after it has been flattened by applying it's displacements. The displacements of the mesh must be valid for flattening the mesh as computed by WlzCMeshCompSurfMapConformal(). The curvature values are not normalised and are either the Gaussian or mean mesh curvatures. More...
 
WlzObjectWlzCMeshComputeCurvatures (WlzObject *inObj, WlzErrorNum *dstErr)
 Creates a new object with the domain of the given object and a new indexed value table which has the curvatures. The curvatures are organized as a pair of double values per node, total curvature first and then the mean curvature. More...
 
WlzObjectWlzCMeshComputeNormalsElm (WlzObject *inObj, WlzErrorNum *dstErr)
 Creates a new object with the domain of the given object and a new indexed value table which has the element normals. The normals are organized as a 3 double values (x, y, z order) per element. More...
 
WlzObjectWlzCMeshComputeNormalsNod (WlzObject *inObj, WlzErrorNum *dstErr)
 Creates a new object with the domain of the given object and a new indexed value table which has the node normals. The normals are organized as a 3 double values (x, y, z order) per node. More...
 
WlzObjectWlzCMeshComputeCurvaturesFromNodNorm (WlzObject *inObj, WlzErrorNum *dstErr)
 Creates a new object with the domain of the given object and a new indexed value table which has the curvatures. The curvatures are organized as a pair of double values per node, total curvature first and then the mean curvature. More...
 
WlzObjectWlzCMeshSetDispFromField (WlzObject *mObj, WlzObject *dObj, WlzDVertex3 bgd, WlzInterpolationType itp, int abs, WlzErrorNum *dstErr)
 Creates a new 2 or 3D constrained mesh object using the domain of the given mesh object (with possible refinement) and creating new values for the domain which are set from the displacement field. Mesh refinement will be done if the fractional error length at element centroids is greater than the given maximum and the resulting element will not have an edge length less than the given minimum and the given element does not have a maximum to minimum edge length ratio greater than two. More...
 
WlzObjectWlzCMeshDispToField (WlzObject *mObj, WlzDVertex3 bgd, WlzInterpolationType itp, int invert, int abs, WlzErrorNum *dstErr)
 Creates a new 2 or 3D compound array object with the component displacements of the given mesh interpolated over the mesh domain. More...
 
WlzObjectWlzCMeshExpValues (WlzObject *gObj, WlzUByte *unk, WlzInterpolationType itp, WlzErrorNum *dstErr)
 Given a conforming mesh object with attached values and an array of know node flags this function extrapolates the value of the unknown values. More...
 
WlzObjectWlzCMeshDistance2D (WlzObject *objG, WlzObjectType rObjType, int nSeeds, WlzDVertex2 *seeds, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Computes a new 2D object with values that are the distance from the given seeds within the given mesh. More...
 
WlzObjectWlzCMeshDistance3D (WlzObject *objG, WlzObjectType rObjType, int nSeeds, WlzDVertex3 *seeds, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Computes a new 3D object with values that are the distance from the given seeds within the given mesh. More...
 
WlzErrorNum WlzCMeshFMarNodes2D (WlzCMesh2D *mesh, double *distances, int nSeeds, WlzDVertex2 *seeds)
 Computes constrained distances within a mesh by propagating wavefronts within a 2D conforming mesh. The wavefronts are propagated from either the mesh boundary or a number of seed positions within the mesh. The given mesh will not be modified. More...
 
WlzErrorNum WlzCMeshFMarNodes3D (WlzCMesh3D *mesh, double *distances, int nSeeds, WlzDVertex3 *seeds)
 Computes constrained distances within a mesh by propagating wavefronts within a 3D conforming mesh. The wavefronts are propagated from either the mesh boundary or a number of seed positions within the mesh. The given mesh will not be modified. More...
 
WlzObjectWlzCMeshIntersect (WlzObject *obj0, WlzObject *obj1, int dsp0, int **dstNodTab, WlzErrorNum *dstErr)
 Computes a new conforming mesh which covers the intersection the two given conforming mesh objects. The new mesh will have the nodes and elements of the first mesh when these are contained in the second mesh. More...
 
WlzCMesh2DWlzCMeshIntersect2Mesh2D (WlzMeshTransform *tr0, WlzMeshTransform *tr1, int dsp0, int **dstNodTab, WlzErrorNum *dstErr)
 Computes a new conforming mesh which covers the intersection the two given (convex) mesh objects. The new mesh will have the nodes and elements of the first mesh when these are contained in the second mesh. More...
 
WlzObjectWlzCMeshIntersectDom2D5 (WlzObject *sObj, WlzObject *cObj, double delta, double scale, WlzErrorNum *dstErr)
 Computes the intersection of a 3D spatial domain object with a 2.5D conforming mesh that has displacements to a plane. The result is a 2D domain coresponding to the intersection mapped to the plane. More...
 
WlzDVertex2 WlzCMeshClosePointDom2D5 (WlzObject *vObj, WlzObject *mObj, double scale, WlzErrorNum *dstErr)
 Computes the position on a 2.5D conforming mesh which has the least distance to the given 3D spatial domain. More...
 
WlzCMeshNod2DWlzCMeshNextNod2D (WlzCMesh2D *mesh, int *idx, int all)
 Returns the next node in the 2D mesh. Repeatedly calling this function will itterate through all nodes of the mesh. Before starting to itterate through the nodes of a mesh the index should be initialised to zero (or the index value from which to start). On return the index will have been incremented. More...
 
WlzCMeshNod3DWlzCMeshNextNod3D (WlzCMesh3D *mesh, int *idx, int all)
 Returns the next node in the 3D mesh. Repeatedly calling this function will itterate through all nodes of the mesh. Before starting to itterate through the nodes of a mesh the index should be initialised to zero (or the index value from which to start). On return the index will have been incremented. More...
 
WlzCMeshElm2DWlzCMeshNextElm2D (WlzCMesh2D *mesh, int *idx, int all)
 Returns the next element in the 2D mesh. Repeatedly calling this function will itterate through all elements of the mesh. Before starting to itterate through the elements of a mesh the index should be initialised to zero (or the index value from which to start). On return the index will have been incremented. More...
 
WlzCMeshElm3DWlzCMeshNextElm3D (WlzCMesh3D *mesh, int *idx, int all)
 Returns the next element in the 3D mesh. Repeatedly calling this function will itterate through all elements of the mesh. Before starting to itterate through the elements of a mesh the index should be initialised to zero (or the index value from which to start). On return the index will have been incremented. More...
 
WlzObjectWlzCMeshToContour (WlzObject *mObj, double disp, WlzErrorNum *dstErr)
 Creates a contour corresponding to the given conforming mesh which must be a 2D5 mesh, ie a surface. More...
 
WlzGMModelWlzCMeshToGMModel (WlzObject *mObj, double disp, WlzErrorNum *dstErr)
 Creates a geometric model corresponding to the given conforming mesh which must be either a 2D or 2D5 mesh, ie a surface. The resulting model will have either have type WLZ_GMMOD_3D (from 2D5) or WLZ_GMMOD_2D (from 2D). More...
 
WlzObjectWlzCMeshFlatten2D5 (WlzObject *gObj, WlzErrorNum *dstErr)
 Creates a new 2D conforming mesh object by flattening the given 2D5 conforming mesh object. This is done by applying the 2D5 object's indexed values which are assumed to be valid displacements to a plane. See WlzCMeshCompSurfMap(). More...
 
WlzObjectWlzCMeshToDomObj (WlzObject *mObj, int trans, double scale, WlzErrorNum *dstErr)
 Computes a new domain object, the domain of which corresponds to the region of space enclosed by the mesh, such that the domain object is covered by the given mesh object. More...
 
WlzObjectWlzCMeshToDomObjValues (WlzObject *dObj, WlzObject *mObj, WlzInterpolationType itp, int ixi, WlzErrorNum *dstErr)
 Given a domain object and a mesh object, this function creates a new domain object using the domain of the given object and a new value table. The function then interpolates the mesh values throughout the domain object. More...
 
double WlzCMeshElmMaxSqEdgLen2D (WlzCMeshElm2D *elm)
 Computes the mesh maximum edge length of the given element. More...
 
double WlzCMeshElmMaxSqEdgLen2D5 (WlzCMeshElm2D5 *elm)
 Computes the mesh maximum edge length of the given element. More...
 
double WlzCMeshElmMaxSqEdgLen3D (WlzCMeshElm3D *elm)
 Computes the mesh maximum edge length of the given element. More...
 
void WlzCMeshUpdateMaxSqEdgLen2D (WlzCMesh2D *mesh)
 Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh. More...
 
void WlzCMeshUpdateMaxSqEdgLen2D5 (WlzCMesh2D5 *mesh)
 Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh. More...
 
void WlzCMeshUpdateMaxSqEdgLen3D (WlzCMesh3D *mesh)
 Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh. More...
 
void WlzCMeshUpdateBBox2D (WlzCMesh2D *mesh)
 Updates the bounding box of the 2D conforming mesh. More...
 
void WlzCMeshUpdateBBox2D5 (WlzCMesh2D5 *mesh)
 Updates the bounding box of the 2D5 conforming mesh. More...
 
void WlzCMeshUpdateBBox3D (WlzCMesh3D *mesh)
 Updates the bounding box of the 3D conforming mesh. More...
 
void WlzCMeshSetNodFlags (WlzCMeshP mesh, unsigned int flags)
 Sets the node flags for all valid nodes of the mesh. More...
 
void WlzCMeshSetNodFlags2D (WlzCMesh2D *mesh, unsigned int flags)
 Sets node flags for all valid nodes of the 2D mesh. More...
 
void WlzCMeshSetNodFlags3D (WlzCMesh3D *mesh, unsigned int flags)
 Sets node flags for all valid nodes of the 3D mesh. More...
 
void WlzCMeshClearNodFlags (WlzCMeshP mesh, unsigned int flags)
 Clears the node flags for all valid nodes of the mesh. More...
 
void WlzCMeshClearNodFlags2D (WlzCMesh2D *mesh, unsigned int flags)
 Clears node flags for all valid nodes of the 2D mesh. More...
 
void WlzCMeshClearNodFlags3D (WlzCMesh3D *mesh, unsigned int flags)
 Clears node flags for all valid nodes of the 3D mesh. More...
 
void WlzCMeshClearElmFlags (WlzCMeshP mesh, unsigned int flags)
 Clears the element flags for all valid elements of the mesh. More...
 
void WlzCMeshClearElmFlags2D (WlzCMesh2D *mesh, unsigned int flags)
 Clears element flags for all valid elements of the 2D mesh. More...
 
void WlzCMeshClearElmFlags3D (WlzCMesh3D *mesh, unsigned int flags)
 Clears element flags for all valid elements of the 3D mesh. More...
 
int WlzCMeshSetBoundNodFlags (WlzCMeshP mesh)
 Sets or clears the boundary node flag bit for all nodes of the mesh. More...
 
int WlzCMeshSetBoundNodFlags2D (WlzCMesh2D *mesh)
 Sets or clears the boundary node flag bit for all nodes of the 2D mesh. More...
 
int WlzCMeshSetBoundNodFlags2D5 (WlzCMesh2D5 *mesh)
 Sets or clears the boundary node flag bit for all nodes of the 2D5 mesh. More...
 
int WlzCMeshSetBoundNodFlags3D (WlzCMesh3D *mesh)
 Sets or clears the boundary node flag bit for all nodes of the 3D mesh. More...
 
WlzErrorNum WlzCMeshGetBoundNodes (WlzCMeshP mesh, int *dstNNod, int **dstNod)
 Gets the indeces of the boundary nodes of the mesh. The boundary nodes will be unordered. More...
 
WlzErrorNum WlzCMeshGetBoundNodes2D (WlzCMesh2D *mesh, int *dstNNod, int **dstNod)
 Gets the indeces of the boundary nodes of the 2D mesh. More...
 
WlzErrorNum WlzCMeshGetBoundNodes2D5 (WlzCMesh2D5 *mesh, int *dstNNod, int **dstNod, int ordered)
 Gets the indices of the boundary nodes of the 2D5 mesh. More...
 
WlzErrorNum WlzCMeshGetBoundNodes3D (WlzCMesh3D *mesh, int *dstNNod, int **dstNod)
 Gets the indeces of the boundary nodes of the 3D mesh. More...
 
int WlzCMeshCountBoundNodes (WlzCMeshP mesh)
 Counts the number of boundary nodes of the mesh. More...
 
int WlzCMeshCountBoundNodes2D (WlzCMesh2D *mesh)
 Counts the number of boundary nodes of the 2D mesh. More...
 
int WlzCMeshCountBoundNodes2D5 (WlzCMesh2D5 *mesh)
 Counts the number of boundary nodes of the 2D5 mesh. More...
 
int WlzCMeshCountBoundNodes3D (WlzCMesh3D *mesh)
 Counts the number of boundary nodes of the 3D mesh. More...
 
int WlzCMeshSetBoundElmFlags (WlzCMeshP mesh)
 Sets or clears the boundary element flag bit for all elements of the mesh. More...
 
int WlzCMeshSetBoundElmFlags2D (WlzCMesh2D *mesh)
 Sets or clears the boundary element flag bit for all elements of the 2D mesh. More...
 
int WlzCMeshSetBoundElmFlags3D (WlzCMesh3D *mesh)
 Sets or clears the boundary element flag bit for all elements of the 3D mesh. More...
 
int WlzCMeshNodIsBoundary2D (WlzCMeshNod2D *nod)
 Checks whether the node is a boundary node by examining the edges which use the node. If one of these edges does not have an opposite edge (other than itself) the node is a boundary node. More...
 
int WlzCMeshNodIsBoundary2D5 (WlzCMeshNod2D5 *nod)
 Checks whether the node is a boundary node by examining the edges which use the node. If one of these edges does not have an opposite edge (other than itself) the node is a boundary node. More...
 
int WlzCMeshNodIsBoundary3D (WlzCMeshNod3D *nod)
 Checks whether the node is a boundary node by examining the faces which use the node. If one of these faces does not have an opposite face (other than itself) the node is a boundary node. More...
 
int WlzCMeshElmIsBoundary2D (WlzCMeshElm2D *elm)
 Checks whether the element is a boundary node by examining the edges for opposite edges. More...
 
int WlzCMeshElmIsBoundary3D (WlzCMeshElm3D *elm)
 Checks whether the element is a boundary node by examining the faces for opposite faces. More...
 
WlzErrorNum WlzCMeshLaplacianSmooth (WlzCMeshP mesh, int itr, double alpha, int doBnd, int update)
 Applies a Laplacian smoothing to the 2D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. If a node is on a boundary of the mesh then it is moved on the boundary, ie to the centroid of it's neighboring boundary nodes. Before calling this function all nodes must have had the boundary node flag bit set or cleared appropriately. This function will shrink meshes when the boundary parameter is set. More...
 
WlzErrorNum WlzCMeshLaplacianSmooth2D (WlzCMesh2D *mesh, int itr, double alpha, int doBnd, int update)
 Applies a Laplacian smoothing to the 2D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. See WlzCMeshLaplacianSmooth(). More...
 
WlzErrorNum WlzCMeshLaplacianSmooth3D (WlzCMesh3D *mesh, int itr, double alpha, int doBnd, int update)
 Applies a Laplacian smoothing to the 3D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. See WlzCMeshLaplacianSmooth(). More...
 
WlzErrorNum WlzCMeshLPFilter (WlzCMeshP mesh, double kPB, double kSB, double dPB, double dSB, int maxItr, int doBnd, int update)
 Applies a low pass filter to the mesh in which nodes are moved. If a node is on a boundary of the mesh then it is moved on the boundary. Before calling this function all nodes must have had the boundary node flag bit set or cleared appropriately. This function should not significantly shrink meshes because it applies a low pass filter. More...
 
WlzErrorNum WlzCMeshLPFilterLM (WlzCMeshP mesh, double lambda, double mu, int nItr, int doBnd, int update)
 Applies a low pass filter to the geometry of the given mesh. See WlzGMFilterGeomLPLM(). This will change the boundary node/element flags. More...
 
WlzErrorNum WlzCMeshSetVertices (WlzCMeshP mesh, WlzVertexP vtxBuf, int update)
 Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. Vertex type must be correct for mesh type, ie WlzDVertex2 for WlzCMesh2D and WlzDVertex3 for WlzCMesh3D. More...
 
void WlzCMeshSetVertices2D (WlzCMesh2D *mesh, WlzDVertex2 *vtxBuf, int update)
 Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. The parameters are assumed vaild. More...
 
void WlzCMeshSetVertices3D (WlzCMesh3D *mesh, WlzDVertex3 *vtxBuf, int update)
 Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. The parameters are assumed vaild. More...
 
WlzErrorNum WlzCMeshVerify (WlzCMeshP mesh, void **dstElm, int allErr, FILE *fP)
 Checks that the 2D or 3D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults. More...
 
WlzErrorNum WlzCMeshVerify2D (WlzCMesh2D *mesh, WlzCMeshElm2D **dstElm, int allErr, FILE *fP)
 Checks that the 2D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults. More...
 
WlzErrorNum WlzCMeshVerify2D5 (WlzCMesh2D5 *mesh, WlzCMeshElm2D5 **dstElm, int allErr, FILE *fP)
 Checks that the 2D5 mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults. More...
 
WlzErrorNum WlzCMeshVerify3D (WlzCMesh3D *mesh, WlzCMeshElm3D **dstElm, int allErr, FILE *fP)
 Checks that the 3D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults. More...
 
WlzErrorNum WlzCMeshCmpElmFeat (WlzCMeshP mesh, int *dstNElm, int **dstIdx, double **dstVol, double **dstMinLen, double **dstMaxLen)
 Computes some simple geometric features of all valid elements in a mesh. More...
 
WlzErrorNum WlzCMeshCmpElmFeat2D (WlzCMesh2D *mesh, int *dstNElm, int **dstIdx, double **dstVol, double **dstMinLen, double **dstMaxLen)
 Computes some simple geometric features of all valid elements in a 2D mesh. More...
 
WlzErrorNum WlzCMeshCmpElmFeat3D (WlzCMesh3D *mesh, int *dstNElm, int **dstIdx, double **dstVol, double **dstMinLen, double **dstMaxLen)
 Computes some simple geometric features of all valid elements in a 3D mesh. More...
 
double WlzCMeshElmSnArea22D (WlzCMeshElm2D *elm)
 Computes twice the signed area of the 2D mesh element. More...
 
double WlzCMeshElmSqArea22D5 (WlzCMeshElm2D5 *elm)
 Computes twice the square of te area of the 2D5 mesh element. More...
 
double WlzCMeshElmSnVolume63D (WlzCMeshElm3D *elm)
 Computes six times the signed volume of the 3D mesh element. More...
 
void WlzCMeshElmGetNodes2D (WlzCMeshElm2D *elm, WlzCMeshNod2D **dstNod0, WlzCMeshNod2D **dstNod1, WlzCMeshNod2D **dstNod2)
 Gets the three nodes of a 2D element. More...
 
void WlzCMeshElmGetNodes2D5 (WlzCMeshElm2D5 *elm, WlzCMeshNod2D5 **dstNod0, WlzCMeshNod2D5 **dstNod1, WlzCMeshNod2D5 **dstNod2)
 Gets the three nodes of a 2D5 element. More...
 
void WlzCMeshElmGetNodes3D (WlzCMeshElm3D *elm, WlzCMeshNod3D **dstNod0, WlzCMeshNod3D **dstNod1, WlzCMeshNod3D **dstNod2, WlzCMeshNod3D **dstNod3)
 Gets the four nodes of a 3D element. More...
 
WlzDBox2 WlzCMeshElmBBox2D (WlzCMeshElm2D *elm)
 Gets the axis aligned bounding box of a 2D element. More...
 
WlzDBox3 WlzCMeshElmBBox2D5 (WlzCMeshElm2D5 *elm)
 Gets the axis aligned bounding box of a 3D element. More...
 
WlzDBox3 WlzCMeshElmBBox3D (WlzCMeshElm3D *elm)
 Gets the axis aligned bounding box of a 3D element. More...
 
int WlzCMeshElmUseNod3D (WlzCMeshNod3D *gNod, int *gMaxElm, int **gElmIdxAry, WlzErrorNum *dstErr)
 Finds the elements which use the given node and returns their indices in an array. The indices are unique and in acending order. The array will be resized as needed. More...
 
WlzCMeshP WlzCMeshCopy (WlzCMeshP gvnMesh, int squeeze, size_t datSz, AlcVector **newDat, AlcVector *gvnDat, WlzErrorNum *dstErr)
 Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored. More...
 
WlzCMesh2DWlzCMeshCopy2D (WlzCMesh2D *gvnMesh, int squeeze, size_t datSz, AlcVector **newDat, AlcVector *gvnDat, WlzErrorNum *dstErr)
 Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored. More...
 
WlzCMesh2D5WlzCMeshCopy2D5 (WlzCMesh2D5 *gvnMesh, int squeeze, size_t datSz, AlcVector **newDat, AlcVector *gvnDat, WlzErrorNum *dstErr)
 Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored. More...
 
WlzCMesh3DWlzCMeshCopy3D (WlzCMesh3D *gvnMesh, int squeeze, size_t datSz, AlcVector **newDat, AlcVector *gvnDat, WlzErrorNum *dstErr)
 Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored. More...
 
WlzErrorNum WlzCMeshFixNegativeElms (WlzCMeshP mesh)
 Reorders nodes in any elements which have negative area. More...
 
WlzErrorNum WlzCMeshFixNegativeElms2D (WlzCMesh2D *mesh)
 Reorders nodes in any elements which have negative area. More...
 
WlzErrorNum WlzCMeshFixNegativeElms3D (WlzCMesh3D *mesh)
 Reorders nodes in any elements which have negative area. More...
 
void WlzCMeshGetCellStats (WlzCMeshP mesh, int *dstMinNodPerCell, int *dstMaxNodPerCell, double *dstMeanNodPerCell, int *dstMinElmPerCell, int *dstMaxElmPerCell, double *dstMeanElmPerCell)
 Computes simple mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated. More...
 
void WlzCMeshGetCellStats2D (WlzCMesh2D *mesh, int *dstMinNodPerCell, int *dstMaxNodPerCell, double *dstMeanNodPerCell, int *dstMinElmPerCell, int *dstMaxElmPerCell, double *dstMeanElmPerCell)
 Computes simple 2D mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated. More...
 
void WlzCMeshGetCellStats3D (WlzCMesh3D *mesh, int *dstMinNodPerCell, int *dstMaxNodPerCell, double *dstMeanNodPerCell, int *dstMinElmPerCell, int *dstMaxElmPerCell, double *dstMeanElmPerCell)
 Computes simple 3D mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated. More...
 
int * WlzCMeshMakeNodIdxTbl2D (WlzCMesh2D *mesh, int *dstNNod)
 Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh. More...
 
int * WlzCMeshMakeNodIdxTbl2D5 (WlzCMesh2D5 *mesh, int *dstNNod)
 Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh. More...
 
int * WlzCMeshMakeNodIdxTbl3D (WlzCMesh3D *mesh, int *dstNNod)
 Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh. More...
 
int WlzCMeshSetNodIdxTbl2D (WlzCMesh2D *mesh, int *idxTb)
 Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh. More...
 
int WlzCMeshSetNodIdxTbl2D5 (WlzCMesh2D5 *mesh, int *idxTb)
 Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh. More...
 
int WlzCMeshSetNodIdxTbl3D (WlzCMesh3D *mesh, int *idxTb)
 Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh. More...
 
int * WlzCMeshMakeElmIdxTbl2D (WlzCMesh2D *mesh, int *dstNElm)
 Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh. More...
 
int * WlzCMeshMakeElmIdxTbl2D5 (WlzCMesh2D5 *mesh, int *dstNElm)
 Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh. More...
 
int * WlzCMeshMakeElmIdxTbl3D (WlzCMesh3D *mesh, int *dstNElm)
 Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh. More...
 
int WlzCMeshSetElmIdxTbl2D (WlzCMesh2D *mesh, int *idxTb)
 Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh. More...
 
int WlzCMeshSetElmIdxTbl2D5 (WlzCMesh2D5 *mesh, int *idxTb)
 Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh. More...
 
int WlzCMeshSetElmIdxTbl3D (WlzCMesh3D *mesh, int *idxTb)
 Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh. More...
 
int WlzCMeshNodNbrCnt2D5 (WlzCMeshNod2D5 *nod)
 Computes the number of nodes directly connected to the given node. More...
 
int WlzCMeshNodRingNodIndices2D (WlzCMeshNod2D *nod, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted. More...
 
int WlzCMeshNodRingNodIndices2D5 (WlzCMeshNod2D5 *nod, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted. More...
 
int WlzCMeshNodRingNodIndices3D (WlzCMeshNod3D *nod, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted. More...
 
int WlzCMeshNodRingElmIndices2D5 (WlzCMeshNod2D5 *nod, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the elements that form a ring or partial rings around the given node. Where members of the ring are immediate neighbours of the given node. The element indices may be unsorted. More...
 
int WlzCMeshElmRingNodIndices2D (WlzCMeshElm2D *elm, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the nodes that form a ring or partial rings around the given element. Where members of the ring are the nodes of the element followed by the immediate edge neighbours of these nodes. The node indices may be unsorted (apart from the element nodes being first and in edge use order) but they will not have duplicates. More...
 
int WlzCMeshElmRingElmIndices2D (WlzCMeshElm2D *elm, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the elements that form a ring around (ie are directly connected to) the given element. The element indices will be partially ordered with the given element's index first, followed by edge connected neighbouring elements and then the remaining node only connected elements. There will not be duplicates. More...
 
int WlzCMeshElmRingElmIndices3D (WlzCMeshElm3D *elm, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the elements that form a ring around (ie are directly connected to) the given element. The element indices will be partially ordered with the given element's index first, followed by face connected neighbouring elements and then the remaining node or edge only connected elements. There will not be duplicates. More...
 
WlzErrorNum WlzCMeshValuesNormalise (WlzObject *cObj, int mapZero, double vZero, double vMin, double vMax, double oFrac)
 Given a conforming mesh with attached values; this function normalises the values to the given range in place. If the zero value is not mapped to a given value explicitly then the the output values will be given using:

\[ V = \frac{U - L}{u - l} (v - l) + L \]

otherwise with the zero value explicitly mapped the values will be

\[ \begin{array}{l} f = \min{\frac{U - V_0}{u}, \frac{L - V_0}{l}} \\ V = f v + V_0 \end{array} \]

Here \(U\) and \(L\) are the required maximum and minimum values on return, \(u\) and \(l\) are the given mesh maximum and minimum values, \(v\) is a given value and \(V\) is a returned value. \(V_0\) is the returned value corresponding to the given value of zero. More...

 
WlzUByteWlzCMeshIndexMaskFromValueRange (WlzObject *obj, double lo, double hi, int in, WlzErrorNum *dstErr)
 Allocates and array of byte values and then sets these to non-zero values for the conforming mesh value indices where the values satisfy the given range test. If either the lower or upper limit is NaN then the test is simply for the conforming meshes values being NaN. More...
 
WlzObjectWlzCMeshValueTransfer (WlzObject *srcObj, WlzObject *tgtObj, WlzPixelV extVal, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Creates a new object with the mesh domain of the target object and (within the domain intersection) the values of the source object. Given a pair of 2, 2.5 or 3D conforming meshes, with both of the same type, a new mesh object is created using the domain of the target and with the value type of the source object. Values are transfered from the source to the target mesh within their intersection. Outside of the intersection values are set to the given external value. More...
 
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 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 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...
 
WlzErrorNum WlzCMeshElmFuse2D (WlzCMesh2D *mesh, WlzCMeshElm2D *gElm)
 Fuses the given element in the mesh. More...
 

Detailed Description

Typedef Documentation

WlzCMeshCbFn

A pointer to a function called to make mesh entity properties. Parameters passed are: mesh, entity, data.

Enumeration Type Documentation

Bit flags for extrapolation via an expanding front. Typedef: WlzCMeshExpFlag.

Enumerator
WLZ_CMESHEXP_FLAG_NONE 
WLZ_CMESHEXP_FLAG_UNKNOWN 

Has unknown value to be extrapolated.

WLZ_CMESHEXP_FLAG_ACTIVE 

Active, being used for extrapolation. If unknown then it's in the queue, if known then it's part of the propagating front and being used for extrapolation.

WLZ_CMESHEXP_FLAG_UPDATED 

Value has been updated through extrapolation.

Possible mesh element conformation actions. Typedef: WlzCMeshConformAction.

Enumerator
WLZ_CMESH_CONFORM_NONE 
WLZ_CMESH_CONFORM_DELETE 
WLZ_CMESH_CONFORM_MODIFY 

Conforming mesh element flags. These are bit masks which are used in a conforming mesh's elements flags. Typedef: WlzCMeshElmFlags.

Enumerator
WLZ_CMESH_ELM_FLAG_NONE 
WLZ_CMESH_ELM_FLAG_BOUNDARY 

Element intersects the boundary of the domain to which it should conform.

WLZ_CMESH_ELM_FLAG_OUTSIDE 

Element is outside the domain to which the mesh should conform.

WLZ_CMESH_ELM_FLAG_KNOWN 

A property of the element is known.

WLZ_CMESH_ELM_FLAG_ALL 

All possible flags, 0xffff decimal representation required for JavaWoolz.

Conforming mesh node flags. These are bit masks which are used in a conforming mesh's node flags. Typedef: WlzCMeshNodFlags.

Enumerator
WLZ_CMESH_NOD_FLAG_NONE 
WLZ_CMESH_NOD_FLAG_ADJUSTED 

Node position adjusted.

WLZ_CMESH_NOD_FLAG_BOUNDARY 

Node is on a boundary of the mesh.

WLZ_CMESH_NOD_FLAG_UPWIND 

Node is upwind of the active region having already been processed.

WLZ_CMESH_NOD_FLAG_ACTIVE 

Node is in the active region and is being processed.

WLZ_CMESH_NOD_FLAG_KNOWN 

Property associated with node is known.

WLZ_CMESH_NOD_FLAG_OUTSIDE 

Node is outside the domain to which the mesh should conform.

WLZ_CMESH_NOD_FLAG_ALL 

All possible flags, 0xffff decimal representation required for JavaWoolz.

Function Documentation

WlzObject* WlzCMeshCurvToImage ( WlzObject inObj,
double  scale,
int  meanCrv,
WlzInterpolationType  interp,
WlzErrorNum dstErr 
)

Creates a new 2D domain object with double values that covers the given WLZ_CMESH_2D5 after it has been flattened by applying it's displacements. The displacements of the mesh must be valid for flattening the mesh as computed by WlzCMeshCompSurfMapConformal(). The curvature values are not normalised and are either the Gaussian or mean mesh curvatures.

Returns
New 2D domain object with double values corresponding to the interpolated mesh curvature or NULL on error.
Parameters
inObjInput object which must be a WLZ_CMESH_2D5 object.
scaleScale factor to use from cmesh to 2D spatial domain.
meanCrvIf non zero the curvatures are the mean rather than the Gaussian curvatures.
interpType of interpolation to use, valid types are: WLZ_INTERPOLATION_NEAREST (value at nearest node of enclosing element), WLZ_INTERPOLATION_LINEAR (barycentric weighted value within the element) or WLZ_INTERPOLATION_ORDER_2 (values of in or on 2nd ring weighted by approximate geodesic distance).
dstErrDestination error pointer, may be NULL.

References AlcVectorItemGet(), _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzCMeshRes::elm, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzCMesh2D::res, _WlzIntervalWSpace::rgtpos, _WlzPixelV::type, _WlzObject::type, _WlzGreyWSpace::u_grintptr, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_CMESH_2D5, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_TAB_RAGR, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_INTERPOLATION_ORDER_2, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WlzCMeshComputeCurvatures(), WlzCMeshElmEnclosingPos2D(), WlzCMeshExtract2D(), WlzCMeshToDomObj(), WlzEndGreyScan(), WlzFreeObj(), WlzGeomInterpolateTri2D(), WlzGreyValueTableType(), WlzIndexedValueGet(), WlzInitGreyScan(), WlzMakeMain(), WlzNewValueTb(), WlzNextGreyInterval(), and _WlzValues::x.

WlzObject* WlzCMeshComputeCurvatures ( WlzObject inObj,
WlzErrorNum dstErr 
)

Creates a new object with the domain of the given object and a new indexed value table which has the curvatures. The curvatures are organized as a pair of double values per node, total curvature first and then the mean curvature.

Returns
New object with the domain of the given object and curvatures in values or NULL on error.
Parameters
inObjInput object which must have a valid WLZ_CMESH_2D5 domain.
dstErrDestination error pointer, may be NULL.

References WLZ_ERR_NONE, WlzCMeshComputeCurvaturesFromNodNorm(), WlzCMeshComputeNormalsElm(), WlzCMeshComputeNormalsNod(), and WlzFreeObj().

Referenced by WlzCMeshCurvToImage().

WlzObject* WlzCMeshComputeNormalsElm ( WlzObject inObj,
WlzErrorNum dstErr 
)

Creates a new object with the domain of the given object and a new indexed value table which has the element normals. The normals are organized as a 3 double values (x, y, z order) per element.

Returns
New object with the domain of the given object and element normals in values or NULL on error.
Parameters
inObjInput object which must have a valid WLZ_CMESH_2D5 domain.
dstErrDestination error pointer, may be NULL.

References AlcVectorItemGet(), _WlzDomain::cm2d5, _WlzDomain::core, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D5::res, _WlzObject::type, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_ELM, WlzCMeshElmGetNodes2D5(), WlzFreeIndexedValues(), WlzFreeObj(), WlzGeomTriangleNormal(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.

Referenced by WlzCMeshComputeCurvatures().

WlzObject* WlzCMeshComputeNormalsNod ( WlzObject inObj,
WlzErrorNum dstErr 
)

Creates a new object with the domain of the given object and a new indexed value table which has the node normals. The normals are organized as a 3 double values (x, y, z order) per node.

Returns
New object with the domain of the given object and node normals in values or NULL on error.
Parameters
inObjInput object which must have a valid WLZ_CMESH_2D5 domain and have an indexed value table with a single normal (3 doubles) attached to each element.
dstErrDestination error pointer, may be NULL.

References AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzDomain::cm2d5, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshNod2D5::edu, _WlzCMeshEdgU2D5::elm, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D5::nnxt, _WlzCMeshRes::nod, _WlzIndexedValues::rank, _WlzCMesh2D5::res, _WlzObject::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_ELM, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SCALE, WLZ_VTX_3_ZERO, WlzFreeIndexedValues(), WlzFreeObj(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.

Referenced by WlzCMeshComputeCurvatures().

WlzObject* WlzCMeshComputeCurvaturesFromNodNorm ( WlzObject inObj,
WlzErrorNum dstErr 
)

Creates a new object with the domain of the given object and a new indexed value table which has the curvatures. The curvatures are organized as a pair of double values per node, total curvature first and then the mean curvature.

Returns
New object with the domain of the given object and curvatures in values or NULL on error.
Parameters
inObjInput object which must have a valid WLZ_CMESH_2D5 domain and have an indexed value table with a single normal (3 doubles) attached to each node.
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcRealloc(), AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzDomain::cm2d5, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D5::pos, _WlzIndexedValues::rank, _WlzCMesh2D5::res, _WlzObject::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_NOD, WlzCMeshNodIsBoundary2D5(), WlzCMeshNodRingNodIndices2D5(), WlzFreeIndexedValues(), WlzFreeObj(), WlzGeomCurvature(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.

Referenced by WlzCMeshComputeCurvatures().

WlzObject* WlzCMeshSetDispFromField ( WlzObject mObj,
WlzObject dObj,
WlzDVertex3  bgd,
WlzInterpolationType  itp,
int  abs,
WlzErrorNum dstErr 
)

Creates a new 2 or 3D constrained mesh object using the domain of the given mesh object (with possible refinement) and creating new values for the domain which are set from the displacement field. Mesh refinement will be done if the fractional error length at element centroids is greater than the given maximum and the resulting element will not have an edge length less than the given minimum and the given element does not have a maximum to minimum edge length ratio greater than two.

Returns
New constrained mesh object with displacements set from the displacement field object or NULL on error.
Parameters
mObjGiven constrained mesh object.
dObjGiven displacement field object which should be a compound array object with the appropriate number of components for the mesh dimension.
bgdBackground displacement for mesh nodes which are outside the given displacement field object.
itpInterpolation method (only WLZ_INTERPOLATION_NEAREST and WLZ_INTERPOLATION_LINEAR are valid).
absNon-zero if the displacements are absolute positions rather than relative displacements.
dstErrDestination error pointer, may be NULL.

References AlcVectorItemGet(), _WlzDomain::cm2, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzGreyV::dbv, _WlzObject::domain, _WlzGreyV::flv, _WlzGreyValueWSpace::gVal, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzGreyV::inv, _WlzCMeshEntRes::maxEnt, _WlzCompoundArray::n, _WlzCMeshRes::nod, _WlzCompoundArray::o, _WlzCMeshNod2D::pos, _WlzCMeshNod3D::pos, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzGreyV::shv, _WlzObject::type, _WlzGreyV::ubv, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_COMPOUND_ARR_1, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_TYPE, WLZ_ERR_INTERPOLATION_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_DATA, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_NINT, WLZ_VALUE_ATTACH_NOD, WlzFreeObj(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueGetCon(), WlzGreyValueMakeWSp(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.

WlzObject* WlzCMeshDispToField ( WlzObject mObj,
WlzDVertex3  bgd,
WlzInterpolationType  itp,
int  invert,
int  abs,
WlzErrorNum dstErr 
)

Creates a new 2 or 3D compound array object with the component displacements of the given mesh interpolated over the mesh domain.

Returns
New displacement field object (a compound array object) or NULL on error.
Parameters
mObjGiven constrained mesh object with displacement values.
bgdBackground displacement for field values outside the given mesh.
itpInterpolation method (only WLZ_INTERPOLATION_NEAREST and WLZ_INTERPOLATION_LINEAR are valid).
invertInvert the transform if non-zero.
absNon-zero if the field displacements absolute positions rather than the relative displacements in the mesh values.
dstErrDestination error pointer, may be NULL.

References AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzCMeshEntP::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzCMeshRes::elm, _WlzGreyP::flp, _WlzCMeshEntCore::idx, _WlzGreyP::inp, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCompoundArray::o, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzGreyP::shp, _WlzPixelV::type, _WlzObject::type, _WlzCoreValues::type, _WlzGreyP::ubp, _WlzGreyP::v, _WlzPixelV::v, _WlzCMeshEntP::v, _WlzObject::values, _WlzIndexedValues::values, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_COMPOUND_ARR_1, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_UNIMPLEMENTED, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INDEXED_VALUES, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_VALUE_ATTACH_ELM, WLZ_VALUE_ATTACH_NOD, WlzAssignObject(), WlzCMeshToDomObj(), WlzCMeshToDomObjValues(), WlzCopyIndexedValues(), WlzFreeObj(), WlzIndexedValueSize(), WlzMakeCompoundArray(), WlzMakeMain(), WlzSetBackground(), and _WlzValues::x.

WlzObject* WlzCMeshExpValues ( WlzObject gObj,
WlzUByte unk,
WlzInterpolationType  itp,
WlzErrorNum dstErr 
)

Given a conforming mesh object with attached values and an array of know node flags this function extrapolates the value of the unknown values.

Returns
New Woolz object sharing the domain of the given object but with new values which are all known or NULL on error.
Parameters
gObjGiven conforming mesh object.
unkArray of unknown value flags which will be modified and must have space for at least the maximum index of the conforming mesh.
itpMethod for extrapolation which must be either WLZ_INTERPOLATION_NEAREST or WLZ_INTERPOLATION_LINEAR.
dstErrDestination error pointer, may be NULL.

References AlcBlockStackFree(), AlcBlockStackNew(), AlcCalloc(), AlcFree(), AlcMalloc(), AlcRealloc(), AlcVectorItemGet(), ALG_MAX, AlgMatrixRectFree(), AlgMatrixRectNew(), AlgMatrixSVDecomp(), _WlzCMeshExpWSp::aMat, _AlgMatrixRect::array, _WlzIndexedValues::attach, _WlzCMeshExpWSp::blocks, _WlzDomain::cm2, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzCMeshP::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzCMeshNod2D::edu, _WlzCMeshNod3D::edu, _AlcBlockStack::elements, _WlzCMeshExpEnt::ent, _WlzCMeshExpWSp::flags, _WlzCMeshExpWSp::head, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzCMeshExpWSp::itp, _WlzCMeshExpWSp::ixv, _WlzCMeshExpWSp::kNbr, _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMeshEntRes::maxEnt, _WlzCMeshExpWSp::maxNbr, _WlzCMeshExpWSp::mesh, _WlzCMeshNodP::n2, _WlzCMeshEntP::n2, _WlzCMeshEntPP::n2, _WlzCMeshNodP::n3, _WlzCMeshEntP::n3, _WlzCMeshEntPP::n3, _WlzCMeshExpWSp::nEnt, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU3D::next, _WlzCMeshExpWSp::nKNbr, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU3D::nod, _WlzCMeshRes::nod, _AlgMatrixRect::nR, _WlzCMeshExpWSp::nUNbr, _WlzCMeshExpWSp::nVec, _WlzCMeshExpEnt::nxt, _WlzCMeshExpWSp::pDst, _WlzCMeshExpWSp::pool, _WlzCMeshNod2D::pos, _WlzCMeshNod3D::pos, _WlzCMeshExpEnt::prv, _WlzIndexedValues::rank, _AlgMatrix::rect, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzCMeshExpWSp::tail, _WlzObject::type, _WlzCoreDomain::type, _WlzCoreValues::type, _WlzCMeshExpWSp::uNbr, _WlzGreyP::v, _WlzCMeshEntPP::v, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzCMeshExpWSp::vMat, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_CMESH_EXP_MEMINC, WLZ_CMESHEXP_FLAG_ACTIVE, WLZ_CMESHEXP_FLAG_UNKNOWN, WLZ_CMESHEXP_FLAG_UPDATED, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_UNIMPLEMENTED, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INDEXED_VALUES, WLZ_INTERPOLATION_NEAREST, WLZ_VALUE_ATTACH_ELM, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_2_LENGTH, WLZ_VTX_2_SUB, WLZ_VTX_3_SUB, WlzCopyValues(), WlzErrorFromAlg(), WlzFreeObj(), WlzIndexedValueGet(), WlzMakeMain(), WlzValueClampGreyIntoGrey(), WlzValueCopyGreyToGrey(), and _WlzValues::x.

WlzObject* WlzCMeshDistance2D ( WlzObject objG,
WlzObjectType  rObjType,
int  nSeeds,
WlzDVertex2 seeds,
WlzInterpolationType  interp,
WlzErrorNum dstErr 
)

Computes a new 2D object with values that are the distance from the given seeds within the given mesh.

Returns
A 2D domain object, an empty object if the mesh has no elements or NULL on error.
Parameters
objGGiven mesh object.
rObjTypeReturn object type must either be WLZ_CMESH_2D or WLZ_2D_DOMAINOBJ.
nSeedsNumber of seed nodes, if \(<\) 1 then all boundary nodes of the given mesh are used as seed nodes.
seedsArray of seed positions, may be NULL iff the number of seed nodes is \(<\) 1. It is an error if are not within the mesh.
interpInterpolation for 3D volumes (should be WLZ_INTERPOLATION_BARYCENTRIC or WLZ_INTERPOLATION_KRIG).
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcMalloc(), _WlzDomain::cm2, _WlzValues::core, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D::res, _WlzObject::type, _WlzCMesh2D::type, WLZ_2D_DOMAINOBJ, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_NOD, WlzCMeshFMarNodes2D(), WlzCMeshToDomObj(), WlzCMeshToDomObjValues(), WlzFreeObj(), WlzIndexedValueExtGet(), WlzIndexedValueGet(), WlzMakeEmpty(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.

WlzObject* WlzCMeshDistance3D ( WlzObject objG,
WlzObjectType  rObjType,
int  nSeeds,
WlzDVertex3 seeds,
WlzInterpolationType  interp,
WlzErrorNum dstErr 
)

Computes a new 3D object with values that are the distance from the given seeds within the given mesh.

Returns
A 3D domain object, an empty object if the mesh has no elements or NULL on error.
Parameters
objGGiven mesh object.
rObjTypeReturn object type must either be WLZ_CMESH_2D or WLZ_2D_DOMAINOBJ.
nSeedsNumber of seed nodes, if \(<\) 1 then all boundary nodes of the given mesh are used as seed nodes.
seedsArray of seed positions, may be NULL iff the number of seed nodes is \(<\) 1. It is an error if are not within the mesh.
interpInterpolation for 3D volumes (should be WLZ_INTERPOLATION_BARYCENTRIC or WLZ_INTERPOLATION_KRIG).
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcMalloc(), _WlzDomain::cm3, _WlzValues::core, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh3D::res, _WlzObject::type, _WlzCMesh3D::type, WLZ_3D_DOMAINOBJ, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_NOD, WlzCMeshFMarNodes3D(), WlzCMeshToDomObj(), WlzCMeshToDomObjValues(), WlzFreeObj(), WlzIndexedValueExtGet(), WlzIndexedValueGet(), WlzMakeEmpty(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.

WlzErrorNum WlzCMeshFMarNodes2D ( WlzCMesh2D mesh,
double *  distances,
int  nSeeds,
WlzDVertex2 seeds 
)

Computes constrained distances within a mesh by propagating wavefronts within a 2D conforming mesh. The wavefronts are propagated from either the mesh boundary or a number of seed positions within the mesh. The given mesh will not be modified.

Returns
Woolz error code.
Parameters
meshGiven mesh.
distancesArray for computed distances.
nSeedsNumber of seed nodes, if \(<\) 1 then all boundary nodes of the given mesh are used as seed nodes.
seedsArray of seed positions, may be NULL iff the number of seed nodes is \(<\) 1. It is an error if any seeds are not within the mesh.

References AlcCalloc(), AlcFree(), AlcHeapAllEntFree(), AlcHeapEntFree(), AlcHeapFree(), AlcHeapNew(), AlcHeapTop(), AlcMalloc(), AlcVectorItemGet(), _WlzCMeshElmP::e2, _WlzCMeshElm2D::edu, _WlzCMeshFMarElmQEnt::elm, _WlzCMeshFMarQEnt::entity, _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::nod, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _AlcHeap::topPriLo, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, WLZ_CMESH_NOD_FLAG_ACTIVE, WLZ_CMESH_NOD_FLAG_KNOWN, WLZ_CMESH_NOD_FLAG_UPWIND, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshCountBoundNodes2D(), WlzCMeshNodIsBoundary2D(), and WlzValueSetDouble().

Referenced by WlzBasisFnGauss2DFromCPts(), WlzBasisFnIMQ2DFromCPts(), WlzBasisFnMQ2DFromCPts(), WlzBasisFnTPS2DFromCPts(), and WlzCMeshDistance2D().

WlzErrorNum WlzCMeshFMarNodes3D ( WlzCMesh3D mesh,
double *  distances,
int  nSeeds,
WlzDVertex3 seeds 
)

Computes constrained distances within a mesh by propagating wavefronts within a 3D conforming mesh. The wavefronts are propagated from either the mesh boundary or a number of seed positions within the mesh. The given mesh will not be modified.

Returns
Woolz error code.
Parameters
meshGiven mesh.
distancesArray for computed distances.
nSeedsNumber of seed nodes, if \(<\) 1 then all boundary nodes of the given mesh are used as seed nodes.
seedsArray of seed positions, may be NULL iff the number of seed nodes is \(<\) 1. It is an error if any seeds are not within the mesh.

References ALC_ER_NONE, AlcCalloc(), AlcFree(), AlcHeapAllEntFree(), AlcHeapEntFree(), AlcHeapFree(), AlcHeapInsertEnt(), AlcHeapNew(), AlcHeapTop(), AlcMalloc(), AlcVectorItemGet(), ALG_M_PI_2, ALG_MIN, _AlcHeap::data, _WlzCMeshElmP::e2, _WlzCMeshElmP::e3, _WlzCMeshNod2D::edu, _WlzCMeshNod3D::edu, _WlzCMeshFace::edu, _WlzCMeshElm2D::edu, _WlzCMeshFMarElmQEnt::elm, _WlzCMeshEdgU2D::elm, _WlzCMeshFace::elm, _WlzCMeshRes::elm, _WlzCMeshFMarQEnt::entity, _WlzCMeshEdgU3D::face, _WlzCMeshElm3D::face, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _AlcHeap::nEnt, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU3D::next, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU3D::nod, _WlzCMeshRes::nod, _WlzCMeshEdgU2D::opp, _WlzCMeshFace::opp, _WlzCMeshNod2D::pos, _WlzCMeshNod3D::pos, _WlzCMeshFMarQEnt::priority, _WlzCMeshFMarElmQEnt::priority, _WlzCMesh2D::res, _WlzCMesh3D::res, _AlcHeap::topPriLo, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_3D, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_CMESH_NOD_FLAG_ACTIVE, WLZ_CMESH_NOD_FLAG_KNOWN, WLZ_CMESH_NOD_FLAG_UPWIND, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_MESH_TOLERANCE, WLZ_VTX_2_ADD, WLZ_VTX_2_LENGTH, WLZ_VTX_2_SCALE, WLZ_VTX_2_SET, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WLZ_VTX_3_ADD3, WLZ_VTX_3_DOT, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SCALE, WLZ_VTX_3_SUB, WlzCMeshCountBoundNodes3D(), WlzCMeshElmEnclosingPos2D(), WlzCMeshElmEnclosingPos3D(), WlzCMeshNodIsBoundary3D(), WlzGeomCos3V(), WlzGeomDist2D(), WlzGeomDist3D(), WlzGeomLineSegmentsIntersect(), WlzGeomLineTriangleIntersect3D(), WlzGeomMap3DTriangleTo2D(), WlzValueSetDouble(), and WlzValueSetUByte().

Referenced by WlzBasisFnIMQ3DFromCPts(), WlzBasisFnMQ3DFromCPts(), and WlzCMeshDistance3D().

WlzObject* WlzCMeshIntersect ( WlzObject obj0,
WlzObject obj1,
int  dsp0,
int **  dstNodTab,
WlzErrorNum dstErr 
)

Computes a new conforming mesh which covers the intersection the two given conforming mesh objects. The new mesh will have the nodes and elements of the first mesh when these are contained in the second mesh.

Returns
New conforming mesh object which covers the intersection of the two given conforming mesh objects.
Parameters
obj0The first conforming mesh object.
obj1The second conforming mesh object.
dsp0If non-zero then use the displaced nodes of the first mesh. be valid node displacements.
dstNodTabDestination pointer for the node index table. This is a look up table from the nodes of tr0 to those of the new conforming mesh with invalid entries being marked with a negative index. May be NULL if not required. A returned node table should be freed using AlcFree().
dstErrDestination error pointer, may be NULL.

References _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzIndexedValues::rank, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, _WlzIndexedValues::vType, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_INDEXED_VALUES, WLZ_VALUE_ATTACH_NOD, WlzMakeMain(), and _WlzValues::x.

Referenced by WlzCMeshProduct().

WlzCMesh2D* WlzCMeshIntersect2Mesh2D ( WlzMeshTransform tr0,
WlzMeshTransform tr1,
int  dsp0,
int **  dstNodTab,
WlzErrorNum dstErr 
)

Computes a new conforming mesh which covers the intersection the two given (convex) mesh objects. The new mesh will have the nodes and elements of the first mesh when these are contained in the second mesh.

Returns
New conforming mesh object which covers the intersection of the two given (convex) mesh objects.
Parameters
tr0The first convex mesh transform.
dsp0Use displaced node positions of the first convex mesh if non null.
tr1The second convex mesh transform.
dsp0Use the displaced node positions of tr0 to find intersection if non-zero. The new node positions are always those of tr0 irespective of the vale of dsp0.
dstNodTabDestination pointer for the node index table. May be NULL. See WlzCMeshIntersect().
dstErrDestination error pointer, may be NULL.

References ALC_ER_NONE, AlcCalloc(), AlcFree(), AlcVectorExtend(), AlcVectorItemGet(), _WlzCMesh2D::bBox, _WlzCMesh3D::bBox, _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzCMeshRes::elm, _WlzMeshElem::flags, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm3D::idx, _WlzMeshElem::idx, _WlzMeshTransform::maxElem, _WlzCMeshEntRes::maxEnt, _WlzMeshTransform::maxNodes, _WlzCMeshRes::nod, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzCMeshNod2D::pos, _WlzCMeshNod3D::pos, _WlzMeshNode::position, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_VTX_2_ADD, WlzCMeshElmEnclosingPos2D(), WlzCMeshElmEnclosingPos3D(), WlzCMeshFree2D(), WlzCMeshFree3D(), WlzCMeshNew2D(), WlzCMeshNew3D(), WlzCMeshNewElm2D(), WlzCMeshNewElm3D(), WlzCMeshNewNod2D(), WlzCMeshNewNod3D(), WlzCMeshReassignGridCells2D(), WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateBBox3D(), WlzCMeshUpdateMaxSqEdgLen2D(), WlzCMeshUpdateMaxSqEdgLen3D(), WlzIndexedValueGet(), WlzMeshElemFindVx(), _WlzDBox2::xMax, _WlzDBox3::xMax, _WlzDBox2::xMin, _WlzDBox3::xMin, _WlzDBox2::yMax, _WlzDBox3::yMax, _WlzDBox2::yMin, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.

Referenced by WlzCMeshMeshMeshProduct().

WlzObject* WlzCMeshIntersectDom2D5 ( WlzObject sObj,
WlzObject cObj,
double  delta,
double  scale,
WlzErrorNum dstErr 
)

Computes the intersection of a 3D spatial domain object with a 2.5D conforming mesh that has displacements to a plane. The result is a 2D domain coresponding to the intersection mapped to the plane.

Returns
New 2D spatial domain obect.
Parameters
sObjObject with 3D spatial domain.
cObjObject with the 2D5 mesh and displacements to a plane.
deltaDistance normal to the surface within which intersection is allowed.
scaleAdditional scale factor from mesh to spatial domain.
dstErrDestination error pointer, may be NULL.

References AlcVectorItemGet(), AlgHeapSortIdx(), _WlzDomain::cm2d5, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshRes::elm, _WlzGreyValueWSpace::gPtr, _WlzCMeshElm2D5::idx, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzPlaneDomain::line1, _WlzCMeshEntRes::maxEnt, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzCMeshNod2D5::pos, _WlzIndexedValues::rank, _WlzCMesh2D5::res, _WlzPixelV::type, _WlzObject::type, _WlzCoreDomain::type, _WlzIndexedValues::type, _WlzCMesh2D5::type, _WlzGreyV::ubv, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_INDEXED_VALUES, WLZ_MESH_TOLERANCE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_THRESH_HIGH, WLZ_VTX_2_SUB, WLZ_VTX_3_ADD, WLZ_VTX_3_SCALE, WLZ_VTX_3_SUB, WLZ_VTX_3_ZERO, WlzAssignObject(), WlzCMeshElmGetNodes2D5(), WlzCMeshExtract2D(), WlzCMeshToDomObj(), WlzFreeObj(), WlzFreeValues(), WlzGeomTriangleAABBIntersect3D(), WlzGeomTriangleNormal(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzIndexedValueGet(), WlzInsideDomain(), WlzMakeMain(), WlzNewValueTb(), WlzThreshold(), and _WlzValues::x.

WlzCMeshNod2D* WlzCMeshNextNod2D ( WlzCMesh2D mesh,
int *  idx,
int  all 
)

Returns the next node in the 2D mesh. Repeatedly calling this function will itterate through all nodes of the mesh. Before starting to itterate through the nodes of a mesh the index should be initialised to zero (or the index value from which to start). On return the index will have been incremented.

Returns
Next node in mesh or NULL one error of if there are no more nodes in the mesh.
Parameters
meshThe given 2D mesh, must be valid.
idxPointer to the index of the next node which should be set to zero at the start of an itteration, must not be NULL.
allNon-zero if invalid nodes are to be returned. If zero non-valid nodes (eg deleted nodes) are skiped.

References AlcVectorItemGet(), _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, and _WlzCMeshEntRes::vec.

WlzCMeshNod3D* WlzCMeshNextNod3D ( WlzCMesh3D mesh,
int *  idx,
int  all 
)

Returns the next node in the 3D mesh. Repeatedly calling this function will itterate through all nodes of the mesh. Before starting to itterate through the nodes of a mesh the index should be initialised to zero (or the index value from which to start). On return the index will have been incremented.

Returns
Next node in mesh or NULL on error or if there are no more nodes in the mesh.
Parameters
meshThe given 3D mesh, must be valid.
idxPointer to the index of the next node which should be set to zero at the start of an itteration, must not be NULL.
allNon-zero if invalid nodes are to be returned. If zero non-valid nodes (eg deleted nodes) are skiped.

References AlcVectorItemGet(), _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, and _WlzCMeshEntRes::vec.

WlzCMeshElm2D* WlzCMeshNextElm2D ( WlzCMesh2D mesh,
int *  idx,
int  all 
)

Returns the next element in the 2D mesh. Repeatedly calling this function will itterate through all elements of the mesh. Before starting to itterate through the elements of a mesh the index should be initialised to zero (or the index value from which to start). On return the index will have been incremented.

Returns
Next element in mesh or NULL one error of if there are no more elements in the mesh.
Parameters
meshThe given 2D mesh, must be valid.
idxPointer to the index of the next element which should be set to zero at the start of an itteration, must not be NULL.
allNon-zero if invalid elements are to be returned. If zero non-valid elements (eg deleted elements) are skiped.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D::res, and _WlzCMeshEntRes::vec.

WlzCMeshElm3D* WlzCMeshNextElm3D ( WlzCMesh3D mesh,
int *  idx,
int  all 
)

Returns the next element in the 3D mesh. Repeatedly calling this function will itterate through all elements of the mesh. Before starting to itterate through the elements of a mesh the index should be initialised to zero (or the index value from which to start). On return the index will have been incremented.

Returns
Next element in mesh or NULL on error or if there are no more elements in the mesh.
Parameters
meshThe given 3D mesh, must be valid.
idxPointer to the index of the next element which should be set to zero at the start of an itteration, must not be NULL.
allNon-zero if invalid elements are to be returned. If zero non-valid elements (eg deleted elements) are skiped.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh3D::res, and _WlzCMeshEntRes::vec.

WlzObject* WlzCMeshToContour ( WlzObject mObj,
double  disp,
WlzErrorNum dstErr 
)

Creates a contour corresponding to the given conforming mesh which must be a 2D5 mesh, ie a surface.

Returns
New contour object corresponding to the given mesh.
Parameters
mObjGiven conforming mesh.
dispScale factor for the displacements, 0.0 implies no displacements, 1.0 implies full displacement.
dstErrDestination error pointer, may be NULL.

References _WlzValues::core, _WlzDomain::core, _WlzDomain::ctr, _WlzObject::domain, _WlzContour::model, WLZ_CONTOUR, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WlzAssignGMModel(), WlzCMeshToGMModel(), WlzFreeContour(), WlzMakeContour(), and WlzMakeMain().

WlzGMModel* WlzCMeshToGMModel ( WlzObject mObj,
double  disp,
WlzErrorNum dstErr 
)

Creates a geometric model corresponding to the given conforming mesh which must be either a 2D or 2D5 mesh, ie a surface. The resulting model will have either have type WLZ_GMMOD_3D (from 2D5) or WLZ_GMMOD_2D (from 2D).

Returns
New geometric model corresponding to the given mesh.
Parameters
mObjGiven conforming mesh.
dispScale factor for the displacements, 0.0 implies no displacements, 1.0 implies full displacement.
dstErrDestination error pointer, may be NULL.

References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, and WLZ_INDEXED_VALUES.

Referenced by WlzCMeshToContour().

WlzObject* WlzCMeshFlatten2D5 ( WlzObject gObj,
WlzErrorNum dstErr 
)

Creates a new 2D conforming mesh object by flattening the given 2D5 conforming mesh object. This is done by applying the 2D5 object's indexed values which are assumed to be valid displacements to a plane. See WlzCMeshCompSurfMap().

Returns
New 2D conforming mesh object.
Parameters
gObjGiven 2D5 conforming mesh object with valid displacements.
dstErrDestination error pointer, may be NULL.

References AlcVectorExtendAndGet(), AlcVectorItemGet(), _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzValues::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshElm2D::edu, _WlzCMeshElm2D5::edu, _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntRes::nextIdx, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D5::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzObject::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_GMMOD_2D, WLZ_GMMOD_3D, WLZ_MESH_TOLERANCE, WlzCMeshFree2D(), WlzCMeshNew2D(), WlzCMeshNewElm2D(), WlzCMeshNewNod2D(), WlzCMeshReassignGridCells2D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateMaxSqEdgLen2D(), WlzFreeObj(), WlzGMModelConstructSimplex2D(), WlzGMModelConstructSimplex3D(), WlzGMModelFree(), WlzGMModelNew(), WlzGMModelRehashVHT(), WlzIndexedValueGet(), WlzMakeMain(), and _WlzValues::x.

WlzObject* WlzCMeshToDomObj ( WlzObject mObj,
int  trans,
double  scale,
WlzErrorNum dstErr 
)

Computes a new domain object, the domain of which corresponds to the region of space enclosed by the mesh, such that the domain object is covered by the given mesh object.

Returns
New domain object or NULL on error.
Parameters
mObjGiven mesh object.
transIf non zero domain corresponds to the transformed (instead of the untransformed mesh). For a transform, the objects values must be appropriate.
scaleAdditional scale factor from mesh to spatial domain.
dstErrDestination error pointer, may be NULL.

References _WlzDomain::core, _WlzObject::domain, _WlzCoreDomain::type, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_INTERPOLATION_NEAREST, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_3D_AFFINE, WlzAffineTransformFromScale(), WlzAffineTransformObj(), WlzFreeAffineTransform(), and WlzFreeObj().

Referenced by WlzCMeshCurvToImage(), WlzCMeshDispToField(), WlzCMeshDistance2D(), WlzCMeshDistance3D(), and WlzCMeshIntersectDom2D5().

WlzObject* WlzCMeshToDomObjValues ( WlzObject dObj,
WlzObject mObj,
WlzInterpolationType  itp,
int  ixi,
WlzErrorNum dstErr 
)

Given a domain object and a mesh object, this function creates a new domain object using the domain of the given object and a new value table. The function then interpolates the mesh values throughout the domain object.

Returns
New domain object (image) with values interpolated from mesh values.
Parameters
dObjGiven domain object.
mObjGiven mesh object.
itpInterpolation method.
ixiIndex into the indexed values.
dstErrDestination error pointer, may be NULL.

References ALC_ER_NONE, AlcBit1Calloc(), AlcCalloc(), AlcFree(), AlcMalloc(), AlcRealloc(), AlcVectorExtend(), AlcVectorExtendAndGet(), AlcVectorFree(), AlcVectorItemGet(), AlcVectorNew(), ALG_MAX, ALG_MIN, AlgMatrixFree(), AlgSort(), _WlzIndexedValues::attach, _WlzGreyValueWSpace::bkdFlag, _AlcVector::blkSz, _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzDomain::cm3, _AlgMatrix::core, _WlzValues::core, _WlzDomain::core, _WlzCMeshScanWSp3D::dBox, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzCMeshScanWSp2D::dElm, _WlzCMeshScanWSp3D::dElm, _WlzIndexedValues::dim, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzCMeshScanItv2D::elmIdx, _WlzCMeshScanItv3D::elmIdx, _WlzCMeshScanElm2D::flags, _WlzCMeshScanElm3D::flags, _WlzGreyP::flp, _WlzGreyV::flv, _WlzGreyValueWSpace::gVal, _WlzDomain::i, _WlzCMeshScanElm2D::idx, _WlzCMeshScanElm3D::idx, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm3D::idx, _WlzGreyP::inp, _WlzGreyV::inv, _WlzDynItvPool::itvBlock, _WlzCMeshScanWSp2D::itvs, _WlzCMeshScanWSp3D::itvs, _WlzDynItvPool::itvsInBlock, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastpl, _WlzCMeshScanItv2D::lftI, _WlzCMeshScanItv3D::lftI, _WlzIntervalWSpace::lftpos, _WlzCMeshScanItv2D::line, _WlzCMeshScanItv3D::line, _WlzIntervalWSpace::linpos, _WlzGreyP::lnp, _WlzGreyV::lnv, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D::maxSqEdgLen, _WlzCMeshScanWSp2D::mTr, _WlzCMeshScanWSp3D::mTr, _WlzCMeshScanWSp2D::nItvs, _WlzCMeshScanWSp3D::nItvs, _WlzCMeshEdgU2D::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzDynItvPool::offset, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzCMeshScanItv3D::plane, _WlzPlaneDomain::plane1, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzCMeshNod3D::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzCMesh3D::res, _WlzGreyV::rgbv, _WlzCMeshScanItv2D::rgtI, _WlzCMeshScanItv3D::rgtI, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzGreyV::shv, _WlzCMeshScanElm3D::tr, _WlzCMeshScanElm2D::trX, _WlzCMeshScanElm2D::trY, _WlzPixelV::type, _WlzObject::type, _WlzCoreValues::type, _WlzRagRValues::type, _WlzIndexedValues::type, _WlzCMesh2D::type, _WlzCMesh3D::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzCMeshEntRes::vec, _WlzValues::vox, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CLAMP, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_CMESH_ELM2D5_GET_NODE_0, WLZ_CMESH_ELM2D5_GET_NODE_1, WLZ_CMESH_ELM2D5_GET_NODE_2, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_CMESH_POS_DTOI, WLZ_CMESH_SCANELM_FWD, WLZ_CMESH_SCANELM_NONE, WLZ_CMESH_SCANELM_REV, WLZ_CMESH_SCANELM_SQUASH, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_INTERPOLATION_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_TYPE, WLZ_ERR_UNIMPLEMENTED, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_INDEXED_VALUES, WLZ_INTERPOLATION_BARYCENTRIC, WLZ_INTERPOLATION_CLASSIFY_1, WLZ_INTERPOLATION_KRIG, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_INTERVALDOMAIN_INTVL, WLZ_KRIG_MODELFN_LINEAR, WLZ_MAX, WLZ_MESH_TOLERANCE, WLZ_MESH_TOLERANCE_SQ, WLZ_NINT, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_RED_GET, WLZ_VALUE_ATTACH_ELM, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_2_ADD, WLZ_VTX_2_LENGTH, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WLZ_VTX_3_ADD, WLZ_VTX_3_CROSS, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, WlzBitLnSetItv(), WlzCMeshElmEnclosingPos2D(), WlzCMeshElmEnclosingPos3D(), WlzCMeshElmRingElmIndices2D(), WlzCMeshElmRingElmIndices3D(), WlzCMeshElmRingNodIndices2D(), WlzCMeshNodRingNodIndices2D(), WlzCMeshTransformGetBBox2D(), WlzDynItvLnFromBitLn(), WlzEndGreyScan(), WlzFreeDomain(), WlzFreeObj(), WlzFreeValueTb(), WlzGeomInterpolateTet3D(), WlzGeomInterpolateTri2D(), WlzGeomTetraAffineSolve(), WlzGeomTriangleAffineSolve(), WlzGeomTriangleSnArea2(), WlzGetBackground(), WlzGreyTableTypeToGreyType(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueGetCon(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzIndexedValueBufWeight(), WlzIndexedValueGet(), WlzInitGreyScan(), WlzKrigOSetModelSV2D(), WlzKrigOSetPosSV2D(), WlzKrigOWeightsSolve(), WlzKrigReallocBuffers2D(), WlzKrigSetModelFn(), WlzMakeEmpty(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzNewValuesVox(), WlzNewValueTb(), WlzNextGreyInterval(), WlzStandardIntervalDomain(), WlzValueConvertPixel(), WlzValueSetDouble(), WlzValueSetInt(), _WlzValues::x, _WlzIBox2::xMax, _WlzDBox2::xMax, _WlzIBox3::xMax, _WlzDBox3::xMax, _WlzIBox2::xMin, _WlzDBox2::xMin, _WlzIBox3::xMin, _WlzDBox3::xMin, _WlzIBox2::yMax, _WlzDBox2::yMax, _WlzIBox3::yMax, _WlzDBox3::yMax, _WlzIBox2::yMin, _WlzDBox2::yMin, _WlzIBox3::yMin, _WlzDBox3::yMin, _WlzIBox3::zMax, _WlzDBox3::zMax, _WlzIBox3::zMin, and _WlzDBox3::zMin.

Referenced by WlzCMeshDispToField(), WlzCMeshDistance2D(), and WlzCMeshDistance3D().

double WlzCMeshElmMaxSqEdgLen2D ( WlzCMeshElm2D elm)

Computes the mesh maximum edge length of the given element.

Returns
Maximum square edge length for the element.
Parameters
elmThe given element.

References _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::nod, _WlzCMeshNod2D::pos, and WlzGeomDistSq2D().

double WlzCMeshElmMaxSqEdgLen2D5 ( WlzCMeshElm2D5 elm)

Computes the mesh maximum edge length of the given element.

Returns
Maximum square edge length for the element.
Parameters
elmThe given element.

References _WlzCMeshElm2D5::edu, _WlzCMeshEdgU2D5::nod, _WlzCMeshNod2D5::pos, and WlzGeomDistSq3D().

double WlzCMeshElmMaxSqEdgLen3D ( WlzCMeshElm3D elm)

Computes the mesh maximum edge length of the given element.

Returns
Maximum square edge length for the element.
Parameters
elmThe given element.

References WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, and WlzGeomDistSq3D().

void WlzCMeshUpdateMaxSqEdgLen2D ( WlzCMesh2D mesh)

Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh.

Parameters
meshThe mesh.

References AlcVectorItemGet(), _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D::maxSqEdgLen, _WlzCMeshEdgU2D::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, and WlzGeomDistSq2D().

Referenced by WlzCMeshAffineProduct(), WlzCMeshAffineTransformMesh2D(), WlzCMeshExtract2D(), WlzCMeshFlatten2D5(), WlzCMeshFromObj2D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshLaplacianSmooth2D(), WlzCMeshLPFilter(), WlzCMeshSetVertices2D(), WlzEffReadObjNodeEle(), WlzEffWritePointsVtkFieldValues(), and WlzReadMeshTransform3D().

void WlzCMeshUpdateMaxSqEdgLen2D5 ( WlzCMesh2D5 mesh)

Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh.

Parameters
meshThe mesh.

References AlcVectorItemGet(), _WlzCMeshElm2D5::edu, _WlzCMeshRes::elm, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D5::maxSqEdgLen, _WlzCMeshEdgU2D5::nod, _WlzCMeshNod2D5::pos, _WlzCMesh2D5::res, _WlzCMesh2D5::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D5, and WlzGeomDistSq3D().

Referenced by WlzCMeshAffineProduct(), WlzCMeshAffineTransformMesh2D5(), WlzCMeshFromGM(), and WlzReadMeshTransform3D().

void WlzCMeshUpdateMaxSqEdgLen3D ( WlzCMesh3D mesh)

Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh.

Parameters
meshThe mesh.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh3D::maxSqEdgLen, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, and WlzGeomDistSq3D().

Referenced by WlzCMeshAffineProduct(), WlzCMeshAffineTransformMesh3D(), WlzCMeshFromObj3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshLaplacianSmooth3D(), WlzCMeshLPFilter(), WlzCMeshSetVertices3D(), WlzEffReadObjEMT(), WlzEffReadObjMesh(), WlzEffReadObjNodeEle(), WlzEffReadObjVMesh(), WlzEffWritePointsVtkFieldValues(), and WlzReadMeshTransform3D().

void WlzCMeshSetNodFlags ( WlzCMeshP  mesh,
unsigned int  flags 
)

Sets the node flags for all valid nodes of the mesh.

Parameters
meshGiven mesh.
flagsFlags to set.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WlzCMeshSetNodFlags2D(), and WlzCMeshSetNodFlags3D().

void WlzCMeshSetNodFlags2D ( WlzCMesh2D mesh,
unsigned int  flags 
)

Sets node flags for all valid nodes of the 2D mesh.

Parameters
meshGiven mesh.
flagsFlags to set.

References AlcVectorItemGet(), _WlzCMeshNod2D::flags, _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, and WLZ_CMESH_2D.

Referenced by WlzCMeshSetNodFlags().

void WlzCMeshSetNodFlags3D ( WlzCMesh3D mesh,
unsigned int  flags 
)

Sets node flags for all valid nodes of the 3D mesh.

Parameters
meshGiven mesh.
flagsFlags to set.

References AlcVectorItemGet(), _WlzCMeshNod3D::flags, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, and WLZ_CMESH_3D.

Referenced by WlzCMeshSetNodFlags().

void WlzCMeshClearNodFlags ( WlzCMeshP  mesh,
unsigned int  flags 
)

Clears the node flags for all valid nodes of the mesh.

Parameters
meshGiven mesh.
flagsFlags to clear.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WlzCMeshClearNodFlags2D(), and WlzCMeshClearNodFlags3D().

void WlzCMeshClearNodFlags2D ( WlzCMesh2D mesh,
unsigned int  flags 
)

Clears node flags for all valid nodes of the 2D mesh.

Parameters
meshGiven mesh.
flagsFlags to clear.

References AlcVectorItemGet(), _WlzCMeshNod2D::flags, _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, and WLZ_CMESH_2D.

Referenced by WlzCMeshClearNodFlags().

void WlzCMeshClearNodFlags3D ( WlzCMesh3D mesh,
unsigned int  flags 
)

Clears node flags for all valid nodes of the 3D mesh.

Parameters
meshGiven mesh.
flagsFlags to clear.

References AlcVectorItemGet(), _WlzCMeshNod3D::flags, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, and WLZ_CMESH_3D.

Referenced by WlzCMeshClearNodFlags().

void WlzCMeshClearElmFlags ( WlzCMeshP  mesh,
unsigned int  flags 
)

Clears the element flags for all valid elements of the mesh.

Parameters
meshGiven mesh.
flagsFlags to clear.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WlzCMeshClearElmFlags2D(), and WlzCMeshClearElmFlags3D().

void WlzCMeshClearElmFlags2D ( WlzCMesh2D mesh,
unsigned int  flags 
)

Clears element flags for all valid elements of the 2D mesh.

Parameters
meshGiven mesh.
flagsFlags to clear.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm2D::flags, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, and WLZ_CMESH_2D.

Referenced by WlzCMeshClearElmFlags().

void WlzCMeshClearElmFlags3D ( WlzCMesh3D mesh,
unsigned int  flags 
)

Clears element flags for all valid elements of the 3D mesh.

Parameters
meshGiven mesh.
flagsFlags to clear.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm3D::flags, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, and WLZ_CMESH_3D.

Referenced by WlzCMeshClearElmFlags().

int WlzCMeshSetBoundNodFlags ( WlzCMeshP  mesh)

Sets or clears the boundary node flag bit for all nodes of the mesh.

Returns
Number of boundary nodes.
Parameters
meshGiven mesh.

References _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WlzCMeshSetBoundNodFlags2D(), WlzCMeshSetBoundNodFlags2D5(), and WlzCMeshSetBoundNodFlags3D().

Referenced by WlzCMeshLPFilterLM().

int WlzCMeshSetBoundNodFlags2D ( WlzCMesh2D mesh)

Sets or clears the boundary node flag bit for all nodes of the 2D mesh.

Returns
Number of boundary nodes.
Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod2D::flags, _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, WLZ_CMESH_NOD_FLAG_BOUNDARY, and WlzCMeshNodIsBoundary2D().

Referenced by WlzCMeshSetBoundNodFlags().

int WlzCMeshSetBoundNodFlags2D5 ( WlzCMesh2D5 mesh)

Sets or clears the boundary node flag bit for all nodes of the 2D5 mesh.

Returns
Number of boundary nodes.
Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod2D5::flags, _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D5::res, _WlzCMesh2D5::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D5, WLZ_CMESH_NOD_FLAG_BOUNDARY, and WlzCMeshNodIsBoundary2D5().

Referenced by WlzCMeshSetBoundNodFlags().

int WlzCMeshSetBoundNodFlags3D ( WlzCMesh3D mesh)

Sets or clears the boundary node flag bit for all nodes of the 3D mesh.

Returns
Number of boundary nodes.
Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod3D::flags, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, WLZ_CMESH_NOD_FLAG_BOUNDARY, and WlzCMeshNodIsBoundary3D().

Referenced by WlzCMeshSetBoundNodFlags().

WlzErrorNum WlzCMeshGetBoundNodes ( WlzCMeshP  mesh,
int *  dstNNod,
int **  dstNod 
)

Gets the indeces of the boundary nodes of the mesh. The boundary nodes will be unordered.

Returns
Woolz error code.
Parameters
meshGiven mesh.
dstNNodReturn pointer for number of boundary nodes, must be non NULL.
dstNodReturn pointer for array of boundary node indices, must be non NULL.

References _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WlzCMeshGetBoundNodes2D(), WlzCMeshGetBoundNodes2D5(), and WlzCMeshGetBoundNodes3D().

WlzErrorNum WlzCMeshGetBoundNodes2D ( WlzCMesh2D mesh,
int *  dstNNod,
int **  dstNod 
)

Gets the indeces of the boundary nodes of the 2D mesh.

Returns
Woolz error code.
Parameters
meshGiven mesh.
dstNNodReturn pointer for number of boundary nodes, must be non NULL.
dstNodReturn pointer for array of boundary node indices, must be non NULL.

References AlcFree(), AlcMalloc(), AlcVectorItemGet(), _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshCountBoundNodes2D(), and WlzCMeshNodIsBoundary2D().

Referenced by WlzCMeshGetBoundNodes().

WlzErrorNum WlzCMeshGetBoundNodes2D5 ( WlzCMesh2D5 mesh,
int *  dstNNod,
int **  dstNod,
int  ordered 
)

Gets the indices of the boundary nodes of the 2D5 mesh.

Returns
Woolz error code.
Parameters
meshGiven mesh.
dstNNodReturn pointer for number of boundary nodes, must be non NULL.
dstNodReturn pointer for array of boundary node indices, must be non NULL.
orderedIf zero gets the indices of all boundary nodes, unordered. If non-zero gets the boundary nodes as a single cycle of node indices, from the first boundary node found.

References AlcFree(), AlcMalloc(), AlcVectorItemGet(), _WlzCMeshNod2D5::edu, _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D5::next, _WlzCMeshEdgU2D5::nnxt, _WlzCMeshEdgU2D5::nod, _WlzCMeshRes::nod, _WlzCMeshEdgU2D5::opp, _WlzCMeshNod2D5::pos, _WlzCMesh2D5::res, _WlzCMesh2D5::type, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshCountBoundNodes2D5(), and WlzCMeshNodIsBoundary2D5().

Referenced by WlzCMeshCompSurfMapToDomain(), and WlzCMeshGetBoundNodes().

WlzErrorNum WlzCMeshGetBoundNodes3D ( WlzCMesh3D mesh,
int *  dstNNod,
int **  dstNod 
)

Gets the indeces of the boundary nodes of the 3D mesh.

Returns
Woolz error code.
Parameters
meshGiven mesh.
dstNNodReturn pointer for number of boundary nodes, must be non NULL.
dstNodReturn pointer for array of boundary node indices, must be non NULL.

References AlcFree(), AlcMalloc(), AlcVectorItemGet(), _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshCountBoundNodes3D(), and WlzCMeshNodIsBoundary3D().

Referenced by WlzCMeshGetBoundNodes().

int WlzCMeshCountBoundNodes ( WlzCMeshP  mesh)

Counts the number of boundary nodes of the mesh.

Returns
Number of boundary nodes.
Parameters
meshGiven mesh.

References _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WlzCMeshCountBoundNodes2D(), WlzCMeshCountBoundNodes2D5(), and WlzCMeshCountBoundNodes3D().

int WlzCMeshCountBoundNodes2D ( WlzCMesh2D mesh)

Counts the number of boundary nodes of the 2D mesh.

Returns
Number of boundary nodes.
Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, and WlzCMeshNodIsBoundary2D().

Referenced by WlzCMeshCountBoundNodes(), WlzCMeshFMarNodes2D(), and WlzCMeshGetBoundNodes2D().

int WlzCMeshCountBoundNodes2D5 ( WlzCMesh2D5 mesh)

Counts the number of boundary nodes of the 2D5 mesh.

Returns
Number of boundary nodes.
Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D5::res, _WlzCMesh2D5::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D5, and WlzCMeshNodIsBoundary2D5().

Referenced by WlzCMeshCountBoundNodes(), and WlzCMeshGetBoundNodes2D5().

int WlzCMeshCountBoundNodes3D ( WlzCMesh3D mesh)

Counts the number of boundary nodes of the 3D mesh.

Returns
Number of boundary nodes.
Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, and WlzCMeshNodIsBoundary3D().

Referenced by WlzCMeshCountBoundNodes(), WlzCMeshFMarNodes3D(), and WlzCMeshGetBoundNodes3D().

int WlzCMeshSetBoundElmFlags ( WlzCMeshP  mesh)

Sets or clears the boundary element flag bit for all elements of the mesh.

Returns
Number of boundary elements.
Parameters
meshGiven mesh.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WlzCMeshSetBoundElmFlags2D(), and WlzCMeshSetBoundElmFlags3D().

int WlzCMeshSetBoundElmFlags2D ( WlzCMesh2D mesh)

Sets or clears the boundary element flag bit for all elements of the 2D mesh.

Returns
Number of boundary elements.
Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm2D::flags, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, WLZ_CMESH_ELM_FLAG_BOUNDARY, and WlzCMeshElmIsBoundary2D().

Referenced by WlzCMeshSetBoundElmFlags().

int WlzCMeshSetBoundElmFlags3D ( WlzCMesh3D mesh)

Sets or clears the boundary element flag bit for all elements of the 3D mesh.

Returns
Number of boundary elements.
Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm3D::flags, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, WLZ_CMESH_ELM_FLAG_BOUNDARY, and WlzCMeshElmIsBoundary3D().

Referenced by WlzCMeshSetBoundElmFlags().

int WlzCMeshNodIsBoundary2D ( WlzCMeshNod2D nod)

Checks whether the node is a boundary node by examining the edges which use the node. If one of these edges does not have an opposite edge (other than itself) the node is a boundary node.

Returns
Non-zero if the node is a boundary node.
Parameters
nodGiven node of mesh.

References _WlzCMeshNod2D::edu, _WlzCMeshNod2D::idx, _WlzCMeshEdgU2D::nnxt, and _WlzCMeshEdgU2D::opp.

Referenced by WlzCMeshCountBoundNodes2D(), WlzCMeshFMarNodes2D(), WlzCMeshGetBoundNodes2D(), and WlzCMeshSetBoundNodFlags2D().

int WlzCMeshNodIsBoundary2D5 ( WlzCMeshNod2D5 nod)

Checks whether the node is a boundary node by examining the edges which use the node. If one of these edges does not have an opposite edge (other than itself) the node is a boundary node.

Returns
Non-zero if the node is a boundary node.
Parameters
nodGiven node of mesh.

References _WlzCMeshNod2D5::edu, _WlzCMeshNod2D5::idx, _WlzCMeshEdgU2D5::nnxt, and _WlzCMeshEdgU2D5::opp.

Referenced by WlzCMeshComputeCurvaturesFromNodNorm(), WlzCMeshCountBoundNodes2D5(), WlzCMeshGetBoundNodes2D5(), and WlzCMeshSetBoundNodFlags2D5().

int WlzCMeshNodIsBoundary3D ( WlzCMeshNod3D nod)

Checks whether the node is a boundary node by examining the faces which use the node. If one of these faces does not have an opposite face (other than itself) the node is a boundary node.

Returns
Non-zero if the node is a boundary node.
Parameters
nodGiven node of mesh.

References _WlzCMeshNod3D::edu, _WlzCMeshEdgU3D::face, _WlzCMeshNod3D::idx, _WlzCMeshEdgU3D::nnxt, and _WlzCMeshFace::opp.

Referenced by WlzCMeshCountBoundNodes3D(), WlzCMeshFMarNodes3D(), WlzCMeshGetBoundNodes3D(), and WlzCMeshSetBoundNodFlags3D().

int WlzCMeshElmIsBoundary2D ( WlzCMeshElm2D elm)

Checks whether the element is a boundary node by examining the edges for opposite edges.

Returns
Non-zero if the element is a boundary element.
Parameters
elmGiven element of mesh.

References _WlzCMeshElm2D::edu, and _WlzCMeshEdgU2D::opp.

Referenced by WlzCMeshSetBoundElmFlags2D().

int WlzCMeshElmIsBoundary3D ( WlzCMeshElm3D elm)

Checks whether the element is a boundary node by examining the faces for opposite faces.

Returns
Non-zero if the element is a boundary element.
Parameters
elmGiven element of mesh.

References _WlzCMeshElm3D::face, and _WlzCMeshFace::opp.

Referenced by WlzCMeshSetBoundElmFlags3D().

WlzErrorNum WlzCMeshLaplacianSmooth ( WlzCMeshP  mesh,
int  itr,
double  alpha,
int  doBnd,
int  update 
)

Applies a Laplacian smoothing to the 2D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. If a node is on a boundary of the mesh then it is moved on the boundary, ie to the centroid of it's neighboring boundary nodes. Before calling this function all nodes must have had the boundary node flag bit set or cleared appropriately. This function will shrink meshes when the boundary parameter is set.

Returns
Woolz error code.
    Each node at position \form#166 is moved to \form#167:

\[ p'_i = (1 - \alpha)p_i + \frac{\alpha}{n}\sum_{j}^{n}{p_{ij}} \]

where \(\alpha\) is the weight factor.
Parameters
meshGiven mesh.
itrNumber of iterations.
alphaWeight factor.
doBndApply smoothing to boundary nodes if non-zero.
updateUpdate the mesh bucket grid and maximum edge length.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WlzCMeshLaplacianSmooth2D(), and WlzCMeshLaplacianSmooth3D().

WlzErrorNum WlzCMeshLaplacianSmooth2D ( WlzCMesh2D mesh,
int  itr,
double  alpha,
int  doBnd,
int  update 
)

Applies a Laplacian smoothing to the 2D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. See WlzCMeshLaplacianSmooth().

Returns
Woolz error code.
Parameters
meshGiven mesh.
itrNumber of iterations.
alphaWeight factor.
doBndApply smoothing to boundary nodes if non-zero.
updateUpdate the mesh bucket grid and maximum edge length.

References AlcVectorItemGet(), _WlzCMeshNod2D::edu, _WlzCMeshNod2D::flags, _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_CMESH_2D, WLZ_CMESH_NOD_FLAG_BOUNDARY, WLZ_ERR_NONE, WlzCMeshReassignGridCells2D(), WlzCMeshUpdateBBox2D(), and WlzCMeshUpdateMaxSqEdgLen2D().

Referenced by WlzCMeshLaplacianSmooth().

WlzErrorNum WlzCMeshLaplacianSmooth3D ( WlzCMesh3D mesh,
int  itr,
double  alpha,
int  doBnd,
int  update 
)

Applies a Laplacian smoothing to the 3D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. See WlzCMeshLaplacianSmooth().

Returns
Woolz error code.
Parameters
meshGiven mesh.
itrNumber of iterations.
alphaWeight factor.
doBndApply smoothing to boundary nodes if non-zero.
updateUpdate the mesh bucket grid and maximum edge length.

References AlcVectorItemGet(), _WlzCMeshNod3D::edu, _WlzCMeshNod3D::flags, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU3D::next, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU3D::nod, _WlzCMeshRes::nod, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_3D, WLZ_CMESH_NOD_FLAG_BOUNDARY, WLZ_ERR_NONE, WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox3D(), and WlzCMeshUpdateMaxSqEdgLen3D().

Referenced by WlzCMeshLaplacianSmooth().

WlzErrorNum WlzCMeshLPFilter ( WlzCMeshP  mesh,
double  kPB,
double  kSB,
double  dPB,
double  dSB,
int  maxItr,
int  doBnd,
int  update 
)

Applies a low pass filter to the mesh in which nodes are moved. If a node is on a boundary of the mesh then it is moved on the boundary. Before calling this function all nodes must have had the boundary node flag bit set or cleared appropriately. This function should not significantly shrink meshes because it applies a low pass filter.

Returns
Woolz error code.
Parameters
meshGiven mesh.
kPBThe band pass frequency parameter.
kSBThe band stop frequency parameter.
dPBThe pass band maximum deviation.
dSBThe stop band maximum deviation.
maxItrMaximum number of iterations.
doBndApply smoothing to boundary nodes if non-zero.
updateUpdate the mesh bucket grid and maximum edge length.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_NONE, WlzCMeshLPFilterLM(), WlzCMeshReassignGridCells2D(), WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateBBox3D(), WlzCMeshUpdateMaxSqEdgLen2D(), WlzCMeshUpdateMaxSqEdgLen3D(), and WlzGMFilterGeomLPParam().

WlzErrorNum WlzCMeshLPFilterLM ( WlzCMeshP  mesh,
double  lambda,
double  mu,
int  nItr,
int  doBnd,
int  update 
)

Applies a low pass filter to the geometry of the given mesh. See WlzGMFilterGeomLPLM(). This will change the boundary node/element flags.

Returns
Woolz error code.
Parameters
meshGiven mesh.
lambdaPositive filter parameter.
muNegative filter parameter.
nItrNumber of itterations.
doBndFilter boundary nodes in non-zero.
updateUpdate the mesh bucket grid, bounding box and maximum edge length.

References AlcMalloc(), _WlzVertexP::d2, _WlzVertexP::d3, _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WlzCMeshSetBoundNodFlags(), WlzCMeshSetVertices(), and WlzDVerticesFromCMesh().

Referenced by WlzCMeshLPFilter().

WlzErrorNum WlzCMeshSetVertices ( WlzCMeshP  mesh,
WlzVertexP  vtxBuf,
int  update 
)

Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. Vertex type must be correct for mesh type, ie WlzDVertex2 for WlzCMesh2D and WlzDVertex3 for WlzCMesh3D.

Returns
Woolz error code.
Parameters
meshThe given mesh.
vtxBufThe buffer with vnode positions that are to be set in the model.
updateUpdate the mesh bucket grid, bounding box and maximum edge length.

References _WlzVertexP::d2, _WlzVertexP::d3, _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzVertexP::v, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshSetVertices2D(), and WlzCMeshSetVertices3D().

Referenced by WlzCMeshLPFilterLM().

void WlzCMeshSetVertices2D ( WlzCMesh2D mesh,
WlzDVertex2 vtxBuf,
int  update 
)

Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. The parameters are assumed vaild.

Parameters
meshThe given mesh.
vtxBufThe buffer with vnode positions that are to be set in the model.
updateUpdate the mesh bucket grid, bounding box and maximum edge length.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzCMeshEntRes::vec, WlzCMeshReassignGridCells2D(), WlzCMeshUpdateBBox2D(), and WlzCMeshUpdateMaxSqEdgLen2D().

Referenced by WlzCMeshSetVertices().

void WlzCMeshSetVertices3D ( WlzCMesh3D mesh,
WlzDVertex3 vtxBuf,
int  update 
)

Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. The parameters are assumed vaild.

Parameters
meshThe given mesh.
vtxBufThe buffer with vnode positions that are to be set in the model.
updateUpdate the mesh bucket grid, bounding box and maximum edge length.

References AlcVectorItemGet(), _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzCMeshEntRes::vec, WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox3D(), and WlzCMeshUpdateMaxSqEdgLen3D().

Referenced by WlzCMeshSetVertices().

WlzErrorNum WlzCMeshVerify ( WlzCMeshP  mesh,
void **  dstElm,
int  allErr,
FILE *  fP 
)

Checks that the 2D or 3D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults.

Returns
Woolz error code.
Parameters
meshGiven mesh.
dstElmDestination mesh element pointer for last mesh element, may be NULL.
allErrIf non zero the checking conmtinues after an error has been found, else if zero the checking stops after the first error has been found.
fPStream for diagnostic output statements - may be NULL in which case there will be no diagnostic output.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WlzCMeshVerify2D(), and WlzCMeshVerify3D().

WlzErrorNum WlzCMeshVerify2D ( WlzCMesh2D mesh,
WlzCMeshElm2D **  dstElm,
int  allErr,
FILE *  fP 
)

Checks that the 2D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults.

Returns
Woolz error code.
Parameters
meshGiven mesh.
dstElmDestination mesh element pointer for last mesh element, may be NULL.
allErrIf non zero the checking conmtinues after an error has been found, else if zero the checking stops after the first error has been found.
fPStream for diagnostic output statements - may be NULL in which case there will be no diagnostic output.

References AlcVectorItemGet(), _WlzCMeshCellGrid2D::cells, _WlzCMesh2D::cGrid, _WlzCMeshNod2D::edu, _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshElm2D::idx, _WlzCMeshCellGrid2D::nCells, _WlzCMeshNod2D::next, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshCell2D::nod, _WlzCMeshRes::nod, _WlzCMeshEdgU2D::opp, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE_SQ, and WlzCMeshElmSnArea22D().

Referenced by WlzCMeshBoundConform2D(), WlzCMeshDelElm2D(), WlzCMeshFromBalLBTDom3D(), WlzCMeshVerify(), and WlzReadMeshTransform3D().

WlzErrorNum WlzCMeshVerify2D5 ( WlzCMesh2D5 mesh,
WlzCMeshElm2D5 **  dstElm,
int  allErr,
FILE *  fP 
)

Checks that the 2D5 mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults.

Returns
Woolz error code.
Todo:
This function has yet to be implemented.
Parameters
meshGiven mesh.
dstElmDestination mesh element pointer for last mesh element, may be NULL.
allErrIf non zero the checking conmtinues after an error has been found, else if zero the checking stops after the first error has been found.
fPStream for diagnostic output statements - may be NULL in which case there will be no diagnostic output.

References _WlzCMesh2D5::type, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, and WLZ_ERR_UNIMPLEMENTED.

Referenced by WlzCMeshDelElm2D5(), and WlzReadMeshTransform3D().

WlzErrorNum WlzCMeshVerify3D ( WlzCMesh3D mesh,
WlzCMeshElm3D **  dstElm,
int  allErr,
FILE *  fP 
)

Checks that the 3D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults.

Returns
Woolz error code.
Parameters
meshGiven mesh.
dstElmDestination mesh element pointer for last mesh element, may be NULL.
allErrIf non zero the checking conmtinues after an error has been found, else if zero the checking stops after the first error has been found.
fPStream for diagnostic output statements - may be NULL in which case there will be no diagnostic output.

References AlcVectorItemGet(), _WlzCMeshNod3D::edu, _WlzCMeshFace::edu, _WlzCMeshFace::elm, _WlzCMeshRes::elm, _WlzCMeshEdgU3D::face, _WlzCMeshElm3D::face, _WlzCMeshNod3D::idx, _WlzCMeshElm3D::idx, _WlzCMeshEdgU3D::next, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU3D::nod, _WlzCMeshFace::opp, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE_SQ, and WlzCMeshElmSnVolume63D().

Referenced by WlzCMeshBoundConform3D(), WlzCMeshDelElm3D(), WlzCMeshFromBalLBTDom3D(), and WlzCMeshVerify().

WlzErrorNum WlzCMeshCmpElmFeat ( WlzCMeshP  mesh,
int *  dstNElm,
int **  dstIdx,
double **  dstVol,
double **  dstMinLen,
double **  dstMaxLen 
)

Computes some simple geometric features of all valid elements in a mesh.

Returns
Woolz error code.
Parameters
meshGiven mesh.
dstNElmDestination pointer for the number of mesh elements. May be NULL.
dstIdxDestination pointer for element indices. May be NULL.
dstVolDestination pointer for the area or volume of the elements. May be NULL.
dstMinLenDestination pointer for the minimum edge length of the elements.
dstMaxLenDestination pointer for the minimum edge length of the elements. May be NULL.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WlzCMeshCmpElmFeat2D(), and WlzCMeshCmpElmFeat3D().

WlzErrorNum WlzCMeshCmpElmFeat2D ( WlzCMesh2D mesh,
int *  dstNElm,
int **  dstIdx,
double **  dstVol,
double **  dstMinLen,
double **  dstMaxLen 
)

Computes some simple geometric features of all valid elements in a 2D mesh.

Returns
Woolz error code.
Parameters
meshGiven 2D mesh.
dstNElmDestination pointer for the number of mesh elements. May be NULL.
dstIdxDestination pointer for element indices. May be NULL.
dstVolDestination pointer for the area or volume of the elements. May be NULL.
dstMinLenDestination pointer for the minimum edge length of the elements.
dstMaxLenDestination pointer for the minimum edge length of the elements. May be NULL.

References AlcCalloc(), AlcVectorItemGet(), AlgRankSelectD(), _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, and WlzGeomTriangleSnArea2().

Referenced by WlzCMeshCmpElmFeat().

WlzErrorNum WlzCMeshCmpElmFeat3D ( WlzCMesh3D mesh,
int *  dstNElm,
int **  dstIdx,
double **  dstVol,
double **  dstMinLen,
double **  dstMaxLen 
)

Computes some simple geometric features of all valid elements in a 3D mesh.

Returns
Woolz error code.
Parameters
meshGiven 3D mesh.
dstNElmDestination pointer for the number of mesh elements. May be NULL.
dstIdxDestination pointer for element indices. May be NULL.
dstVolDestination pointer for the area or volume of the elements. May be NULL.
dstMinLenDestination pointer for the minimum edge length of the elements.
dstMaxLenDestination pointer for the minimum edge length of the elements. May be NULL.

References AlcCalloc(), AlcVectorItemGet(), AlgRankSelectD(), _WlzCMeshRes::elm, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, and WlzGeomTetraSnVolume6().

Referenced by WlzCMeshCmpElmFeat().

double WlzCMeshElmSnArea22D ( WlzCMeshElm2D elm)

Computes twice the signed area of the 2D mesh element.

Returns
Twice the signed area of the 2D mesh element.
Parameters
elmGiven mesh element.

References _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::nod, _WlzCMeshNod2D::pos, and WlzGeomTriangleSnArea2().

Referenced by WlzCMeshCopy2D(), and WlzCMeshVerify2D().

double WlzCMeshElmSqArea22D5 ( WlzCMeshElm2D5 elm)

Computes twice the square of te area of the 2D5 mesh element.

Returns
Twice the square of the area of the 2D5 mesh element.
Parameters
elmGiven mesh element.

References _WlzCMeshElm2D5::edu, _WlzCMeshEdgU2D5::nod, _WlzCMeshNod2D5::pos, and WlzGeomTriangleArea2Sq3().

Referenced by WlzCMeshCopy2D5().

double WlzCMeshElmSnVolume63D ( WlzCMeshElm3D elm)

Computes six times the signed volume of the 3D mesh element.

Returns
Siz times the signed volume of the 3D mesh element.
Parameters
elmGiven mesh element.

References WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, and WlzGeomTetraSnVolume6().

Referenced by WlzCMeshCopy3D(), and WlzCMeshVerify3D().

void WlzCMeshElmGetNodes2D ( WlzCMeshElm2D elm,
WlzCMeshNod2D **  dstNod0,
WlzCMeshNod2D **  dstNod1,
WlzCMeshNod2D **  dstNod2 
)

Gets the three nodes of a 2D element.

Parameters
elmGiven mesh element.
dstNod0First destination pointer for node.
dstNod1Second destination pointer for node.
dstNod2Third destination pointer for node.

References WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, and WLZ_CMESH_ELM2D_GET_NODE_2.

Referenced by WlzBasisFnSetCMesh2D().

void WlzCMeshElmGetNodes2D5 ( WlzCMeshElm2D5 elm,
WlzCMeshNod2D5 **  dstNod0,
WlzCMeshNod2D5 **  dstNod1,
WlzCMeshNod2D5 **  dstNod2 
)

Gets the three nodes of a 2D5 element.

Parameters
elmGiven mesh element.
dstNod0First destination pointer for node.
dstNod1Second destination pointer for node.
dstNod2Third destination pointer for node.

References WLZ_CMESH_ELM2D5_GET_NODE_0, WLZ_CMESH_ELM2D5_GET_NODE_1, and WLZ_CMESH_ELM2D5_GET_NODE_2.

Referenced by WlzCMeshClosePointDom2D5(), WlzCMeshComputeNormalsElm(), WlzCMeshIntersectDom2D5(), WlzEffWriteObjObj(), WlzEffWriteObjPly2(), WlzEffWriteObjSMesh(), and WlzEffWriteObjStl().

void WlzCMeshElmGetNodes3D ( WlzCMeshElm3D elm,
WlzCMeshNod3D **  dstNod0,
WlzCMeshNod3D **  dstNod1,
WlzCMeshNod3D **  dstNod2,
WlzCMeshNod3D **  dstNod3 
)

Gets the four nodes of a 3D element.

Parameters
elmGiven mesh element.
dstNod0First destination pointer for node.
dstNod1Second destination pointer for node.
dstNod2Third destination pointer for node.
dstNod3Forth destination pointer for node.

References WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, and WLZ_CMESH_ELM3D_GET_NODE_3.

Referenced by WlzBasisFnSetCMesh3D(), and WlzEffWriteObjEMT().

WlzDBox2 WlzCMeshElmBBox2D ( WlzCMeshElm2D elm)

Gets the axis aligned bounding box of a 2D element.

Parameters
elmGiven mesh element.

References ALG_MAX3, ALG_MIN3, _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::nod, _WlzCMeshNod2D::pos, _WlzDVertex2::vtX, _WlzDVertex2::vtY, _WlzDBox2::xMax, _WlzDBox2::xMin, _WlzDBox2::yMax, and _WlzDBox2::yMin.

Referenced by WlzCMeshNewNod3D().

WlzDBox3 WlzCMeshElmBBox2D5 ( WlzCMeshElm2D5 elm)
WlzDBox3 WlzCMeshElmBBox3D ( WlzCMeshElm3D elm)
int WlzCMeshElmUseNod3D ( WlzCMeshNod3D gNod,
int *  gMaxElm,
int **  gElmIdxAry,
WlzErrorNum dstErr 
)

Finds the elements which use the given node and returns their indices in an array. The indices are unique and in acending order. The array will be resized as needed.

Returns
Number of elements in array.
Parameters
gNodGiven node.
gMaxElmMaximum space currently allocated in the array.
gElmIdxAryPointer to array of ints, which may be NULL or a valid array for maxElm ints which can be reallocated as needed by AlcRealloc().
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcRealloc(), AlcVectorItemGet(), AlgHeapSort(), AlgHeapSortCmpIFn(), _WlzCMeshNod2D::edu, _WlzCMeshNod3D::edu, _WlzCMeshFace::elm, _WlzCMeshEdgU3D::face, _WlzCMeshNod2D::flags, _WlzCMeshNod3D::flags, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU3D::next, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU3D::nod, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_NOD_FLAG_BOUNDARY, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_VTX_2_ADD, and WLZ_VTX_3_ADD.

WlzCMeshP WlzCMeshCopy ( WlzCMeshP  gvnMesh,
int  squeeze,
size_t  datSz,
AlcVector **  newDat,
AlcVector gvnDat,
WlzErrorNum dstErr 
)

Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored.

Returns
Copy of the given mesh.
Parameters
gvnMeshGiven mesh.
squeezeSqueeze out invalid (deleted entities if non zero).
datSzSize of associated datum.
newDatDestination pointer for the copied associated data, may be NULL.
gvnDatGiven associated data, may be NULL.
dstErrDestination error pointer, may be NULL.

References _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WlzCMeshCopy2D(), WlzCMeshCopy2D5(), and WlzCMeshCopy3D().

Referenced by WlzCopyObject().

WlzCMesh2D* WlzCMeshCopy2D ( WlzCMesh2D gvnMesh,
int  squeeze,
size_t  datSz,
AlcVector **  newDat,
AlcVector gvnDat,
WlzErrorNum dstErr 
)

Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored.

Returns
Copy of the given mesh.
Parameters
gvnMeshGiven mesh.
squeezeSqueeze out invalid (deleted entities if non zero).
datSzSize of associated datum.
newDatDestination pointer for the copied associated data, may be NULL.
gvnDatGiven associated data, may be NULL.
dstErrDestination error pointer, may be NULL.

References ALC_ER_NONE, AlcVectorExtend(), AlcVectorFree(), AlcVectorItemGet(), AlcVectorNew(), _WlzCMesh2D::bBox, _AlcVector::blkSz, _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D::maxSqEdgLen, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE, WLZ_MESH_TOLERANCE_SQ, WlzCMeshAllocElm2D(), WlzCMeshAllocNod2D(), WlzCMeshElmSnArea22D(), WlzCMeshFree2D(), WlzCMeshLocateNod2D(), WlzCMeshNew2D(), WlzCMeshNewElm2D(), WlzCMeshNewNod2D(), and WlzCMeshReassignGridCells2D().

Referenced by WlzAffineTransformIsTranslate(), WlzBasisFnInvertMakeCMeshTr2D(), WlzCMeshCopy(), WlzCMeshTransformManyObjAsIdx(), and WlzCopyDomain().

WlzCMesh2D5* WlzCMeshCopy2D5 ( WlzCMesh2D5 gvnMesh,
int  squeeze,
size_t  datSz,
AlcVector **  newDat,
AlcVector gvnDat,
WlzErrorNum dstErr 
)

Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored.

Returns
Copy of the given mesh.
Parameters
gvnMeshGiven mesh.
squeezeSqueeze out invalid (deleted entities if non zero).
datSzSize of associated datum.
newDatDestination pointer for the copied associated data, may be NULL.
gvnDatGiven associated data, may be NULL.
dstErrDestination error pointer, may be NULL.

References ALC_ER_NONE, AlcVectorExtend(), AlcVectorFree(), AlcVectorItemGet(), AlcVectorNew(), _WlzCMesh2D5::bBox, _AlcVector::blkSz, _WlzCMeshRes::elm, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D5::maxSqEdgLen, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D5::pos, _WlzCMesh2D5::res, _WlzCMesh2D5::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D5, WLZ_CMESH_ELM2D5_GET_NODE_0, WLZ_CMESH_ELM2D5_GET_NODE_1, WLZ_CMESH_ELM2D5_GET_NODE_2, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE, WLZ_MESH_TOLERANCE_SQ, WlzCMeshAllocElm2D5(), WlzCMeshAllocNod2D5(), WlzCMeshElmSqArea22D5(), WlzCMeshFree2D5(), WlzCMeshLocateNod2D5(), WlzCMeshNew2D5(), WlzCMeshNewElm2D5(), WlzCMeshNewNod2D5(), and WlzCMeshReassignGridCells2D5().

Referenced by WlzAffineTransformIsTranslate(), WlzCMeshCopy(), WlzCMeshTransformManyObjAsIdx(), and WlzCopyDomain().

WlzCMesh3D* WlzCMeshCopy3D ( WlzCMesh3D gvnMesh,
int  squeeze,
size_t  datSz,
AlcVector **  newDat,
AlcVector gvnDat,
WlzErrorNum dstErr 
)

Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored.

Returns
Copy of the given mesh.
Parameters
gvnMeshGiven mesh.
squeezeSqueeze out invalid (deleted entities if non zero).
datSzSize of associated datum.
newDatDestination pointer for the copied associated data, may be NULL.
gvnDatGiven associated data, may be NULL.
dstErrDestination error pointer, may be NULL.

References ALC_ER_NONE, AlcVectorExtend(), AlcVectorFree(), AlcVectorItemGet(), AlcVectorNew(), _WlzCMesh3D::bBox, _AlcVector::blkSz, _WlzCMeshRes::elm, _WlzCMeshNod3D::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh3D::maxSqEdgLen, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE, WLZ_MESH_TOLERANCE_SQ, WlzCMeshAllocElm3D(), WlzCMeshAllocNod3D(), WlzCMeshElmSnVolume63D(), WlzCMeshFree3D(), WlzCMeshLocateNod3D(), WlzCMeshNew3D(), WlzCMeshNewElm3D(), WlzCMeshNewNod3D(), and WlzCMeshReassignGridCells3D().

Referenced by WlzAffineTransformIsTranslate(), WlzBasisFnInvertMakeCMeshTr3D(), WlzCMeshCopy(), WlzCMeshTransformManyObjAsIdx(), and WlzCopyDomain().

WlzErrorNum WlzCMeshFixNegativeElms ( WlzCMeshP  mesh)

Reorders nodes in any elements which have negative area.

Returns
Woolz error code.
Parameters
meshThe given constrained mesh.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WlzCMeshFixNegativeElms2D(), and WlzCMeshFixNegativeElms3D().

void WlzCMeshGetCellStats ( WlzCMeshP  mesh,
int *  dstMinNodPerCell,
int *  dstMaxNodPerCell,
double *  dstMeanNodPerCell,
int *  dstMinElmPerCell,
int *  dstMaxElmPerCell,
double *  dstMeanElmPerCell 
)

Computes simple mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated.

Parameters
meshGiven mesh.
dstMinNodPerCellDestination pointer for the minimum number of nodes per cell.
dstMaxNodPerCellDestination pointer for the maximum number of nodes per cell.
dstMeanNodPerCellDestination pointer for the mean number of nodes per cell.
dstMinElmPerCellDestination pointer for the minimum number of nodes per cell.
dstMaxElmPerCellDestination pointer for the maximum number of nodes per cell.
dstMeanElmPerCellDestination pointer for the mean number of nodes per cell.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WlzCMeshGetCellStats2D(), and WlzCMeshGetCellStats3D().

void WlzCMeshGetCellStats2D ( WlzCMesh2D mesh,
int *  dstMinNodPerCell,
int *  dstMaxNodPerCell,
double *  dstMeanNodPerCell,
int *  dstMinElmPerCell,
int *  dstMaxElmPerCell,
double *  dstMeanElmPerCell 
)

Computes simple 2D mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated.

Parameters
meshGiven mesh.
dstMinNodPerCellDestination pointer for the minimum number of nodes per cell.
dstMaxNodPerCellDestination pointer for the maximum number of nodes per cell.
dstMeanNodPerCellDestination pointer for the mean number of nodes per cell.
dstMinElmPerCellDestination pointer for the minimum number of nodes per cell.
dstMaxElmPerCellDestination pointer for the maximum number of nodes per cell.
dstMeanElmPerCellDestination pointer for the mean number of nodes per cell.

References _WlzCMeshCellGrid2D::cells, _WlzCMeshCell2D::cElm, _WlzCMesh2D::cGrid, _WlzCMeshCellGrid2D::nCells, _WlzCMeshNod2D::next, _WlzCMeshCellElm2D::nextCell, _WlzCMeshCell2D::nod, _WlzIVertex2::vtX, and _WlzIVertex2::vtY.

Referenced by WlzCMeshGetCellStats().

void WlzCMeshGetCellStats3D ( WlzCMesh3D mesh,
int *  dstMinNodPerCell,
int *  dstMaxNodPerCell,
double *  dstMeanNodPerCell,
int *  dstMinElmPerCell,
int *  dstMaxElmPerCell,
double *  dstMeanElmPerCell 
)

Computes simple 3D mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated.

Parameters
meshGiven mesh.
dstMinNodPerCellDestination pointer for the minimum number of nodes per cell.
dstMaxNodPerCellDestination pointer for the maximum number of nodes per cell.
dstMeanNodPerCellDestination pointer for the mean number of nodes per cell.
dstMinElmPerCellDestination pointer for the minimum number of nodes per cell.
dstMaxElmPerCellDestination pointer for the maximum number of nodes per cell.
dstMeanElmPerCellDestination pointer for the mean number of nodes per cell.

References _WlzCMeshCellGrid3D::cells, _WlzCMeshCell3D::cElm, _WlzCMesh3D::cGrid, _WlzCMeshCellGrid3D::nCells, _WlzCMeshNod3D::next, _WlzCMeshCellElm3D::nextCell, _WlzCMeshCell3D::nod, _WlzIVertex3::vtX, _WlzIVertex3::vtY, and _WlzIVertex3::vtZ.

Referenced by WlzCMeshGetCellStats().

int* WlzCMeshMakeNodIdxTbl2D ( WlzCMesh2D mesh,
int *  dstNNod 
)

Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh.

Returns
New node index look up table or NULL on error.
Parameters
meshThe mesh.
dstNNodDestination pointer for the number of nodes in the look up table.

References AlcMalloc(), _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, and WlzCMeshSetNodIdxTbl2D().

int* WlzCMeshMakeNodIdxTbl2D5 ( WlzCMesh2D5 mesh,
int *  dstNNod 
)

Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh.

Returns
New node index look up table or NULL on error.
Parameters
meshThe mesh.
dstNNodDestination pointer for the number of nodes in the look up table.

References AlcMalloc(), _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D5::res, and WlzCMeshSetNodIdxTbl2D5().

int* WlzCMeshMakeNodIdxTbl3D ( WlzCMesh3D mesh,
int *  dstNNod 
)

Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh.

Returns
New node index look up table or NULL on error.
Parameters
meshThe mesh.
dstNNodDestination pointer for the number of nodes in the look up table.

References AlcMalloc(), _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, and WlzCMeshSetNodIdxTbl3D().

int WlzCMeshSetNodIdxTbl2D ( WlzCMesh2D mesh,
int *  idxTb 
)

Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh.

Returns
Number of nodes in the look up table.
Parameters
meshThe mesh.
idxTbThe allocated index table to be populated.

References AlcVectorItemGet(), _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshMakeNodIdxTbl2D().

int WlzCMeshSetNodIdxTbl2D5 ( WlzCMesh2D5 mesh,
int *  idxTb 
)

Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh.

Returns
Number of nodes in the look up table.
Parameters
meshThe mesh.
idxTbThe allocated index table to be populated.

References AlcVectorItemGet(), _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D5::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshCompSurfMap(), and WlzCMeshMakeNodIdxTbl2D5().

int WlzCMeshSetNodIdxTbl3D ( WlzCMesh3D mesh,
int *  idxTb 
)

Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh.

Returns
Number of nodes in the look up table.
Parameters
meshThe mesh.
idxTbThe allocated index table to be populated.

References AlcVectorItemGet(), _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshMakeNodIdxTbl3D().

int* WlzCMeshMakeElmIdxTbl2D ( WlzCMesh2D mesh,
int *  dstNElm 
)

Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh.

Returns
New element index look up table or NULL on error.
Parameters
meshThe mesh.
dstNElmDestination pointer for the number of elements in the look up table.

References AlcMalloc(), _WlzCMeshRes::elm, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D::res, and WlzCMeshSetElmIdxTbl2D().

int* WlzCMeshMakeElmIdxTbl2D5 ( WlzCMesh2D5 mesh,
int *  dstNElm 
)

Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh.

Returns
New element index look up table or NULL on error.
Parameters
meshThe mesh.
dstNElmDestination pointer for the number of elements in the look up table.

References AlcMalloc(), _WlzCMeshRes::elm, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D5::res, and WlzCMeshSetElmIdxTbl2D5().

int* WlzCMeshMakeElmIdxTbl3D ( WlzCMesh3D mesh,
int *  dstNElm 
)

Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh.

Returns
New element index look up table or NULL on error.
Parameters
meshThe mesh.
dstNElmDestination pointer for the number of elements in the look up table.

References AlcMalloc(), _WlzCMeshRes::elm, _WlzCMeshEntRes::maxEnt, _WlzCMesh3D::res, and WlzCMeshSetElmIdxTbl3D().

int WlzCMeshSetElmIdxTbl2D ( WlzCMesh2D mesh,
int *  idxTb 
)

Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh.

Returns
Number of elements in the look up table.
Parameters
meshThe mesh.
idxTbThe allocated index table to be populated.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshMakeElmIdxTbl2D().

int WlzCMeshSetElmIdxTbl2D5 ( WlzCMesh2D5 mesh,
int *  idxTb 
)

Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh.

Returns
Number of elements in the look up table.
Parameters
meshThe mesh.
idxTbThe allocated index table to be populated.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D5::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshCompSurfMap(), and WlzCMeshMakeElmIdxTbl2D5().

int WlzCMeshSetElmIdxTbl3D ( WlzCMesh3D mesh,
int *  idxTb 
)

Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh.

Returns
Number of elements in the look up table.
Parameters
meshThe mesh.
idxTbThe allocated index table to be populated.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh3D::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshMakeElmIdxTbl3D().

int WlzCMeshNodNbrCnt2D5 ( WlzCMeshNod2D5 nod)

Computes the number of nodes directly connected to the given node.

Returns
Number of nodes directly connected to the given node (including itself) or zero if the node is invalid.
Parameters
nodGiven node.

References _WlzCMeshNod2D5::edu, _WlzCMeshNod2D5::idx, and _WlzCMeshEdgU2D5::nnxt.

int WlzCMeshNodRingNodIndices2D ( WlzCMeshNod2D nod,
int *  maxIdxBuf,
int **  idxBuf,
WlzErrorNum dstErr 
)

Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted.

Returns
Number of nodes in the ring plus one for the given node or zero on error.
Parameters
nodGiven node which must be valid.
maxIdxBufPointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return.
idxBufPointer to the current node index buffer. This must either be valid or a pointer to a NULL array. The array pointer may be modified on return.
dstErrDestination error pointer, may be NULL.

References AlcRealloc(), _WlzCMeshNod2D::edu, _WlzCMeshNod2D::idx, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D::opp, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.

Referenced by WlzCMeshProduct(), and WlzCMeshToDomObjValues().

int WlzCMeshNodRingNodIndices2D5 ( WlzCMeshNod2D5 nod,
int *  maxIdxBuf,
int **  idxBuf,
WlzErrorNum dstErr 
)

Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted.

Returns
Number of nodes in the ring plus one for the given node or zero on error.
Parameters
nodGiven node which must be valid.
maxIdxBufPointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return.
idxBufPointer to the current node index buffer. This must either be valid or a pointer to a NULL array. The array pointer may be modified on return.
dstErrDestination error pointer, may be NULL.

References AlcRealloc(), _WlzCMeshNod2D5::edu, _WlzCMeshNod2D5::idx, _WlzCMeshEdgU2D5::next, _WlzCMeshEdgU2D5::nnxt, _WlzCMeshEdgU2D5::nod, _WlzCMeshEdgU2D5::opp, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.

Referenced by WlzCMeshComputeCurvaturesFromNodNorm().

int WlzCMeshNodRingNodIndices3D ( WlzCMeshNod3D nod,
int *  maxIdxBuf,
int **  idxBuf,
WlzErrorNum dstErr 
)

Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted.

Returns
Number of nodes in the ring plus one for the given node or zero on error.
Parameters
nodGiven node which must be valid.
maxIdxBufPointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return.
idxBufPointer to the current node index buffer. This must either be valid or a pointer to a NULL array. The array pointer may be modified on return.
dstErrDestination error pointer, may be NULL.

References AlcRealloc(), _WlzCMeshNod3D::edu, _WlzCMeshNod3D::idx, _WlzCMeshEdgU3D::next, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU3D::nod, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.

Referenced by WlzCMeshProduct(), and WlzCMeshTrRegSM3D().

int WlzCMeshNodRingElmIndices2D5 ( WlzCMeshNod2D5 nod,
int *  maxIdxBuf,
int **  idxBuf,
WlzErrorNum dstErr 
)

Gathers the indices of the elements that form a ring or partial rings around the given node. Where members of the ring are immediate neighbours of the given node. The element indices may be unsorted.

Returns
Number of elements in the ring or zero on error.
Parameters
nodGiven node which must be valid.
maxIdxBufPointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return.
idxBufPointer to the current node index buffer. This must either be valid or a pointer to a NULL array. The array pointer may be modified on return.
dstErrDestination error pointer, may be NULL.

References AlcRealloc(), _WlzCMeshNod2D5::edu, _WlzCMeshEdgU2D5::elm, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D5::idx, _WlzCMeshEdgU2D5::nnxt, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.

Referenced by WlzCMeshComputeNormalsIxv2D5().

int WlzCMeshElmRingNodIndices2D ( WlzCMeshElm2D elm,
int *  maxIdxBuf,
int **  idxBuf,
WlzErrorNum dstErr 
)

Gathers the indices of the nodes that form a ring or partial rings around the given element. Where members of the ring are the nodes of the element followed by the immediate edge neighbours of these nodes. The node indices may be unsorted (apart from the element nodes being first and in edge use order) but they will not have duplicates.

Returns
Number of nodes in the ring or zero on error.
Parameters
elmGiven element which must be valid.
maxIdxBufPointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return.
idxBufPointer to the current node index buffer. This must either be valid or a pointer to a NULL array. The array pointer may be modified on return.
dstErrDestination error pointer, may be NULL.

References AlcRealloc(), _WlzCMeshNod2D::edu, _WlzCMeshElm2D::edu, _WlzCMeshNod2D::idx, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D::nod, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.

Referenced by WlzCMeshToDomObjValues().

int WlzCMeshElmRingElmIndices2D ( WlzCMeshElm2D elm,
int *  maxIdxBuf,
int **  idxBuf,
WlzErrorNum dstErr 
)

Gathers the indices of the elements that form a ring around (ie are directly connected to) the given element. The element indices will be partially ordered with the given element's index first, followed by edge connected neighbouring elements and then the remaining node only connected elements. There will not be duplicates.

Returns
Number of elements in the ring or zero on error.
Parameters
elmGiven element which must be valid.
maxIdxBufPointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return.
idxBufPointer to the current element index buffer. This must either be valid or a pointer to a NULL array. The array pointer may be modified on return.
dstErrDestination error pointer, may be NULL.

References AlcRealloc(), _WlzCMeshNod2D::edu, _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::elm, _WlzCMeshElm2D::idx, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D::opp, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.

Referenced by WlzCMeshToDomObjValues().

int WlzCMeshElmRingElmIndices3D ( WlzCMeshElm3D elm,
int *  maxIdxBuf,
int **  idxBuf,
WlzErrorNum dstErr 
)

Gathers the indices of the elements that form a ring around (ie are directly connected to) the given element. The element indices will be partially ordered with the given element's index first, followed by face connected neighbouring elements and then the remaining node or edge only connected elements. There will not be duplicates.

Returns
Number of elements in the ring or zero on error.
Parameters
elmGiven element which must be valid.
maxIdxBufPointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return.
idxBufPointer to the current element index buffer. This must either be valid or a pointer to a NULL array. The array pointer may be modified on return.
dstErrDestination error pointer, may be NULL.

References AlcRealloc(), _WlzCMeshNod3D::edu, _WlzCMeshFace::elm, _WlzCMeshEdgU3D::face, _WlzCMeshElm3D::face, _WlzCMeshElm3D::idx, _WlzCMeshEdgU3D::nnxt, _WlzCMeshFace::opp, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.

Referenced by WlzCMeshToDomObjValues().

WlzErrorNum WlzCMeshValuesNormalise ( WlzObject cObj,
int  mapZero,
double  vZero,
double  vMin,
double  vMax,
double  oFrac 
)

Given a conforming mesh with attached values; this function normalises the values to the given range in place. If the zero value is not mapped to a given value explicitly then the the output values will be given using:

\[ V = \frac{U - L}{u - l} (v - l) + L \]

otherwise with the zero value explicitly mapped the values will be

\[ \begin{array}{l} f = \min{\frac{U - V_0}{u}, \frac{L - V_0}{l}} \\ V = f v + V_0 \end{array} \]

Here \(U\) and \(L\) are the required maximum and minimum values on return, \(u\) and \(l\) are the given mesh maximum and minimum values, \(v\) is a given value and \(V\) is a returned value. \(V_0\) is the returned value corresponding to the given value of zero.

Returns
Woolz error code.
Parameters
cObjConforming mesh object with values to be normalised attached..
mapZeroMap the value of zero to the zero value if non zero.
vZeroValue for zero if mapZero is non-zero.
vMinMinimum value on return.
vMaxMaximum value on return.
oFracOutlier fraction. Assumes that this fraction of the values are extremal outliers and normalises to the range of mesh values minus this fraction at both ends of the value range.

References AlcVectorItemGet(), ALG_MIN, _WlzIndexedValues::attach, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshRes::elm, _WlzGreyP::flp, _WlzCMeshNod3D::idx, _WlzCMeshElm3D::idx, _WlzGreyP::inp, _WlzGreyP::lnp, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzIndexedValues::rank, _WlzCMesh3D::res, _WlzGreyP::shp, _WlzObject::type, _WlzGreyP::ubp, _WlzGreyP::v, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzIndexedValues::vType, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_UNIMPLEMENTED, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INDEXED_VALUES, WLZ_VALUE_ATTACH_ELM, WLZ_VALUE_ATTACH_NOD, WlzIndexedValueGet(), and _WlzValues::x.

WlzUByte* WlzCMeshIndexMaskFromValueRange ( WlzObject obj,
double  lo,
double  hi,
int  in,
WlzErrorNum dstErr 
)

Allocates and array of byte values and then sets these to non-zero values for the conforming mesh value indices where the values satisfy the given range test. If either the lower or upper limit is NaN then the test is simply for the conforming meshes values being NaN.

Returns
Array of bytes set to non zero value when range test is satisfied where the array indices correspond to the indices of the given objects values or NULL on error. The returned array should be freed using AlcFree().
Parameters
objGiven conforming mesh object with values.
loLower limit value of range, may be NaN.
hiUpper limit value of range, may be NaN.
inIf zero set bytes to non-zero when test is not satisfied, otherwise if zero set bytes to non-zero when test is satisfied.
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcFree(), _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzCMeshRes::elm, _WlzGreyP::flp, _WlzGreyP::inp, _WlzGreyP::lnp, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzGreyP::shp, _WlzObject::type, _WlzCoreDomain::type, _WlzGreyP::ubp, _WlzGreyP::v, _WlzObject::values, _WlzIndexedValues::vType, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INDEXED_VALUES, WLZ_VALUE_ATTACH_ELM, WLZ_VALUE_ATTACH_NOD, WlzIndexedValueGet(), and _WlzValues::x.

WlzObject* WlzCMeshValueTransfer ( WlzObject srcObj,
WlzObject tgtObj,
WlzPixelV  extVal,
WlzInterpolationType  interp,
WlzErrorNum dstErr 
)

Creates a new object with the mesh domain of the target object and (within the domain intersection) the values of the source object. Given a pair of 2, 2.5 or 3D conforming meshes, with both of the same type, a new mesh object is created using the domain of the target and with the value type of the source object. Values are transfered from the source to the target mesh within their intersection. Outside of the intersection values are set to the given external value.

Returns
New mesh object or NULL on error.
Parameters
srcObjGiven source mesh object which must be of the same type as the target and have values attached.
tgtObjGiven target mesh object which must be of the same type as the source.
extValGiven external value to use outside of the source - target mesh intersection.
interpInterpolation method.
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcMalloc(), AlcVectorItemGet(), _WlzGreyValueWSpace::bkdFlag, _WlzDomain::cm2, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshRes::elm, _WlzGreyValueWSpace::gType, _WlzGreyValueWSpace::gVal, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMeshNod3D::pos, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzObject::type, _WlzGreyP::ubp, _WlzGreyP::v, _WlzPixelV::v, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_TYPE, WLZ_ERR_UNIMPLEMENTED, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INTERPOLATION_BARYCENTRIC, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_NINT, WLZ_VALUE_ATTACH_ELM, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, WlzCMeshElmEnclosingPos2D(), WlzCMeshElmEnclosingPos3D(), WlzFreeIndexedValues(), WlzFreeObj(), WlzGeomBaryCoordsTet3D(), WlzGeomBaryCoordsTri2D(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueGetCon(), WlzGreyValueMakeWSp(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), WlzValueConvertPixel(), WlzValueCopyGreyToGrey(), WlzValueSetGrey(), and _WlzValues::x.

WlzCMesh2D* WlzCMeshNew2D ( 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.

Returns
New 2D mesh.
Parameters
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcVectorNew(), _WlzCMeshRes::elm, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzCMeshFree2D().

Referenced by WlzCMeshCopy2D(), WlzCMeshExtract2D(), WlzCMeshFlatten2D5(), WlzCMeshFromBalLBTDom2D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshTransformInvert(), WlzEffReadObjNodeEle(), WlzEffWritePointsVtkFieldValues(), and WlzReadMeshTransform3D().

WlzCMesh2D5* WlzCMeshNew2D5 ( 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.

Returns
New 2D5 mesh.
Parameters
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcVectorNew(), _WlzCMeshRes::elm, _WlzCMeshRes::nod, _WlzCMesh2D5::res, _WlzCMesh2D5::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D5, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzCMeshFree2D5().

Referenced by WlzCMeshCopy2D5(), WlzCMeshFromGM(), WlzCMeshTransformInvert(), and WlzReadMeshTransform3D().

WlzCMesh3D* WlzCMeshNew3D ( 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.

Returns
New 3D mesh.
Parameters
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcVectorNew(), _WlzCMeshRes::elm, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzCMeshFree3D().

Referenced by WlzCMeshCopy3D(), WlzCMeshFromBalLBTDom3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshTransformInvert(), WlzEffReadObjEMT(), WlzEffReadObjMesh(), WlzEffReadObjNodeEle(), WlzEffReadObjVMesh(), WlzEffWritePointsVtkFieldValues(), and WlzReadMeshTransform3D().

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

Adds a new 2D node callback to the mesh.

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

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

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

Adds a new 2D5 node callback to the mesh.

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

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

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

Adds a new 3D node callback to the mesh.

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

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

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

Adds a new 2D element callback to the mesh.

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

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh2D::res, and WLZ_ERR_NONE.

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

Adds a new 2D5 element callback to the mesh.

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

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh2D5::res, and WLZ_ERR_NONE.

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

Adds a new 3D element callback to the mesh.

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

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh3D::res, and WLZ_ERR_NONE.

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

Adds a 2D deleted element callback to the mesh.

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

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

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

Adds a 2D5 deleted element callback to the mesh.

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

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

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

Adds a 3D deleted element callback to the mesh.

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

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

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

Removes a new 2D node callback to the mesh.

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

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

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

Removes a new 2D5 node callback to the mesh.

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

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

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

Removes a new 3D node callback to the mesh.

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

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

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

Removes a new 2D element callback to the mesh.

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

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh2D::res, and WLZ_ERR_NONE.

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

Removes a new 2D5 element callback to the mesh.

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

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh2D5::res, and WLZ_ERR_NONE.

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

Removes a new 3D element callback to the mesh.

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

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh3D::res, and WLZ_ERR_NONE.

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

Removes a deleted 2D 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 WlzCMeshRemDelNodCb2D5 ( WlzCMesh2D5 mesh,
WlzCMeshCbFn  fn,
void *  data 
)

Removes a deleted 2D5 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 WlzCMeshRemDelNodCb3D ( WlzCMesh3D mesh,
WlzCMeshCbFn  fn,
void *  data 
)

Removes a deleted 3D 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.

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

Removes a deleted 2D element callback to the mesh.

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

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

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

Removes a deleted 2D5 element callback to the mesh.

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

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

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

Removes a deleted 3D element callback to the mesh.

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

References AlcFree(), AlcMalloc(), _WlzCMeshCbEntry::data, _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::elm, _WlzCMeshCbEntry::fn, _WlzCMeshCbEntry::next, _WlzCMesh3D::res, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.

WlzCMeshNod2D* WlzCMeshNewNod2D ( 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.

Returns
New 2D mesh node.
Parameters
meshThe mesh for resources.
posPosition for the node.
dstErrDestination error pointer, may be NULL.

References _WlzCMeshEntRes::newEntCb, _WlzCMeshNod2D::next, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzCMeshAllocNod2D().

Referenced by WlzCMeshCopy2D(), WlzCMeshElmFuse2D(), WlzCMeshFlatten2D5(), WlzCMeshFromBalLBTDom3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshTransformInvert(), WlzEffReadObjNodeEle(), and WlzEffWritePointsVtkFieldValues().

WlzCMeshNod2D5* WlzCMeshNewNod2D5 ( 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.

Returns
New 2D5 mesh node.
Parameters
meshThe mesh for resources.
posPosition for the node.
dstErrDestination error pointer, may be NULL.

References _WlzCMeshEntRes::newEntCb, _WlzCMeshNod2D5::next, _WlzCMeshRes::nod, _WlzCMeshNod2D5::pos, _WlzCMesh2D5::res, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzCMeshAllocNod2D5().

Referenced by WlzCMeshCopy2D5(), and WlzCMeshTransformInvert().

WlzCMeshNod3D* WlzCMeshNewNod3D ( 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.

Returns
New 3D mesh node.
Parameters
meshThe mesh for resources.
posPosition for the node.
dstErrDestination error pointer, may be NULL.

References AlcBlockStackNew(), _WlzCMeshCellGrid2D::allCE, _WlzCMeshCellGrid2D5::allCE, _WlzCMeshCellGrid3D::allCE, _WlzCMesh2D::bBox, _WlzCMesh2D5::bBox, _WlzCMesh3D::bBox, _WlzCMeshCellElm2D::cell, _WlzCMeshCellElm2D5::cell, _WlzCMeshCellElm3D::cell, _WlzCMeshCellGrid2D::cells, _WlzCMeshCellGrid2D5::cells, _WlzCMeshCellGrid3D::cells, _WlzCMeshCellGrid2D::cellSz, _WlzCMeshCellGrid2D5::cellSz, _WlzCMeshCellGrid3D::cellSz, _WlzCMeshElm2D::cElm, _WlzCMeshElm2D5::cElm, _WlzCMeshElm3D::cElm, _WlzCMeshCell2D::cElm, _WlzCMeshCell2D5::cElm, _WlzCMeshCell3D::cElm, _WlzCMesh2D::cGrid, _WlzCMesh2D5::cGrid, _WlzCMesh3D::cGrid, _WlzCMeshFace::edu, _WlzCMeshElm2D::edu, _WlzCMeshElm2D5::edu, _AlcBlockStack::elements, _WlzCMeshCellElm2D::elm, _WlzCMeshCellElm2D5::elm, _WlzCMeshCellElm3D::elm, _WlzCMeshElm3D::face, _WlzCMeshNod3D::flags, _WlzCMeshCellGrid2D::freeCE, _WlzCMeshCellGrid2D5::freeCE, _WlzCMeshCellGrid3D::freeCE, _WlzCMeshCellGrid2D::nCells, _WlzCMeshCellGrid2D5::nCells, _WlzCMeshCellGrid3D::nCells, _WlzCMeshNod2D::next, _WlzCMeshNod2D5::next, _WlzCMeshNod3D::next, _WlzCMeshCellElm2D::next, _WlzCMeshCellElm2D5::next, _WlzCMeshCellElm3D::next, _WlzCMeshCellElm2D::nextCell, _WlzCMeshCellElm2D5::nextCell, _WlzCMeshCellElm3D::nextCell, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D5::nod, _WlzCMeshEdgU3D::nod, _WlzCMeshCell2D::nod, _WlzCMeshCell2D5::nod, _WlzCMeshCell3D::nod, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzCMeshNod3D::pos, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_CLAMP, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WlzCMeshAllocNod3D(), WlzCMeshElmBBox2D(), WlzCMeshElmBBox2D5(), WlzCMeshElmBBox3D(), WlzGeomTetrahedronAABBIntersect3D(), WlzGeomTriangleAABBIntersect2D(), WlzGeomTriangleAABBIntersect3D(), _WlzIBox2::xMax, _WlzDBox2::xMax, _WlzIBox3::xMax, _WlzDBox3::xMax, _WlzIBox2::xMin, _WlzDBox2::xMin, _WlzIBox3::xMin, _WlzDBox3::xMin, _WlzIBox2::yMax, _WlzDBox2::yMax, _WlzIBox3::yMax, _WlzDBox3::yMax, _WlzIBox2::yMin, _WlzDBox2::yMin, _WlzIBox3::yMin, _WlzDBox3::yMin, _WlzIBox3::zMax, _WlzDBox3::zMax, _WlzIBox3::zMin, and _WlzDBox3::zMin.

Referenced by WlzCMeshCopy3D(), WlzCMeshFromBalLBTDom3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshTransformInvert(), WlzEffReadObjEMT(), WlzEffReadObjMesh(), WlzEffReadObjNodeEle(), WlzEffReadObjVMesh(), WlzEffWritePointsVtkFieldValues(), and WlzReadMeshTransform3D().

WlzCMeshNod2D* WlzCMeshAllocNod2D ( WlzCMesh2D mesh)

Allocates a new 2D mesh node and sets it's index. For efficiency this function does not check it's parameters.

Returns
New 2D mesh node or NULL on error.
Parameters
meshMesh with resources.

References AlcVectorExtendAndGet(), _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntRes::nextIdx, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshCopy2D(), WlzCMeshExtract2D(), WlzCMeshNewNod2D(), and WlzReadMeshTransform3D().

WlzCMeshNod2D5* WlzCMeshAllocNod2D5 ( WlzCMesh2D5 mesh)

Allocates a new 2D5 mesh node and sets it's index. For efficiency this function does not check it's parameters.

Returns
New 2D5 mesh node or NULL on error.
Parameters
meshMesh with resources.

References AlcVectorExtendAndGet(), _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntRes::nextIdx, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D5::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshCopy2D5(), WlzCMeshFromGM(), WlzCMeshNewNod2D5(), and WlzReadMeshTransform3D().

WlzCMeshNod3D* WlzCMeshAllocNod3D ( WlzCMesh3D mesh)

Allocates a new 3D mesh node and sets it's index. For efficiency this function does not check it's parameters.

Returns
New 3D mesh node or NULL on error.
Parameters
meshMesh with resources.

References AlcVectorExtendAndGet(), _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntRes::nextIdx, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh3D::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshCopy3D(), and WlzCMeshNewNod3D().

WlzCMeshElm2D* WlzCMeshNewElm2D ( 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.

Returns
New 2D mesh element.
Parameters
meshThe mesh for resources.
nod0First mesh node.
nod1Second mesh node.
nod2Third mesh node.
allowFlipAllow flipping of node order to get valid element.
dstErrDestination error pointer, may be NULL.

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh2D::res, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshAllocElm2D(), and WlzCMeshSetElm2D().

Referenced by WlzCMeshCopy2D(), WlzCMeshElmFuse2D(), WlzCMeshFlatten2D5(), WlzCMeshFromBalLBTDom3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshTransformInvert(), WlzEffReadObjNodeEle(), WlzEffWritePointsVtkFieldValues(), and WlzReadMeshTransform3D().

WlzCMeshElm2D5* WlzCMeshNewElm2D5 ( 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.

Returns
New 2D5 mesh element.
Parameters
meshThe mesh for resources.
nod0First mesh node.
nod1Second mesh node.
nod2Third mesh node.
allowFlipAllow flipping of node order to get valid element.
dstErrDestination error pointer, may be NULL.

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh2D5::res, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshAllocElm2D5(), and WlzCMeshSetElm2D5().

Referenced by WlzCMeshCopy2D5(), WlzCMeshFromGM(), WlzCMeshTransformInvert(), and WlzReadMeshTransform3D().

WlzCMeshElm3D* WlzCMeshNewElm3D ( 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.

Returns
New 3D mesh element.
Parameters
meshThe mesh for resources.
nod0First mesh node.
nod1Second mesh node.
nod2Third mesh node.
nod3Fourth mesh node.
allowFlipAllow flipping of node order to get valid element.
dstErrDestination error pointer, may be NULL.

References _WlzCMeshRes::elm, _WlzCMeshEntRes::newEntCb, _WlzCMesh3D::res, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshAllocElm3D(), and WlzCMeshSetElm3D().

Referenced by WlzCMeshCopy3D(), WlzCMeshFromBalLBTDom3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshTransformInvert(), WlzEffReadObjEMT(), WlzEffReadObjMesh(), WlzEffReadObjNodeEle(), WlzEffReadObjVMesh(), WlzEffWritePointsVtkFieldValues(), and WlzReadMeshTransform3D().

WlzCMeshElm2D* WlzCMeshAllocElm2D ( 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.

Returns
New 2D mesh element or NULL on error.
Parameters
meshMesh with resources.

References AlcVectorExtendAndGet(), _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::next, _WlzCMeshEntRes::nextIdx, _WlzCMeshEntRes::numEnt, _WlzCMesh2D::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshCopy2D(), and WlzCMeshNewElm2D().

WlzCMeshElm2D5* WlzCMeshAllocElm2D5 ( 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.

Returns
New 2D5 mesh element or NULL on error.
Parameters
meshMesh with resources.

References AlcVectorExtendAndGet(), _WlzCMeshElm2D5::edu, _WlzCMeshRes::elm, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D5::next, _WlzCMeshEntRes::nextIdx, _WlzCMeshEntRes::numEnt, _WlzCMesh2D5::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshCopy2D5(), and WlzCMeshNewElm2D5().

WlzCMeshElm3D* WlzCMeshAllocElm3D ( WlzCMesh3D mesh)

Allocates a new 3D mesh element and sets it's index. For efficiency this function does not check it's parameters.

Returns
New 3D mesh element or NULL on error.
Parameters
meshMesh with resources.

References AlcVectorExtendAndGet(), _WlzCMeshRes::elm, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntRes::nextIdx, _WlzCMeshEntRes::numEnt, _WlzCMesh3D::res, and _WlzCMeshEntRes::vec.

Referenced by WlzCMeshCopy3D(), and WlzCMeshNewElm3D().

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.

Returns
Woolz error code.
Parameters
meshThe mesh.
elmGiven mesh element.
nod0First mesh node of element.
nod1Second mesh node of element.
nod2Third mesh node of element.
allowFlipAllow flipping of node order to get valid element.

References _WlzCMeshNod2D::edu, _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::elm, _WlzCMesh2D::maxSqEdgLen, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D::opp, _WlzCMeshNod2D::pos, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_MESH_TOLERANCE_SQ, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, and WlzGeomTriangleSnArea2().

Referenced by WlzCMeshExtract2D(), WlzCMeshFixNegativeElms2D(), and WlzCMeshNewElm2D().

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.

Returns
Woolz error code.
Parameters
meshThe mesh.
elmGiven mesh element.
nod0First mesh node of element.
nod1Second mesh node of element.
nod2Third mesh node of element.
allowFlipAllow flipping of node order to get valid element.

References _WlzCMeshNod2D5::edu, _WlzCMeshElm2D5::edu, _WlzCMeshEdgU2D5::elm, _WlzCMesh2D5::maxSqEdgLen, _WlzCMeshEdgU2D5::next, _WlzCMeshEdgU2D5::nnxt, _WlzCMeshEdgU2D5::nod, _WlzCMeshEdgU2D5::opp, _WlzCMeshNod2D5::pos, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_MESH_TOLERANCE_SQ, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, and WlzGeomTriangleArea2Sq3().

Referenced by WlzCMeshNewElm2D5().

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.

Returns
Woolz error code.
Parameters
meshThe mesh.
elmGiven mesh element.
nod0First mesh node of element.
nod1Second mesh node of element.
nod2Third mesh node of element.
nod3Fourth mesh node of element.
allowFlipAllow flipping of node order to get valid element.

References _WlzCMeshNod3D::edu, _WlzCMeshFace::edu, _WlzCMeshFace::elm, _WlzCMeshEdgU3D::face, _WlzCMeshElm3D::face, _WlzCMeshNod3D::idx, _WlzCMesh3D::maxSqEdgLen, _WlzCMeshEdgU3D::next, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU3D::nod, _WlzCMeshFace::opp, _WlzCMeshNod3D::pos, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_MESH_TOLERANCE_SQ, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, and WlzGeomTetraSnVolume6().

Referenced by WlzCMeshFixNegativeElms3D(), and WlzCMeshNewElm3D().

WlzErrorNum WlzCMeshFree ( WlzCMeshP  mesh)

Free's the mesh, it's cells, nodes and elements.

Returns
Woolz error code.
Parameters
meshMesh to free.

References _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WlzCMeshFree2D(), WlzCMeshFree2D5(), and WlzCMeshFree3D().

WlzErrorNum WlzCMeshDelNod2D ( WlzCMesh2D mesh,
WlzCMeshNod2D nod 
)

Deletes the 2D mesh node. This function assumes that the node is no longer used by any elements.

Returns
Woolz error code.
Parameters
meshThe mesh to which the node belongs.
nodThe given node.

References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh2D::res, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzCMeshNodFree2D().

Referenced by WlzCMeshDelElm2D(), and WlzCMeshDelUnusedNodes2D().

WlzErrorNum WlzCMeshDelNod2D5 ( WlzCMesh2D5 mesh,
WlzCMeshNod2D5 nod 
)

Deletes the 2D5 mesh node. This function assumes that the node is no longer used by any elements.

Returns
Woolz error code.
Parameters
meshThe mesh to which the node belongs.
nodThe given node.

References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh2D5::res, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzCMeshNodFree2D5().

Referenced by WlzCMeshDelElm2D5(), and WlzCMeshDelUnusedNodes2D5().

WlzErrorNum WlzCMeshDelNod3D ( WlzCMesh3D mesh,
WlzCMeshNod3D nod 
)

Deletes the 3D mesh node. This function assumes that the node is no longer used by any elements.

Returns
Woolz error code.
Parameters
meshThe mesh to which the node belongs.
nodThe given node.

References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh3D::res, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzCMeshNodFree3D().

Referenced by WlzCMeshDelElm3D(), and WlzCMeshDelUnusedNodes3D().

WlzErrorNum WlzCMeshDelElm2D ( WlzCMesh2D mesh,
WlzCMeshElm2D elm 
)

Deletes the 2D mesh element and any mesh nodes that are used exclusively by this mesh element.

Returns
Woolz error code.
Parameters
meshThe mesh to which the element belongs.
elmThe given element.

References _WlzCMeshEntRes::delEntCb, _WlzCMeshNod2D::edu, _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::elm, _WlzCMeshRes::elm, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D::opp, _WlzCMesh2D::res, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WlzCMeshDelNod2D(), WlzCMeshElmFree2D(), and WlzCMeshVerify2D().

Referenced by WlzCMeshBoundConform2D(), and WlzCMeshElmFuse2D().

WlzErrorNum WlzCMeshDelElm2D5 ( WlzCMesh2D5 mesh,
WlzCMeshElm2D5 elm 
)

Deletes the 2D5 mesh element and any mesh nodes that are used exclusively by this mesh element.

Returns
Woolz error code.
Parameters
meshThe mesh to which the element belongs.
elmThe given element.

References _WlzCMeshEntRes::delEntCb, _WlzCMeshNod2D5::edu, _WlzCMeshElm2D5::edu, _WlzCMeshEdgU2D5::elm, _WlzCMeshRes::elm, _WlzCMeshEdgU2D5::nnxt, _WlzCMeshEdgU2D5::nod, _WlzCMeshEdgU2D5::opp, _WlzCMesh2D5::res, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WlzCMeshDelNod2D5(), WlzCMeshElmFree2D5(), and WlzCMeshVerify2D5().

WlzErrorNum WlzCMeshDelElm3D ( WlzCMesh3D mesh,
WlzCMeshElm3D elm 
)

Deletes the 3D mesh element and any mesh nodes that are used exclusively by this mesh element.

Returns
Woolz error code.
Parameters
meshThe mesh to which the element belongs.
elmThe given element.

References _WlzCMeshNod3D::edu, _WlzCMeshFace::edu, _WlzCMeshFace::elm, _WlzCMeshElm3D::face, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU3D::nod, _WlzCMeshFace::opp, WLZ_ERR_NONE, WlzCMeshDelNod3D(), WlzCMeshElmFree3D(), and WlzCMeshVerify3D().

Referenced by WlzCMeshBoundConform3D().

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.

Parameters
meshInput mesh
nodGiven mesh node.

References _WlzCMeshNod2D::idx, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, and _WlzCMesh2D::res.

Referenced by WlzCMeshDelNod2D().

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.

Parameters
meshInput mesh
nodGiven mesh node.

References _WlzCMeshNod2D5::idx, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, and _WlzCMesh2D5::res.

Referenced by WlzCMeshDelNod2D5().

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.

Parameters
meshInput mesh
nodGiven mesh node.

References _WlzCMeshNod3D::idx, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, and _WlzCMesh3D::res.

Referenced by WlzCMeshDelNod3D().

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.

Parameters
meshInput mesh
elmGiven mesh element.

References _WlzCMeshRes::elm, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::numEnt, and _WlzCMesh2D::res.

Referenced by WlzCMeshDelElm2D().

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.

Parameters
meshInput mesh
elmGiven mesh element.

References _WlzCMeshRes::elm, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::numEnt, and _WlzCMesh2D5::res.

Referenced by WlzCMeshDelElm2D5().

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.

Parameters
meshInput mesh
elmGiven mesh element.

References _WlzCMeshRes::elm, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::numEnt, and _WlzCMesh3D::res.

Referenced by WlzCMeshDelElm3D().

void WlzCMeshDelUnusedNodes3D ( WlzCMesh3D mesh)

Deletes any unused neodes, ie nodes that do not have edge uses, from the given mesh.

Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod3D::edu, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, and WlzCMeshDelNod3D().

Referenced by WlzEffReadObjEMT().

void WlzCMeshDelUnusedNodes2D5 ( WlzCMesh2D5 mesh)

Deletes any unused neodes, ie nodes that do not have edge uses, from the given mesh.

Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod2D5::edu, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D5::res, _WlzCMesh2D5::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D5, and WlzCMeshDelNod2D5().

void WlzCMeshDelUnusedNodes2D ( WlzCMesh2D mesh)

Deletes any unused neodes, ie nodes that do not have edge uses, from the given mesh.

Parameters
meshGiven mesh.

References AlcVectorItemGet(), _WlzCMeshNod2D::edu, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, and WlzCMeshDelNod2D().

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().

Returns
Woolz error code.
Parameters
meshGiven mesh.
objObject with domain to which the mesh should conform.
mtdMethod for determining the position of a vertex just outside the object's domain, see WlzGeomObjLineSegIntersect2D().
tolAcceptable placement error.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshNod2D::flags, _WlzCMeshElm2D::flags, _WlzCMeshNod2D::idx, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_CMESH_ELM_FLAG_BOUNDARY, WLZ_CMESH_ELM_FLAG_NONE, WLZ_CMESH_ELM_FLAG_OUTSIDE, WLZ_CMESH_NOD_FLAG_BOUNDARY, WLZ_CMESH_NOD_FLAG_NONE, WLZ_CMESH_NOD_FLAG_OUTSIDE, WLZ_ERR_NONE, WlzCMeshDelElm2D(), WlzCMeshElmFuse2D(), WlzCMeshVerify2D(), WlzGeomObjLineSegIntersect2D(), WlzGeomTriangleSnArea2(), and WlzInsideDomain().

Referenced by WlzCMeshFromObj2D().

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.

Returns
Woolz error code.
            On return the mesh bounding box and location grid will be
            invalid and the following functions should be called:
            WlzCMeshUpdateBBox3D(), WlzCMeshUpdateMaxSqEdgLen3D() 
            and WlzCMeshReassignGridCells3D().
Parameters
meshGiven mesh.
objObject with domain to which the mesh should conform.
mtdMethod for determining the position of a vertex just outside the object's domain, see WlzGeomObjLineSegIntersect3D().
tolAcceptable placement error.

References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshNod3D::flags, _WlzCMeshElm3D::flags, _WlzCMeshNod3D::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_CMESH_ELM_FLAG_BOUNDARY, WLZ_CMESH_ELM_FLAG_NONE, WLZ_CMESH_ELM_FLAG_OUTSIDE, WLZ_CMESH_NOD_FLAG_BOUNDARY, WLZ_CMESH_NOD_FLAG_NONE, WLZ_CMESH_NOD_FLAG_OUTSIDE, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE_SQ, WlzCMeshDelElm3D(), WlzCMeshVerify3D(), WlzGeomObjLineSegIntersect3D(), WlzGeomTetraSnVolume6(), and WlzInsideDomain().

Referenced by WlzCMeshFromObj3D().

double WlzCMeshElmMinEdgLnSq2D ( WlzCMeshElm2D elm)

Computes the square of the minimum edge length for the element.

Returns
Square of the minimum edge length for the element, this will be negative for invalid elements.
Parameters
elmGiven element.

References _WlzCMeshElm2D::edu, _WlzCMeshElm2D::idx, _WlzCMeshEdgU2D::nod, WLZ_VTX_2_SQRLEN, and WLZ_VTX_2_SUB.

void WlzCMeshElmMinMaxEdgLnSq3D ( WlzCMeshElm3D elm,
double *  dstMinSq,
double *  dstMaxSq 
)

Computes the square of the minimum and maximum edge length for the given element.

Parameters
elmGiven element, must be valid.
dstMinSqDestination pointer for minimum squared edge length, may be NULL.
dstMaxSqDestination pointer for maximum squared edge length, may be NULL.

References WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_VTX_3_SQRLEN, and WLZ_VTX_3_SUB.

WlzErrorNum WlzCMeshReassignGridCells3D ( WlzCMesh3D mesh,
int  newNumNod 
)

Allocates a new cell grid and then reassigns the nodes and elements to the cells.

Returns
Wlz error code.
Parameters
meshThe mesh.
newNumNodNew expected number of nodes. If zero the current number of nodes or a small number (1024) will be used (which ever is the greater).

References AlcVectorItemGet(), _WlzCMeshCellGrid3D::allCE, _WlzCMesh2D::bBox, _WlzCMesh2D5::bBox, _WlzCMesh3D::bBox, _WlzCMeshCellGrid2D::cellSz, _WlzCMeshCellGrid2D5::cellSz, _WlzCMeshCellGrid3D::cellSz, _WlzCMesh2D::cGrid, _WlzCMesh2D5::cGrid, _WlzCMesh3D::cGrid, _AlcBlockStack::elements, _WlzCMeshRes::elm, _WlzCMeshCellGrid3D::freeCE, _WlzCMeshNod3D::idx, _WlzCMeshElm3D::idx, _AlcBlockStack::maxElm, _WlzCMeshEntRes::maxEnt, _WlzCMeshCellGrid2D::nCells, _WlzCMeshCellGrid2D5::nCells, _WlzCMeshCellGrid3D::nCells, _AlcBlockStack::next, _WlzCMeshCellElm3D::next, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh3D::res, _WlzCMeshEntRes::vec, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_CLAMP, WLZ_ERR_NONE, _WlzDBox3::xMax, _WlzDBox2::xMin, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox2::yMin, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.

Referenced by WlzAffineTransformIsTranslate(), WlzCMeshAffineProduct(), WlzCMeshAffineTransformMesh3D(), WlzCMeshCopy3D(), WlzCMeshFromBalLBTDom3D(), WlzCMeshFromObj3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshLaplacianSmooth3D(), WlzCMeshLPFilter(), WlzCMeshSetVertices3D(), WlzCMeshTransformInvert(), WlzEffReadObjEMT(), WlzEffReadObjMesh(), WlzEffReadObjNodeEle(), WlzEffReadObjVMesh(), WlzEffWritePointsVtkFieldValues(), and WlzReadMeshTransform3D().

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.

Returns
Non zero if there is an existing node at the given position.
Parameters
meshThe mesh.
posGiven node position.
tolTollerance to use when finding mesh node.
dstNodDestination pointer for the matched node which will be NULL if there is no node at the given position. Must not be NULL.

References _WlzCMeshCellGrid2D::cells, _WlzCMeshCellGrid2D::cellSz, _WlzCMesh2D::cGrid, _WlzCMeshNod2D::next, _WlzCMeshCell2D::nod, _WlzCMeshNod2D::pos, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, and WLZ_VTX_2_EQUAL.

Referenced by WlzCMeshCopy2D(), and WlzCMeshMatchNod2D().

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.

Returns
Non zero if there is an existing node at the given position.
Parameters
meshThe mesh.
posGiven node position.
tolTollerance to use when finding mesh node.
dstNodDestination pointer for the matched node which will be NULL if there is no node at the given position. Must not be NULL.

References _WlzCMeshCellGrid2D5::cells, _WlzCMeshCellGrid2D5::cellSz, _WlzCMesh2D5::cGrid, _WlzCMeshNod2D5::next, _WlzCMeshCell2D5::nod, _WlzCMeshNod2D5::pos, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, and WLZ_VTX_3_EQUAL.

Referenced by WlzCMeshCopy2D5(), and WlzCMeshMatchNod2D5().

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.

Returns
Non zero if there is an existing node at the given position.
Parameters
meshThe mesh.
posGiven node position.
dstGPosDestination pointer for the grid position. Must not be NULL.
dstPrevDestination pointer for the previous node in the cell's linked list, which will be NULL if either the cell is empty or the matched node is the first in the cell. Must not be NULL.
tolTollerance to use when finding mesh node.
dstNodDestination pointer for the matched node which will be NULL if there is no node at the given position. Must not be NULL.

References _WlzCMeshCellGrid3D::cells, _WlzCMeshCellGrid3D::cellSz, _WlzCMesh3D::cGrid, _WlzCMeshNod3D::next, _WlzCMeshCell3D::nod, _WlzCMeshNod3D::pos, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, and WLZ_VTX_3_EQUAL.

Referenced by WlzCMeshCopy3D(), and WlzCMeshMatchNod3D().

WlzCMeshNod2D* WlzCMeshMatchNod2D ( 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.

Returns
Matched node or NULL if no node is matched.
Parameters
meshThe mesh.
nPosGiven vertex position.
tolMatch tolerance.

References WlzCMeshLocateNod2D().

Referenced by WlzCMeshElmFuse2D(), WlzCMeshMatchNNod2D(), and WlzCMeshMatchNNodIdx2D().

WlzCMeshNod2D5* WlzCMeshMatchNod2D5 ( 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.

Returns
Matched node or NULL if no node is matched.
Parameters
meshThe mesh.
nPosGiven vertex position.
tolMatch tolerance.

References WlzCMeshLocateNod2D5().

Referenced by WlzCMeshMatchNNod2D5(), and WlzCMeshMatchNNodIdx2D5().

WlzCMeshNod3D* WlzCMeshMatchNod3D ( 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.

Returns
Matched node or NULL if no node is matched.
Parameters
meshThe mesh.
nPosGiven vertex position.
tolMatch tolerance.

References WlzCMeshLocateNod3D().

Referenced by WlzCMeshMatchNNod3D(), and WlzCMeshMatchNNodIdx3D().

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.

Returns
Number of matched nodes.
Parameters
meshThe mesh.
nNodNumber of node positions to match.
nPosNode positions.
tolMatch tolerance.
mNodArray for matched nodes.

References WlzCMeshMatchNod2D().

Referenced by WlzCMeshFromBalLBTDom3D().

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.

Returns
Number of matched nodes.
Parameters
meshThe mesh.
nNodNumber of node positions to match.
nPosNode positions.
tolMatch tolerance.
mNodArray for matched nodes.

References WlzCMeshMatchNod2D5().

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.

Returns
Number of matched nodes.
Parameters
meshThe mesh.
nNodNumber of node positions to match.
nPosNode positions.
tolMatch tolerance.
mNodArray for matched nodes.

References WlzCMeshMatchNod3D().

Referenced by WlzCMeshFromBalLBTDom3D().

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.

Returns
Number of matched nodes.
Parameters
meshThe mesh.
nNodNumber of node positions to match.
nPosNode positions.
tolMatch tolerance.
mIdxFor indices of the matched nodes.

References _WlzCMeshNod2D::idx, and WlzCMeshMatchNod2D().

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.

Returns
Number of matched nodes.
Parameters
meshThe mesh.
nNodNumber of node positions to match.
nPosNode positions.
tolMatch tolerance.
mIdxFor indices of the matched nodes.

References _WlzCMeshNod2D5::idx, and WlzCMeshMatchNod2D5().

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.

Returns
Number of matched nodes.
Parameters
meshThe mesh.
nNodNumber of node positions to match.
nPosNode positions.
tolMatch tolerance.
mIdxFor indices of the matched nodes.

References _WlzCMeshNod3D::idx, and WlzCMeshMatchNod3D().

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.

Returns
Element index or negative value if there is no enclosing element.

If a valid last element index is given then a search is made for the enclosing element both within this element and then, if not found, within it's immediate edge neighbours. If this simple 'walk search' fails to locate the enclosing element a 'jump search' is used in which the grid cells of the conforming mesh are searched.

Parameters
meshThe mesh.
lastElmIdxLast element index to help efficient location. If negative this is ignored.
pXColumn coordinate of position.
pYLine coordinate of position.
pZPlane coordinate of position (ignored for 2D).
exhaustiveIf non zero every element is the mesh is checked to see if the position is contained within it. This is very slow and is probably only useful for debuging.
dstCloseNodIf non NULL, then the value is set to the index of the closest node to the given position.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, WLZ_CMESH_2D, WLZ_CMESH_3D, WlzCMeshElmEnclosingPos2D(), and WlzCMeshElmEnclosingPos3D().

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.

Returns
Element index or negative value if there is no enclosing element.

If a valid last element index is given then a search is made for the enclosing element both within this element and then, if not found, within it's immediate edge neighbours. If this simple 'walk search' fails to locate the enclosing element a 'jump search' is used in which the grid cells of the conforming mesh are searched. For jump search to work coreectly the maximum edge length in th emesh must be valid.

Parameters
meshThe mesh.
lastElmIdxLast element index to help efficient location. If negative this is ignored.
pXColumn coordinate of position.
pYLine coordinate of position.
exhaustiveIf non zero every element is the mesh is checked to see if the position is contained within it. This is very slow and is probably only useful for debuging.
dstCloseNodIf non NULL, then the value is set to the index of the closest node to the given position.

References _WlzDVertex2::vtX, and _WlzDVertex2::vtY.

Referenced by WlzBasisFnValueMOSPhi(), WlzCMeshCurvToImage(), WlzCMeshElmEnclosingPos(), WlzCMeshFMarNodes3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshProduct(), WlzCMeshToDomObjValues(), WlzCMeshTransformManyObjAsIdx(), WlzCMeshTransformVtxAry2D(), WlzCMeshTransformVtxAry2F(), WlzCMeshTransformVtxAry2I(), and WlzCMeshValueTransfer().

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.

Returns
Element index or negative value if there is no enclosing element.

If a valid last element index is given then a search is made for the enclosing element both within this element and then, if not found, within it's immediate edge neighbours. If this simple 'walk search' fails to locate the enclosing element a 'jump search' is used in which the grid cells of the conforming mesh are searched. For jump search to work coreectly the maximum edge length in th emesh must be valid.

Parameters
meshThe mesh.
dummyLastElmIdxLast element index used to help efficient location for 2D and 3D, but ignored by this function.
pXColumn coordinate of position.
pYLine coordinate of position.
pZPlane coordinate of position.
exhaustiveIf non zero every element is the mesh is checked to see if the position is contained within it. This is very slow and is probably only useful for debuging.
dstCloseNodIf non NULL, then the value is set to the index of the closest node to the given position.

References _WlzDVertex3::vtX, _WlzDVertex3::vtY, and _WlzDVertex3::vtZ.

Referenced by WlzCMeshTransformManyObjAsIdx(), and WlzCMeshTransformVtxAry2D5().

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.

Returns
Element index or negative value if there is no enclosing element.

If a valid last element index is given then a search is made for the enclosing element both within this element and then, if not found, within it's immediate edge neighbours. If this simple 'walk search' fails to locate the enclosing element a 'jump search' is used in which the grid cells of the conforming mesh are searched. For jump search to work coreectly the maximum edge length in th emesh must be valid.

Parameters
meshThe mesh.
lastElmIdxLast element index to help efficient location. If negative this is ignored.
pXColumn coordinate of position.
pYLine coordinate of position.
pZPlane coordinate of position.
exhaustiveIf non zero every element is the mesh is checked to see if the position is contained within it. This is very slow and is probably only useful for debuging.
dstCloseNodIf non NULL, then the value is set to the index of the closest node to the given position.

References _WlzDVertex3::vtX, _WlzDVertex3::vtY, and _WlzDVertex3::vtZ.

Referenced by WlzBasisFnValueMOSPhi(), WlzCMeshElmEnclosingPos(), WlzCMeshFMarNodes3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshProduct(), WlzCMeshStrainTensorAtPts(), WlzCMeshToDomObjValues(), WlzCMeshTransformManyObjAsIdx(), WlzCMeshTransformVtxAry3D(), WlzCMeshTransformVtxAry3F(), WlzCMeshTransformVtxAry3I(), WlzCMeshTrRegSM3D(), and WlzCMeshValueTransfer().

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.

Returns
Element index or negative value if there is no enclosing or close element.
Parameters
meshThe mesh.
dstPosDestination pointer for found position within element. Not set if element returned is invalid.
posGiven vertex position.
dMaxMaximum distance to search for a close element.

References _WlzVertexP::d2, _WlzVertex::d2, _WlzVertexP::d3, _WlzVertex::d3, _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshP::m3, _WlzCMesh2D::type, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WlzCMeshElmClosestPosIn2D(), WlzCMeshElmClosestPosIn2D5(), and WlzCMeshElmClosestPosIn3D().

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.

Returns
Element index or negative value if there is no close by enclosing element found.
Parameters
meshThe mesh.
dstPosDestination pointer for found position within element. Not set if element returned is invalid. May be NULL.
posGiven vertex position.
dMaxMaximum distance for found position from given position.

References _WlzCMeshCellGrid2D::cells, _WlzCMeshCellGrid2D::cellSz, _WlzCMeshCell2D::cElm, _WlzCMesh2D::cGrid, _WlzCMeshCellElm2D::elm, _WlzCMeshElm2D::idx, _WlzCMeshCellGrid2D::nCells, _WlzCMeshCellElm2D::next, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D::res, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_MESH_TOLERANCE, WLZ_MESH_TOLERANCE_SQ, WLZ_VTX_2_FABS, WLZ_VTX_2_SCALE, WLZ_VTX_2_SUB, WlzGeomItrSpiral2I(), WlzGeomItrSpiralRing(), WlzGeomTriangleCen2D(), and WlzGeomTriangleVtxDistSq2D().

Referenced by WlzCMeshElmClosestPosIn().

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.

Returns
Element index or negative value if there is no close by enclosing element found.
Parameters
meshThe mesh.
dstPosDestination pointer for found position within element. Not set if element returned is invalid.
posGiven vertex position.
dMaxMaximum distance for found position from given position.

References AlcVectorItemGet(), _WlzCMeshCellGrid2D::cells, _WlzCMeshCellGrid2D5::cells, _WlzCMeshCellGrid3D::cells, _WlzCMeshCellGrid2D::cellSz, _WlzCMeshCellGrid2D5::cellSz, _WlzCMeshCellGrid3D::cellSz, _WlzCMeshCell2D::cElm, _WlzCMeshCell2D5::cElm, _WlzCMeshCell3D::cElm, _WlzCMesh2D::cGrid, _WlzCMesh2D5::cGrid, _WlzCMesh3D::cGrid, _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::elm, _WlzCMeshFace::elm, _WlzCMeshCellElm2D::elm, _WlzCMeshCellElm2D5::elm, _WlzCMeshCellElm3D::elm, _WlzCMeshRes::elm, _WlzCMeshElm3D::face, _WlzCMeshNod2D::idx, _WlzCMeshNod2D5::idx, _WlzCMeshNod3D::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm2D5::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshCellGrid3D::nCells, _WlzCMeshCellElm2D::next, _WlzCMeshCellElm2D5::next, _WlzCMeshCellElm3D::next, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshEdgU2D::opp, _WlzCMeshFace::opp, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzCMeshNod3D::pos, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzCMesh3D::res, _WlzCMeshEntRes::vec, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_MESH_TOLERANCE, WLZ_MESH_TOLERANCE_SQ, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WLZ_VTX_3_ADD, WLZ_VTX_3_SCALE, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, WlzCMeshClosestNod2D(), WlzCMeshClosestNod2D5(), WlzCMeshClosestNod3D(), WlzCMeshElmEnclosesPos2D(), WlzCMeshElmEnclosesPos2D5(), WlzCMeshElmEnclosesPos3D(), WlzGeomItrSpiral3I(), WlzGeomItrSpiralRing(), WlzGeomTetrahedronCen3D(), and WlzGeomTetrahedronVtxDistSq3D().

Referenced by WlzCMeshElmClosestPosIn().

int WlzCMeshClosestNod2D ( WlzCMesh2D mesh,
WlzDVertex2  pos 
)

Finds the index of the closest node to the given position.

Returns
Index of the closest node or a negative number on error.
            Finds the index of the closest node to the given position
            by spiraling out from the cell containing the given
            position.
Parameters
meshGiven mesh.
posGiven position.

References _WlzCMeshCellGrid2D::cells, _WlzCMesh2D::cGrid, _WlzCMeshNod2D::idx, _WlzCMeshCellGrid2D::nCells, _WlzCMeshNod2D::next, _WlzCMeshCell2D::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_VTX_2_ADD, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WlzGeomItrSpiral2I(), and WlzGeomItrSpiralRing().

Referenced by WlzCMeshElmClosestPosIn3D(), and WlzCMeshProduct().

int WlzCMeshClosestNod2D5 ( WlzCMesh2D5 mesh,
WlzDVertex3  p 
)
int WlzCMeshClosestNod3D ( WlzCMesh3D mesh,
WlzDVertex3  pos 
)

Finds the index of the closest node to the given position.

Returns
Index of the closest node or a negative number on error.
            Finds the index of the closest node to the given position
            by spiraling out from the cell containing the given
            position.
Parameters
meshGiven mesh.
posGiven position.

References _WlzCMeshCellGrid3D::cells, _WlzCMesh3D::cGrid, _WlzCMeshNod3D::idx, _WlzCMeshCellGrid3D::nCells, _WlzCMeshNod3D::next, _WlzCMeshCell3D::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_VTX_3_ADD, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, WlzGeomItrSpiral3I(), and WlzGeomItrSpiralRing().

Referenced by WlzCMeshElmClosestPosIn3D(), and WlzCMeshProduct().

int WlzCMeshElmEnclosesPos2D ( WlzCMeshElm2D elm,
WlzDVertex2  gPos 
)

Checks whether the vertex at the given position is within the given mesh element.

Returns
Non zero if the given vertex is in the given mesh element.
Parameters
elmGiven mesh element.
gPosGiven vertex position.

References _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::nod, _WlzCMeshNod2D::pos, and WlzGeomVxInTriangle2D().

Referenced by WlzCMeshElmClosestPosIn3D().

int WlzCMeshElmEnclosesPos2D5 ( WlzCMeshElm2D5 elm,
WlzDVertex3  gPos 
)

Checks whether the vertex at the given position is within the given mesh element.

Returns
Non zero if the given vertex is in the given mesh element.
Parameters
elmGiven mesh element.
gPosGiven vertex position.

References _WlzCMeshElm2D5::edu, _WlzCMeshEdgU2D5::nod, _WlzCMeshNod2D5::pos, WLZ_MESH_TOLERANCE, and WlzGeomVxInTriangle3D().

Referenced by WlzCMeshElmClosestPosIn3D().

int WlzCMeshElmEnclosesPos3D ( WlzCMeshElm3D elm,
WlzDVertex3  gPos 
)

Checks whether the vertex at the given position is within the given mesh element.

Returns
Non zero if the given vertex is in the given mesh element.
Parameters
elmGiven mesh element.
gPosGiven vertex position.

References WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, and WlzGeomVxInTetrahedron().

Referenced by WlzCMeshElmClosestPosIn3D().

WlzObject* WlzCMeshExtract2D ( 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.

Returns
New 2D conforming mesh.
Parameters
gObjGiven conforming mesh object.
applyDspApply displacement if non-zero and the given object has valid displacements in it's indexed values.
dstErrDestination error pointer, may be NULL.

References AlcVectorExtendAndGet(), AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzValues::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshElm2D::edu, _WlzCMeshElm2D5::edu, _WlzCMeshRes::elm, _WlzCMeshNod2D::flags, _WlzCMeshNod2D::idx, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm2D5::idx, _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D5::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzObject::type, _WlzCMesh2D::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_NOD_FLAG_NONE, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_VALUE_ATTACH_NOD, WlzCMeshAllocNod2D(), WlzCMeshFree2D(), WlzCMeshNew2D(), WlzCMeshReassignGridCells2D(), WlzCMeshSetElm2D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateMaxSqEdgLen2D(), WlzIndexedValueGet(), WlzMakeMain(), and _WlzValues::x.

Referenced by WlzCMeshCurvToImage(), and WlzCMeshIntersectDom2D5().

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.

Returns
New mesh or NULL on error.
Parameters
objGiven domain object.
minElmSzMinimum element size.
maxElmSzMinimum element size.
dstDilObjDestination pointer for the dilated object used to build the mesh.
conformIf non-zero make the mesh conform to the object's domain. outside the object if non-zero.
dstErrDestination error pointer may be NULL.

References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzObject::type, _WlzCMeshP::v, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzCMeshFromObj2D(), and WlzCMeshFromObj3D().

WlzCMesh2D* WlzCMeshFromObj2D ( 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.

Returns
New mesh or NULL on error.
Parameters
objGiven domain object.
minElmSzMinimum element size.
maxElmSzMinimum element size.
dstDilObjDestination pointer for the dilated object used to build the mesh, may be NULL.
conformIf non-zero make boundary elements conform to the given domain by decomposing them. Any elements with all nodes outside the given domain are deleted.
dstErrDestination error pointer may be NULL.

References _WlzDomain::core, _WlzObject::domain, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_INTERPOLATION_NEAREST, WLZ_TRANSFORM_2D_AFFINE, WlzAffineTransformObj(), WlzAffineTransformScaleSet(), WlzAssignObject(), WlzCMeshAffineTransformMesh2D(), WlzCMeshBoundConform2D(), WlzCMeshFromBalLBTDom2D(), WlzCMeshReassignGridCells2D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateMaxSqEdgLen2D(), WlzFreeAffineTransform(), WlzFreeLBTDomain2D(), WlzFreeObj(), WlzLBTBalanceDomain2D(), WlzLBTDomain2DFromDomain(), WlzLBTIndexObjSetAllNodes2D(), WlzLBTMakeNodeIndexObj2D(), WlzMakeAffineTransform(), WlzMakeCircleObject(), WlzMakeRectangleObject(), and WlzStructDilation().

Referenced by WlzCMeshFromObj(), and WlzCMeshTransformFromObj().

WlzCMesh3D* WlzCMeshFromObj3D ( WlzObject obj,
double  minElmSz,
double  maxElmSz,
WlzObject **  dstDilObj,
int  conform,
WlzErrorNum dstErr 
)

Constructs a 3D mesh from a 3D domain object.

Returns
New mesh or NULL on error.
Parameters
objGiven domain object.
minElmSzMinimum element size.
maxElmSzMinimum element size.
dstDilObjDestination pointer for the dilated object used to build the mesh, may be NULL.
conformIf non-zero make boundary elements conform to the given domain by decomposing them. Any elements with all nodes outside the given domain are deleted.
dstErrDestination error pointer may be NULL.

References _WlzDomain::core, _WlzObject::domain, _WlzObject::type, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_INTERPOLATION_NEAREST, WLZ_TRANSFORM_3D_AFFINE, WlzAffineTransformObj(), WlzAffineTransformScaleSet(), WlzAssignObject(), WlzCMeshAffineTransformMesh3D(), WlzCMeshBoundConform3D(), WlzCMeshFromBalLBTDom3D(), WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox3D(), WlzCMeshUpdateMaxSqEdgLen3D(), WlzFreeAffineTransform(), WlzFreeLBTDomain3D(), WlzFreeObj(), WlzLBTBalanceDomain3D(), WlzLBTDomain3DFromDomain(), WlzLBTIndexObjSetAllNodes3D(), WlzLBTMakeNodeIndexObj3D(), WlzMakeAffineTransform(), WlzMakeCuboidObject(), and WlzStructDilation().

Referenced by WlzCMeshFromObj(), and WlzCMeshTransformFromObj().

WlzCMesh2D* WlzCMeshFromBalLBTDom2D ( WlzLBTDomain2D lDom,
WlzObject iObj,
WlzErrorNum dstErr 
)

Constructs a 2D mesh from a balanced 2D linear binary tree domain.

Returns
New mesh or NULL on error.
Parameters
lDomLinear binary tree domain.
iObjIndex object for lDom.
dstErrDestination error pointer may be NULL.

References _WlzCMesh2D::bBox, _WlzLBTDomain2D::kol1, _WlzLBTDomain2D::lastkl, _WlzLBTDomain2D::lastln, _WlzLBTDomain2D::line1, _WlzLBTDomain2D::nNodes, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WlzCMeshNew2D(), WlzCMeshReassignGridCells2D(), WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), _WlzDBox2::xMax, _WlzDBox2::xMin, _WlzDBox2::yMax, and _WlzDBox2::yMin.

Referenced by WlzCMeshFromObj2D().

WlzCMesh3D* WlzCMeshFromBalLBTDom3D ( WlzLBTDomain3D lDom,
WlzObject iObj,
WlzErrorNum dstErr 
)

Constructs a 3D mesh from a balanced 3D linear binary tree domain.

Returns
New mesh or NULL on error.

For tesselation of a 3D LBT node, each node is condidered to be a cube. This can conviniently be represented by it's net and using this representation there are 10 possible node-neighbour relationships when the rotational degeneracy is ignored:

      Y ^        f1
        | v4     |        v5
        |/       |       /
        *---------------@
        |\       :      :\
        | \      :      : \     f2
        |  \     :      :  \  /
        |   \      f5   :   \/
        |    \          :   .\
     v0 |     \   v7    :  .  \   v6
       \|      \ /      :      \ /
        @...f4..@-------*-------*---->X
         \      |      / .      |
          \     |     v1  .     |
           \    |          .    |
            \   |    . f3   .   |
             \  |     .      .  |
              \ | v3   .      . | v2
               \|/      .      .|/
                @---------------@
                 \        \
                  \        \
                 Z %        f0

Faces are defined to have the following orientations, when viewed from outside the cube:

          +z          +y          +y          +y          +y          +x
       3-----2     5-----4     6-----5     7-----6     4-----7     5-----6
       |     |     |     |     |     |     |     |     |     |     |     |
     -x|  0  |+x +x|  1  |-x +z|  2  |-z -x|  3  |+x -z|  4  |+z -z|  5  |+z
       |   -y|     |   -z|     |   +x|     |   +z|     |   -x|     |   +y|
       0-----1     1-----0     2-----1     3-----2     0-----3     4-----7
          -z          -y          -y          -y          -y          -x

The neighbouring nodes to each of these faces can be found using 3 orthogonal vectors (looking from outside the cube):

          ^     
       o2 |     
          |        
       +--|--+               o3 = -o1
       |     |               o4 = -o2
 o3 <---     ----> o1
       |    \|    
       +--|--\    
          |   % o0  
       o4 |     
          V     

Nets of the LBT node cube looking from outside the cube

        3---2            +-+-+            +-+-+            +-+-+
      0 |   |          1 | | |          2 | | |          3 | | |
        | 0 |            +-+-+            +-+-+            +-+-+
        |   |            | | |            | | |            | | |
        0---1            +-+-+            +-+-+            +-+-+
        |   |            |   |            | | |            |   |
        | 1 |            |   |            +-+-+            |   |
        |   |            |   |            | | |            |   |
    0---4---5---1    +---+---+---+    +---+-+-+---+    +---+-+-+---+
    |   |   |   |    |   |   |   |    |   |   |   |    |   | | |   |
    | 4 | 5 | 2 |    |   |   |   |    |   |   |   |    |   +-+-+   |
    |   |   |   |    |   |   |   |    |   |   |   |    |   | | |   |
    3---7---6---2    +---+---+---+    +---+---+---+    +---+-+-+---+
        |   |            |   |            |   |            |   |
        | 3 |            |   |            |   |            |   |
        |   |            |   |            |   |            |   |
        3---2            +---+            +---+            +---+

        +-+-+            +-+-+            +-+-+            +-+-+
      4 | | |          5 | | |          6 | | |          7 | | |
        +-+-+            +-+-+            +-+-+            +-+-+
        | | |            | | |            | | |            | | |
        +-+-+            +---+            +-+-+            +-+-+
        | | |            | | |            | | |            | | |
        +-+-+            +-+-+            +-+-+            +-+-+
        | | |            | | |            | | |            | | |
    +---+-+-+---+    +---+---+-+-+    +---+---+---+    +---+-+-+---+
    |   | | |   |    |   |   | | |    | | |   | | |    |   | | |   |
    |   +-+-+   |    |   |   +-+-+    +-+-+   +-+-+    |   +-+-+   |
    |   | | |   |    |   |   | | |    | | |   | | |    |   | | |   |
    +---+-+-+---+    +---+---+-+-+    +---+---+---+    +---+-+-+---+
        |   |            |   |            |   |            | | |
        |   |            |   |            |   |            +-+-+
        |   |            |   |            |   |            | | |
        +---+            +---+            +---+            +-+-+

        +-+-+            +-+-+
      8 | | |          9 | | |
        +-+-+            +-+-+
        | | |            | | |
        +-+-+            +-+-+
        | | |            | | |
        +-+-+            +-+-+
        | | |            | | |
    +-+-+-+-+-+-+    +-+-+-+-+-+-+
    | | | | | | |    | | | | | | |
    +-+-+-+-+-+-+    +-+-+-+-+-+-+
    | | | | | | |    | | | | | | |
    +-+-+-+-+-+-+    +-+-+-+-+-+-+
        |   |            | | |
        |   |            +-+-+
        |   |            | | |
        +---+            +---+

By placing a mesh node at the centre of the cube, each face can be tesselated with tetrahedra almost independently of the other faces. This gives the following possible teselations, in which each facet on the cubes surface forms a tetrahedron with the node at the cubes centre. Here the cube faces which share an edge obviously influence the tesselation of a face and so reduce the number of classes to 6:

        +---+            +-+-+            +-+-+            +-+-+
  0=(0) |\ /|      1=(1) |\|/|      2=(2) |\|/|      3=(3) |\|/|
        | X |            +-X-+            +-X-+            +-X-+
        |/ \|            |/|\|            |/|\|            |/|\|
        +---+            +-+-+            +-+-+            +-+-+
        |\ /|            |\|/|            |\|/|            |\|/|
        | X |            | X |            +-X-+            | X |
        |/ \|            |/ \|            |/|\|            |/|\|
    +---+---+---+    +---+---+---+    +-+-+---+-+-+    +---+-+-+---+
    |\ /|\ /|\ /|    |\ /|\ /|\ /|    |\|/|\|/|\|/|    |\ /|\|/|\ /|
    | X | X | X |    +-X | X | X-+    +-X | X | X-+    +-X-+-X-+-X-+
    |/ \|/ \|/ \|    |/ \|/ \|/ \|    |/ \|/ \|/ \|    |/ \|/|\|/ \|
    +---+---+---+    +---+---+---+    +---+---+---+    +---+-+-+---+
        |\ /|            |\ /|            |\ /|            |\|/|
        | X |            | X |            | X |            | X |
        |/ \|            |/|\|            |/|\|            |/|\|
        +---+            +-+-+            +-+-+            +-+-+

        +-+-+            +-+-+            +-+-+            +-+-+
  4=(4) |\|/|      5=(5) |\|/|      6=(6) |\|/|  7=(7,8,9) |\|/|
        +-X-+            +-X-+            +-X-+            +-X-+
        |/|\|            |/|\|            |/|\|            |/|\|
        +-+-+            +-+-+            +-+-+            +-+-+
        |\|/|            |\|/|            |\|/|            |\|/|
        +-X-+            +-X-+            +-X-+            +-X-+
        |/|\|            |/|\|            |/|\|            |/|\|
    +-+-+-+-+-+-+    +-+-+-+-+-+-+    +---+-+-+---+    +-+-+-+-+-+-+
    |\|/|\|/|\|/|    |\|/|\|/|\|/|    |\ /|\|/|\ /|    |\|/|\|/|\|/|
    +-X-+-X-+-X-+    +-X | X-+-X-+    +-X-+-X-+-X-+    +-X-+-X-+-X-+
    |/ \|/|\|/ \|    |/ \|/ \|/|\|    |/|\|/ \|/|\|    |/|\|/|\|/|\|
    +---+-+-+---+    +---+---+-+-+    +-+-+---+-+-+    +-+-+-+-+-+-+
        |\|/|            |\ /|            |\ /|            |\|/|
        | X |            | X-+            +-X-+            +-X-+
        |/|\|            |/|\|            |/|\|            |/|\|
        +-+-+            +-+-+            +-+-+            +-+-+

These possible cube face tesselations lead to 6 possible cube face tesselations which define struct::_WlzLBTNodeClass2D.

Parameters
lDomLinear binary tree domain.
iObjIndex object for lDom.
dstErrDestination error pointer may be NULL.

References _WlzCMesh3D::bBox, _WlzCMeshNod2D::edu, _WlzCMeshNod2D5::edu, _WlzLBTDomain3D::kol1, _WlzLBTDomain3D::lastkl, _WlzLBTDomain3D::lastln, _WlzLBTDomain3D::lastpl, _WlzLBTDomain3D::line1, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU2D5::next, _WlzLBTDomain3D::nNodes, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D5::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D5::nod, _WlzLBTDomain2D::nodes, _WlzLBTDomain3D::nodes, _WlzLBTDomain3D::plane1, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_LBT_NODE_CLASS_2D_0, WLZ_LBT_NODE_CLASS_2D_1, WLZ_LBT_NODE_CLASS_2D_2, WLZ_LBT_NODE_CLASS_2D_3, WLZ_LBT_NODE_CLASS_2D_4, WLZ_LBT_NODE_CLASS_2D_5, WLZ_MESH_TOLERANCE, WlzCMeshMatchNNod2D(), WlzCMeshMatchNNod3D(), WlzCMeshNew3D(), WlzCMeshNewElm2D(), WlzCMeshNewElm3D(), WlzCMeshNewNod2D(), WlzCMeshNewNod3D(), WlzCMeshReassignGridCells3D(), WlzCMeshVerify2D(), WlzCMeshVerify3D(), WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), WlzLBTClassifyNode2D(), WlzLBTClassifyNodeFace3D(), WlzLBTKeyToBox3I(), WlzLBTKeyToPos2I(), WlzLBTKeyToPos3I(), WlzLBTNodeSz2D(), WlzLBTNodeSz3D(), _WlzIBox3::xMax, _WlzDBox3::xMax, _WlzIBox3::xMin, _WlzDBox3::xMin, _WlzIBox3::yMax, _WlzDBox3::yMax, _WlzIBox3::yMin, _WlzDBox3::yMin, _WlzIBox3::zMax, _WlzDBox3::zMax, _WlzIBox3::zMin, and _WlzDBox3::zMin.

Referenced by WlzCMeshFromObj3D().

WlzObject* WlzCMeshComputeNormalsIxv2D5 ( 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.

Returns
A new object with the same domain as the given object but with 3D normals for it's indexed values.

\[ n = \sum_{i\in E} {A_i n_i} \]

where \(A_i\) is the area of the i'th element \(n_i\) is it normal and \(E\) is the set of elements that use the node.

Parameters
gObjGiven 2D5 conforming mesh object.
nrmFlgAll normals will have unit length if this flag is non-zero.
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcMalloc(), AlcVectorItemGet(), ALG_M_SQRT3, _WlzDomain::cm2d5, _WlzObject::domain, _WlzCMeshElm2D5::edu, _WlzCMeshRes::elm, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D5::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D5::pos, _WlzCMesh2D5::res, _WlzObject::type, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_3_ADD, WLZ_VTX_3_CROSS, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SCALE, WLZ_VTX_3_SET, WLZ_VTX_3_SUB, WLZ_VTX_3_ZERO, WlzCMeshNodRingElmIndices2D5(), WlzFreeIndexedValues(), WlzFreeObj(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.