Woolz Image Processing
Version 1.8.3
|
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... | |
Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. 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... | |
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. More... | |
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. More... | |
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. 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... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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). More... | |
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(). More... | |
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. More... | |
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. 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... | |
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. More... | |
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. More... | |
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. 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... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. 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... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. 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... | |
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. More... | |
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. More... | |
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. 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... | |
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. 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... | |
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. More... | |
WlzCMesh3D * | WlzCMeshFromObj3D (WlzObject *obj, double minElmSz, double maxElmSz, WlzObject **dstDilObj, int conform, WlzErrorNum *dstErr) |
Constructs a 3D mesh from a 3D domain object. More... | |
WlzCMesh2D5 * | WlzCMeshFromGM (WlzGMModel *model, WlzErrorNum *dstErr) |
Constructs a 2D5 mesh from a 3D geometric model. More... | |
WlzCMesh2D * | WlzCMeshFromBalLBTDom2D (WlzLBTDomain2D *lDom, WlzObject *iObj, WlzErrorNum *dstErr) |
Constructs a 2D mesh from a balanced 2D linear binary tree domain. More... | |
WlzCMesh3D * | WlzCMeshFromBalLBTDom3D (WlzLBTDomain3D *lDom, WlzObject *iObj, WlzErrorNum *dstErr) |
Constructs a 3D mesh from a balanced 3D linear binary tree domain. More... | |
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. More... | |
WlzErrorNum | WlzCMeshElmFuse2D (WlzCMesh2D *mesh, WlzCMeshElm2D *gElm) |
Fuses the given element in the mesh. More... | |
WlzCMeshCbFn |
A pointer to a function called to make mesh entity properties. Parameters passed are: mesh, entity, data.
enum _WlzCMeshExpFlag |
Bit flags for extrapolation via an expanding front. Typedef: WlzCMeshExpFlag.
Possible mesh element conformation actions. Typedef: WlzCMeshConformAction.
Enumerator | |
---|---|
WLZ_CMESH_CONFORM_NONE | |
WLZ_CMESH_CONFORM_DELETE | |
WLZ_CMESH_CONFORM_MODIFY |
enum _WlzCMeshElmFlags |
Conforming mesh element flags. These are bit masks which are used in a conforming mesh's elements flags. Typedef: WlzCMeshElmFlags.
enum _WlzCMeshNodFlags |
Conforming mesh node flags. These are bit masks which are used in a conforming mesh's node flags. Typedef: WlzCMeshNodFlags.
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.
inObj | Input object which must be a WLZ_CMESH_2D5 object. |
scale | Scale factor to use from cmesh to 2D spatial domain. |
meanCrv | If non zero the curvatures are the mean rather than the Gaussian curvatures. |
interp | Type 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). |
dstErr | Destination 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_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(), 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.
inObj | Input object which must have a valid WLZ_CMESH_2D5 domain. |
dstErr | Destination 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.
inObj | Input object which must have a valid WLZ_CMESH_2D5 domain. |
dstErr | Destination 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.
inObj | Input 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. |
dstErr | Destination 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.
inObj | Input 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. |
dstErr | Destination 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.
mObj | Given constrained mesh object. |
dObj | Given displacement field object which should be a compound array object with the appropriate number of components for the mesh dimension. |
bgd | Background displacement for mesh nodes which are outside the given displacement field object. |
itp | Interpolation method (only WLZ_INTERPOLATION_NEAREST and WLZ_INTERPOLATION_LINEAR are valid). |
abs | Non-zero if the displacements are absolute positions rather than relative displacements. |
dstErr | Destination 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.
mObj | Given constrained mesh object with displacement values. |
bgd | Background displacement for field values outside the given mesh. |
itp | Interpolation method (only WLZ_INTERPOLATION_NEAREST and WLZ_INTERPOLATION_LINEAR are valid). |
invert | Invert the transform if non-zero. |
abs | Non-zero if the field displacements absolute positions rather than the relative displacements in the mesh values. |
dstErr | Destination 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.
gObj | Given conforming mesh object. |
unk | Array of unknown value flags which will be modified and must have space for at least the maximum index of the conforming mesh. |
itp | Method for extrapolation which must be either WLZ_INTERPOLATION_NEAREST or WLZ_INTERPOLATION_LINEAR. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_INDEXED_VALUES, WlzCopyValues(), and WlzMakeMain().
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.
objG | Given mesh object. |
rObjType | Return object type must either be WLZ_CMESH_2D or WLZ_2D_DOMAINOBJ. |
nSeeds | Number of seed nodes, if \(<\) 1 then all boundary nodes of the given mesh are used as seed nodes. |
seeds | Array of seed positions, may be NULL iff the number of seed nodes is \(<\) 1. It is an error if are not within the mesh. |
interp | Interpolation for 3D volumes (should be WLZ_INTERPOLATION_BARYCENTRIC or WLZ_INTERPOLATION_KRIG). |
dstErr | Destination 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.
objG | Given mesh object. |
rObjType | Return object type must either be WLZ_CMESH_2D or WLZ_2D_DOMAINOBJ. |
nSeeds | Number of seed nodes, if \(<\) 1 then all boundary nodes of the given mesh are used as seed nodes. |
seeds | Array of seed positions, may be NULL iff the number of seed nodes is \(<\) 1. It is an error if are not within the mesh. |
interp | Interpolation for 3D volumes (should be WLZ_INTERPOLATION_BARYCENTRIC or WLZ_INTERPOLATION_KRIG). |
dstErr | Destination 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.
mesh | Given mesh. |
distances | Array for computed distances. |
nSeeds | Number of seed nodes, if \(<\) 1 then all boundary nodes of the given mesh are used as seed nodes. |
seeds | Array 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(), AlcHeapNew(), _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, _AlcHeap::topPriLo, _WlzCMesh2D::type, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshCountBoundNodes2D(), and WlzValueSetDouble().
Referenced by 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.
mesh | Given mesh. |
distances | Array for computed distances. |
nSeeds | Number of seed nodes, if \(<\) 1 then all boundary nodes of the given mesh are used as seed nodes. |
seeds | Array 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(), AlcHeapNew(), _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, _AlcHeap::topPriLo, _WlzCMesh3D::type, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshCountBoundNodes3D(), and WlzValueSetDouble().
Referenced by 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.
obj0 | The first conforming mesh object. |
obj1 | The second conforming mesh object. |
dsp0 | If non-zero then use the displaced nodes of the first mesh. be valid node displacements. |
dstNodTab | Destination 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(). |
dstErr | Destination error pointer, may be NULL. |
References _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzIndexedValues::rank, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, _WlzIndexedValues::vType, WLZ_CMESH_2D, 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, and _WlzValues::x.
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.
tr0 | The first convex mesh transform. |
dsp0 | Use displaced node positions of the first convex mesh if non null. |
tr1 | The second convex mesh transform. |
dsp0 | Use 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. |
dstNodTab | Destination pointer for the node index table. May be NULL. See WlzCMeshIntersect(). |
dstErr | Destination error pointer, may be NULL. |
References ALC_ER_NONE, AlcCalloc(), AlcFree(), AlcVectorExtend(), AlcVectorItemGet(), _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzCMeshRes::elm, _WlzMeshElem::flags, _WlzCMeshNod2D::idx, _WlzCMeshElm2D::idx, _WlzMeshElem::idx, _WlzMeshTransform::maxElem, _WlzMeshTransform::maxNodes, _WlzCMeshRes::nod, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzCMesh2D::res, _WlzCMeshEntRes::vec, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_VTX_2_ADD, WlzCMeshFree2D(), WlzCMeshNew2D(), WlzCMeshNewElm2D(), WlzCMeshNewNod2D(), WlzCMeshReassignGridCells2D(), WlzCMeshUpdateBBox2D(), and WlzMeshElemFindVx().
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.
sObj | Object with 3D spatial domain. |
cObj | Object with the 2D5 mesh and displacements to a plane. |
delta | Distance normal to the surface within which intersection is allowed. |
scale | Additional scale factor from mesh to spatial domain. |
dstErr | Destination error pointer, may be NULL. |
References AlcVectorItemGet(), AlgHeapSortIdx(), _WlzDomain::cm2d5, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshRes::elm, _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_VTX_3_ADD, WLZ_VTX_3_SCALE, WLZ_VTX_3_SUB, WLZ_VTX_3_ZERO, WlzAssignObject(), WlzCMeshElmGetNodes2D5(), WlzCMeshExtract2D(), WlzCMeshToDomObj(), WlzFreeObj(), WlzFreeValues(), WlzGeomTriangleAABBIntersect3D(), WlzGeomTriangleNormal(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzIndexedValueGet(), WlzMakeMain(), WlzNewValueTb(), and _WlzValues::x.
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.
vObj | Voxel object with 3D spatial domain. |
mObj | Object with the 2D5 mesh and displacements to a plane. |
scale | Additional scale factor from mesh to spatial domain. |
dstErr | Destination error pointer, may be NULL. |
References AlcVectorItemGet(), _WlzDomain::cm2d5, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzCMeshNod2D5::edu, _WlzCMeshEdgU2D5::elm, _WlzCMeshRes::elm, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D5::idx, _WlzCMeshEdgU2D5::nnxt, _WlzCMeshRes::nod, _WlzCMeshNod2D5::pos, _WlzIterateWSpace::pos, _WlzCMesh2D5::res, _WlzObject::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, WLZ_3D_DOMAINOBJ, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_RASTERDIR_IPILIC, WLZ_VTX_2_SET, WLZ_VTX_2_SUB, WLZ_VTX_3_SET, WlzCMeshClosestNod2D5(), WlzCMeshElmGetNodes2D5(), WlzGeomTriangleVtxDistSq3D(), WlzIndexedValueGet(), WlzIterate(), WlzIterateInit(), WlzIterateWSpFree(), 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.
mesh | The given 2D mesh, must be valid. |
idx | Pointer to the index of the next node which should be set to zero at the start of an itteration, must not be NULL. |
all | Non-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.
mesh | The given 3D mesh, must be valid. |
idx | Pointer to the index of the next node which should be set to zero at the start of an itteration, must not be NULL. |
all | Non-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.
mesh | The given 2D mesh, must be valid. |
idx | Pointer to the index of the next element which should be set to zero at the start of an itteration, must not be NULL. |
all | Non-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.
mesh | The given 3D mesh, must be valid. |
idx | Pointer to the index of the next element which should be set to zero at the start of an itteration, must not be NULL. |
all | Non-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.
mObj | Given conforming mesh. |
disp | Scale factor for the displacements, 0.0 implies no displacements, 1.0 implies full displacement. |
dstErr | Destination 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).
mObj | Given conforming mesh. |
disp | Scale factor for the displacements, 0.0 implies no displacements, 1.0 implies full displacement. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, 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().
gObj | Given 2D5 conforming mesh object with valid displacements. |
dstErr | Destination error pointer, may be NULL. |
References AlcVectorExtendAndGet(), AlcVectorItemGet(), _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzValues::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshElm2D5::edu, _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntRes::nextIdx, _WlzCMeshEdgU2D5::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D5::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzObject::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, 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, WlzCMeshFree2D(), WlzCMeshNew2D(), WlzCMeshNewElm2D(), WlzCMeshNewNod2D(), WlzCMeshReassignGridCells2D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateMaxSqEdgLen2D(), WlzFreeObj(), 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.
mObj | Given mesh object. |
trans | If non zero domain corresponds to the transformed (instead of the untransformed mesh). For a transform, the objects values must be appropriate. |
scale | Additional scale factor from mesh to spatial domain. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::core, _WlzObject::domain, _WlzCoreDomain::type, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, and WLZ_ERR_PARAM_DATA.
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.
dObj | Given domain object. |
mObj | Given mesh object. |
itp | Interpolation method. |
ixi | Index into the indexed values. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzIndexedValues::rank, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_INDEXED_VALUES, and _WlzValues::x.
Referenced by WlzCMeshDispToField(), WlzCMeshDistance2D(), and WlzCMeshDistance3D().
double WlzCMeshElmMaxSqEdgLen2D | ( | WlzCMeshElm2D * | elm | ) |
Computes the mesh maximum edge length of the given element.
elm | The 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.
elm | The 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.
elm | The 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.
mesh | The 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 WlzCMeshAffineTransformMesh2D(), WlzCMeshFlatten2D5(), WlzCMeshFromObj2D(), WlzCMeshLaplacianSmooth2D(), WlzCMeshLPFilter(), and WlzCMeshSetVertices2D().
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.
mesh | The 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 WlzCMeshAffineTransformMesh2D5(), and WlzCMeshFromGM().
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.
mesh | The 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 WlzCMeshAffineTransformMesh3D(), WlzCMeshFromObj3D(), WlzCMeshLaplacianSmooth3D(), WlzCMeshLPFilter(), and WlzCMeshSetVertices3D().
void WlzCMeshUpdateBBox2D | ( | WlzCMesh2D * | mesh | ) |
Updates the bounding box of the 2D conforming mesh.
mesh | The mesh. |
References AlcVectorItemGet(), _WlzCMesh2D::bBox, _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_CMESH_2D, _WlzDBox2::xMax, _WlzDBox2::xMin, _WlzDBox2::yMax, and _WlzDBox2::yMin.
Referenced by WlzCMeshAffineTransformMesh2D(), WlzCMeshExtract2D(), WlzCMeshFlatten2D5(), WlzCMeshFromObj2D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshLaplacianSmooth2D(), WlzCMeshLPFilter(), and WlzCMeshSetVertices2D().
void WlzCMeshUpdateBBox2D5 | ( | WlzCMesh2D5 * | mesh | ) |
Updates the bounding box of the 2D5 conforming mesh.
mesh | The mesh. |
References AlcVectorItemGet(), _WlzCMesh2D5::bBox, _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D5::pos, _WlzCMesh2D5::res, _WlzCMesh2D5::type, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_2D5, _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.
Referenced by WlzCMeshAffineTransformMesh2D5(), and WlzCMeshFromGM().
void WlzCMeshUpdateBBox3D | ( | WlzCMesh3D * | mesh | ) |
Updates the bounding box of the 3D conforming mesh.
mesh | The mesh. |
References AlcVectorItemGet(), _WlzCMesh3D::bBox, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_3D, _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.
Referenced by WlzCMeshAffineTransformMesh3D(), WlzCMeshFromObj3D(), WlzCMeshLaplacianSmooth3D(), WlzCMeshLPFilter(), and WlzCMeshSetVertices3D().
void WlzCMeshSetNodFlags | ( | WlzCMeshP | mesh, |
unsigned int | flags | ||
) |
Sets the node flags for all valid nodes of the mesh.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given mesh. |
flags | Flags 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.
mesh | Given 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.
mesh | Given 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.
mesh | Given 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.
mesh | Given 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.
mesh | Given mesh. |
dstNNod | Return pointer for number of boundary nodes, must be non NULL. |
dstNod | Return 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.
mesh | Given mesh. |
dstNNod | Return pointer for number of boundary nodes, must be non NULL. |
dstNod | Return 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.
mesh | Given mesh. |
dstNNod | Return pointer for number of boundary nodes, must be non NULL. |
dstNod | Return pointer for array of boundary node indices, must be non NULL. |
ordered | If 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.
mesh | Given mesh. |
dstNNod | Return pointer for number of boundary nodes, must be non NULL. |
dstNod | Return 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.
mesh | Given 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.
mesh | Given 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.
mesh | Given 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.
mesh | Given 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.
mesh | Given 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.
mesh | Given 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.
mesh | Given 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.
nod | Given node of mesh. |
References _WlzCMeshNod2D::edu, _WlzCMeshNod2D::idx, _WlzCMeshEdgU2D::nnxt, and _WlzCMeshEdgU2D::opp.
Referenced by WlzCMeshCountBoundNodes2D(), 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.
nod | Given 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.
nod | Given node of mesh. |
References _WlzCMeshNod3D::edu, _WlzCMeshEdgU3D::face, _WlzCMeshNod3D::idx, _WlzCMeshEdgU3D::nnxt, and _WlzCMeshFace::opp.
Referenced by WlzCMeshCountBoundNodes3D(), WlzCMeshGetBoundNodes3D(), and WlzCMeshSetBoundNodFlags3D().
int WlzCMeshElmIsBoundary2D | ( | WlzCMeshElm2D * | elm | ) |
Checks whether the element is a boundary node by examining the edges for opposite edges.
elm | Given 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.
elm | Given 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.
Each node at position \form#173 is moved to \form#174:
\[ p'_i = (1 - \alpha)p_i + \frac{\alpha}{n}\sum_{j}^{n}{p_{ij}} \]
where \(\alpha\) is the weight factor.mesh | Given mesh. |
itr | Number of iterations. |
alpha | Weight factor. |
doBnd | Apply smoothing to boundary nodes if non-zero. |
update | Update 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().
mesh | Given mesh. |
itr | Number of iterations. |
alpha | Weight factor. |
doBnd | Apply smoothing to boundary nodes if non-zero. |
update | Update 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().
mesh | Given mesh. |
itr | Number of iterations. |
alpha | Weight factor. |
doBnd | Apply smoothing to boundary nodes if non-zero. |
update | Update 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.
mesh | Given mesh. |
kPB | The band pass frequency parameter. |
kSB | The band stop frequency parameter. |
dPB | The pass band maximum deviation. |
dSB | The stop band maximum deviation. |
maxItr | Maximum number of iterations. |
doBnd | Apply smoothing to boundary nodes if non-zero. |
update | Update 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.
mesh | Given mesh. |
lambda | Positive filter parameter. |
mu | Negative filter parameter. |
nItr | Number of itterations. |
doBnd | Filter boundary nodes in non-zero. |
update | Update the mesh bucket grid, bounding box and maximum edge length. |
References AlcMalloc(), _WlzCMeshP::m2, _WlzCMesh2D::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WlzCMeshSetBoundNodFlags(), 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.
mesh | The given mesh. |
vtxBuf | The buffer with vnode positions that are to be set in the model. |
update | Update 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().
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.
mesh | The given mesh. |
vtxBuf | The buffer with vnode positions that are to be set in the model. |
update | Update 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.
mesh | The given mesh. |
vtxBuf | The buffer with vnode positions that are to be set in the model. |
update | Update 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.
mesh | Given mesh. |
dstElm | Destination mesh element pointer for last mesh element, may be NULL. |
allErr | If non zero the checking conmtinues after an error has been found, else if zero the checking stops after the first error has been found. |
fP | Stream 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.
mesh | Given mesh. |
dstElm | Destination mesh element pointer for last mesh element, may be NULL. |
allErr | If non zero the checking conmtinues after an error has been found, else if zero the checking stops after the first error has been found. |
fP | Stream 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(), and WlzCMeshVerify().
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.
mesh | Given mesh. |
dstElm | Destination mesh element pointer for last mesh element, may be NULL. |
allErr | If non zero the checking conmtinues after an error has been found, else if zero the checking stops after the first error has been found. |
fP | Stream 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().
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.
mesh | Given mesh. |
dstElm | Destination mesh element pointer for last mesh element, may be NULL. |
allErr | If non zero the checking conmtinues after an error has been found, else if zero the checking stops after the first error has been found. |
fP | Stream 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(), 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.
mesh | Given mesh. |
dstNElm | Destination pointer for the number of mesh elements. May be NULL. |
dstIdx | Destination pointer for element indices. May be NULL. |
dstVol | Destination pointer for the area or volume of the elements. May be NULL. |
dstMinLen | Destination pointer for the minimum edge length of the elements. |
dstMaxLen | Destination 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.
mesh | Given 2D mesh. |
dstNElm | Destination pointer for the number of mesh elements. May be NULL. |
dstIdx | Destination pointer for element indices. May be NULL. |
dstVol | Destination pointer for the area or volume of the elements. May be NULL. |
dstMinLen | Destination pointer for the minimum edge length of the elements. |
dstMaxLen | Destination 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.
mesh | Given 3D mesh. |
dstNElm | Destination pointer for the number of mesh elements. May be NULL. |
dstIdx | Destination pointer for element indices. May be NULL. |
dstVol | Destination pointer for the area or volume of the elements. May be NULL. |
dstMinLen | Destination pointer for the minimum edge length of the elements. |
dstMaxLen | Destination 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.
elm | Given 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.
elm | Given 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.
elm | Given 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.
elm | Given mesh element. |
dstNod0 | First destination pointer for node. |
dstNod1 | Second destination pointer for node. |
dstNod2 | Third 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.
elm | Given mesh element. |
dstNod0 | First destination pointer for node. |
dstNod1 | Second destination pointer for node. |
dstNod2 | Third 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(), and WlzCMeshIntersectDom2D5().
void WlzCMeshElmGetNodes3D | ( | WlzCMeshElm3D * | elm, |
WlzCMeshNod3D ** | dstNod0, | ||
WlzCMeshNod3D ** | dstNod1, | ||
WlzCMeshNod3D ** | dstNod2, | ||
WlzCMeshNod3D ** | dstNod3 | ||
) |
Gets the four nodes of a 3D element.
elm | Given mesh element. |
dstNod0 | First destination pointer for node. |
dstNod1 | Second destination pointer for node. |
dstNod2 | Third destination pointer for node. |
dstNod3 | Forth 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.
elm | Given 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.
WlzDBox3 WlzCMeshElmBBox2D5 | ( | WlzCMeshElm2D5 * | elm | ) |
Gets the axis aligned bounding box of a 3D element.
elm | Given mesh element. |
References _WlzCMeshElm2D5::edu, _WlzCMeshEdgU2D5::nod, _WlzCMeshNod2D5::pos, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.
WlzDBox3 WlzCMeshElmBBox3D | ( | WlzCMeshElm3D * | elm | ) |
Gets the axis aligned bounding box of a 3D element.
elm | Given mesh element. |
References _WlzCMeshFace::edu, _WlzCMeshElm3D::face, _WlzCMeshEdgU3D::nod, _WlzCMeshNod3D::pos, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.
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.
gNod | Given node. |
gMaxElm | Maximum space currently allocated in the array. |
gElmIdxAry | Pointer to array of ints, which may be NULL or a valid array for maxElm ints which can be reallocated as needed by AlcRealloc(). |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcRealloc(), AlgHeapSort(), AlgHeapSortCmpIFn(), _WlzCMeshNod3D::edu, _WlzCMeshFace::elm, _WlzCMeshEdgU3D::face, _WlzCMeshElm3D::idx, _WlzCMeshEdgU3D::nnxt, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.
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.
gvnMesh | Given mesh. |
squeeze | Squeeze out invalid (deleted entities if non zero). |
datSz | Size of associated datum. |
newDat | Destination pointer for the copied associated data, may be NULL. |
gvnDat | Given associated data, may be NULL. |
dstErr | Destination 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.
gvnMesh | Given mesh. |
squeeze | Squeeze out invalid (deleted entities if non zero). |
datSz | Size of associated datum. |
newDat | Destination pointer for the copied associated data, may be NULL. |
gvnDat | Given associated data, may be NULL. |
dstErr | Destination 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 WlzBasisFnInvertMakeCMeshTr2D(), WlzCMeshCopy(), 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.
gvnMesh | Given mesh. |
squeeze | Squeeze out invalid (deleted entities if non zero). |
datSz | Size of associated datum. |
newDat | Destination pointer for the copied associated data, may be NULL. |
gvnDat | Given associated data, may be NULL. |
dstErr | Destination 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 WlzCMeshCopy(), 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.
gvnMesh | Given mesh. |
squeeze | Squeeze out invalid (deleted entities if non zero). |
datSz | Size of associated datum. |
newDat | Destination pointer for the copied associated data, may be NULL. |
gvnDat | Given associated data, may be NULL. |
dstErr | Destination 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 WlzBasisFnInvertMakeCMeshTr3D(), WlzCMeshCopy(), and WlzCopyDomain().
WlzErrorNum WlzCMeshFixNegativeElms | ( | WlzCMeshP | mesh | ) |
Reorders nodes in any elements which have negative area.
mesh | The 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().
WlzErrorNum WlzCMeshFixNegativeElms2D | ( | WlzCMesh2D * | mesh | ) |
Reorders nodes in any elements which have negative area.
mesh | Given 2D constrained mesh. |
References AlcVectorItemGet(), _WlzCMeshNod2D::edu, _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::elm, _WlzCMeshRes::elm, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::nnxt, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU2D::opp, _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_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE_SQ, WlzCMeshSetElm2D(), and WlzGeomTriangleSnArea2().
Referenced by WlzCMeshFixNegativeElms().
WlzErrorNum WlzCMeshFixNegativeElms3D | ( | WlzCMesh3D * | mesh | ) |
Reorders nodes in any elements which have negative area.
mesh | Given 3D constrained mesh. |
References AlcVectorItemGet(), _WlzCMeshNod3D::edu, _WlzCMeshFace::edu, _WlzCMeshFace::elm, _WlzCMeshRes::elm, _WlzCMeshElm3D::face, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU3D::nod, _WlzCMeshFace::opp, _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_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE_SQ, WlzCMeshSetElm3D(), and WlzGeomTetraSnVolume6().
Referenced by WlzCMeshFixNegativeElms().
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.
mesh | Given mesh. |
dstMinNodPerCell | Destination pointer for the minimum number of nodes per cell. |
dstMaxNodPerCell | Destination pointer for the maximum number of nodes per cell. |
dstMeanNodPerCell | Destination pointer for the mean number of nodes per cell. |
dstMinElmPerCell | Destination pointer for the minimum number of nodes per cell. |
dstMaxElmPerCell | Destination pointer for the maximum number of nodes per cell. |
dstMeanElmPerCell | Destination 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.
mesh | Given mesh. |
dstMinNodPerCell | Destination pointer for the minimum number of nodes per cell. |
dstMaxNodPerCell | Destination pointer for the maximum number of nodes per cell. |
dstMeanNodPerCell | Destination pointer for the mean number of nodes per cell. |
dstMinElmPerCell | Destination pointer for the minimum number of nodes per cell. |
dstMaxElmPerCell | Destination pointer for the maximum number of nodes per cell. |
dstMeanElmPerCell | Destination 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.
mesh | Given mesh. |
dstMinNodPerCell | Destination pointer for the minimum number of nodes per cell. |
dstMaxNodPerCell | Destination pointer for the maximum number of nodes per cell. |
dstMeanNodPerCell | Destination pointer for the mean number of nodes per cell. |
dstMinElmPerCell | Destination pointer for the minimum number of nodes per cell. |
dstMaxElmPerCell | Destination pointer for the maximum number of nodes per cell. |
dstMeanElmPerCell | Destination 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.
mesh | The mesh. |
dstNNod | Destination 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.
mesh | The mesh. |
dstNNod | Destination 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.
mesh | The mesh. |
dstNNod | Destination 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.
mesh | The mesh. |
idxTb | The 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.
mesh | The mesh. |
idxTb | The allocated index table to be populated. |
References AlcVectorItemGet(), _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D5::res, and _WlzCMeshEntRes::vec.
Referenced by 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.
mesh | The mesh. |
idxTb | The 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.
mesh | The mesh. |
dstNElm | Destination 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.
mesh | The mesh. |
dstNElm | Destination 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.
mesh | The mesh. |
dstNElm | Destination 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.
mesh | The mesh. |
idxTb | The 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.
mesh | The mesh. |
idxTb | The allocated index table to be populated. |
References AlcVectorItemGet(), _WlzCMeshRes::elm, _WlzCMeshElm2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMesh2D5::res, and _WlzCMeshEntRes::vec.
Referenced by 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.
mesh | The mesh. |
idxTb | The 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.
nod | Given 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.
nod | Given node which must be valid. |
maxIdxBuf | Pointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return. |
idxBuf | Pointer 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. |
dstErr | Destination 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.
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.
nod | Given node which must be valid. |
maxIdxBuf | Pointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return. |
idxBuf | Pointer 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. |
dstErr | Destination 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.
nod | Given node which must be valid. |
maxIdxBuf | Pointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return. |
idxBuf | Pointer 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. |
dstErr | Destination 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 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.
nod | Given node which must be valid. |
maxIdxBuf | Pointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return. |
idxBuf | Pointer 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. |
dstErr | Destination 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.
elm | Given element which must be valid. |
maxIdxBuf | Pointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return. |
idxBuf | Pointer 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. |
dstErr | Destination 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.
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.
elm | Given element which must be valid. |
maxIdxBuf | Pointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return. |
idxBuf | Pointer 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. |
dstErr | Destination 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.
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.
elm | Given element which must be valid. |
maxIdxBuf | Pointer to the current maximum number of indices possible in the current buffer. This must be valid and may be modified on return. |
idxBuf | Pointer 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. |
dstErr | Destination 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.
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.
cObj | Conforming mesh object with values to be normalised attached.. |
mapZero | Map the value of zero to the zero value if non zero. |
vZero | Value for zero if mapZero is non-zero. |
vMin | Minimum value on return. |
vMax | Maximum value on return. |
oFrac | Outlier 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 _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, and WLZ_ERR_VALUES_NULL.
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.
obj | Given conforming mesh object with values. |
lo | Lower limit value of range, may be NaN. |
hi | Upper limit value of range, may be NaN. |
in | If zero set bytes to non-zero when test is not satisfied, otherwise if zero set bytes to non-zero when test is satisfied. |
dstErr | Destination 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.
srcObj | Given source mesh object which must be of the same type as the target and have values attached. |
tgtObj | Given target mesh object which must be of the same type as the source. |
extVal | Given external value to use outside of the source - target mesh intersection. |
interp | Interpolation method. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_TYPE, WLZ_ERR_VALUES_NULL, WLZ_INTERPOLATION_BARYCENTRIC, WLZ_INTERPOLATION_LINEAR, and WLZ_INTERPOLATION_NEAREST.
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.
dstErr | Destination 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(), and WlzCMeshIntersect2Mesh2D().
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.
dstErr | Destination 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(), and WlzCMeshFromGM().
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.
dstErr | Destination 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(), and WlzCMeshFromBalLBTDom3D().
WlzErrorNum WlzCMeshAddNewNodCb2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a new 2D node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshAddNewNodCb2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a new 2D5 node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshAddNewNodCb3D | ( | WlzCMesh3D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a new 3D node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshAddNewElmCb2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a new 2D element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshAddNewElmCb2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a new 2D5 element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshAddNewElmCb3D | ( | WlzCMesh3D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a new 3D element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshAddDelElmCb2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a 2D deleted element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshAddDelElmCb2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a 2D5 deleted element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshAddDelElmCb3D | ( | WlzCMesh3D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Adds a 3D deleted element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemNewNodCb2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a new 2D node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemNewNodCb2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a new 2D5 node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemNewNodCb3D | ( | WlzCMesh3D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a new 3D node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemNewElmCb2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a new 2D element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemNewElmCb2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a new 2D5 element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemNewElmCb3D | ( | WlzCMesh3D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a new 3D element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemDelNodCb2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a deleted 2D node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemDelNodCb2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a deleted 2D5 node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemDelNodCb3D | ( | WlzCMesh3D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a deleted 3D node callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemDelElmCb2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a deleted 2D element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemDelElmCb2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a deleted 2D5 element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References WLZ_ERR_NONE.
WlzErrorNum WlzCMeshRemDelElmCb3D | ( | WlzCMesh3D * | mesh, |
WlzCMeshCbFn | fn, | ||
void * | data | ||
) |
Removes a deleted 3D element callback to the mesh.
mesh | Given mesh. |
fn | Function to be called. |
data | Callback data for function. |
References 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.
mesh | The mesh for resources. |
pos | Position for the node. |
dstErr | Destination error pointer, may be NULL. |
References _WlzCMeshNod2D::next, _WlzCMeshNod2D::pos, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzCMeshAllocNod2D().
Referenced by WlzCMeshCopy2D(), WlzCMeshFlatten2D5(), and WlzCMeshIntersect2Mesh2D().
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.
mesh | The mesh for resources. |
pos | Position for the node. |
dstErr | Destination error pointer, may be NULL. |
References _WlzCMeshNod2D5::next, _WlzCMeshNod2D5::pos, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzCMeshAllocNod2D5().
Referenced by WlzCMeshCopy2D5().
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.
mesh | The mesh for resources. |
pos | Position for the node. |
dstErr | Destination error pointer, may be NULL. |
References _WlzCMeshNod3D::flags, _WlzCMeshNod3D::pos, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WlzCMeshAllocNod3D().
Referenced by WlzCMeshCopy3D().
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.
mesh | Mesh with resources. |
References AlcVectorExtendAndGet(), _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntRes::nextIdx, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D::res, and _WlzCMeshEntRes::vec.
Referenced by WlzCMeshCopy2D(), WlzCMeshExtract2D(), and WlzCMeshNewNod2D().
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.
mesh | Mesh with resources. |
References AlcVectorExtendAndGet(), _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntRes::nextIdx, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D5::res, and _WlzCMeshEntRes::vec.
Referenced by WlzCMeshCopy2D5(), WlzCMeshFromGM(), and WlzCMeshNewNod2D5().
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.
mesh | Mesh 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.
mesh | The mesh for resources. |
nod0 | First mesh node. |
nod1 | Second mesh node. |
nod2 | Third mesh node. |
allowFlip | Allow flipping of node order to get valid element. |
dstErr | Destination error pointer, may be NULL. |
References WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshAllocElm2D(), and WlzCMeshSetElm2D().
Referenced by WlzCMeshCopy2D(), WlzCMeshFlatten2D5(), and WlzCMeshIntersect2Mesh2D().
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.
mesh | The mesh for resources. |
nod0 | First mesh node. |
nod1 | Second mesh node. |
nod2 | Third mesh node. |
allowFlip | Allow flipping of node order to get valid element. |
dstErr | Destination error pointer, may be NULL. |
References WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshAllocElm2D5(), and WlzCMeshSetElm2D5().
Referenced by WlzCMeshCopy2D5(), and WlzCMeshFromGM().
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.
mesh | The mesh for resources. |
nod0 | First mesh node. |
nod1 | Second mesh node. |
nod2 | Third mesh node. |
nod3 | Fourth mesh node. |
allowFlip | Allow flipping of node order to get valid element. |
dstErr | Destination error pointer, may be NULL. |
References WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WlzCMeshAllocElm3D(), and WlzCMeshSetElm3D().
Referenced by WlzCMeshCopy3D().
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.
mesh | Mesh 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.
mesh | Mesh 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.
mesh | Mesh 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.
mesh | The mesh. |
elm | Given mesh element. |
nod0 | First mesh node of element. |
nod1 | Second mesh node of element. |
nod2 | Third mesh node of element. |
allowFlip | Allow 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.
mesh | The mesh. |
elm | Given mesh element. |
nod0 | First mesh node of element. |
nod1 | Second mesh node of element. |
nod2 | Third mesh node of element. |
allowFlip | Allow 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.
mesh | The mesh. |
elm | Given mesh element. |
nod0 | First mesh node of element. |
nod1 | Second mesh node of element. |
nod2 | Third mesh node of element. |
nod3 | Fourth mesh node of element. |
allowFlip | Allow flipping of node order to get valid element. |
References _WlzCMeshNod3D::edu, _WlzCMeshFace::edu, _WlzCMeshElm3D::face, _WlzCMeshEdgU3D::next, _WlzCMeshEdgU3D::nod, _WlzCMeshNod3D::pos, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_MESH_TOLERANCE_SQ, and WlzGeomTetraSnVolume6().
Referenced by WlzCMeshFixNegativeElms3D(), and WlzCMeshNewElm3D().
WlzErrorNum WlzCMeshFree | ( | WlzCMeshP | mesh | ) |
Free's the mesh, it's cells, nodes and elements.
mesh | Mesh 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 WlzCMeshFree2D | ( | WlzCMesh2D * | mesh | ) |
Free's the 2D mesh, it's cells, nodes and elements.
mesh | Mesh to free. |
References AlcBlockStackFree(), AlcVectorFree(), _WlzCMeshCellGrid2D::allCE, _WlzCMesh2D::cGrid, _WlzCMeshRes::elm, _WlzCMesh2D::linkcount, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMeshEntRes::vec, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzUnlink().
Referenced by WlzCMeshCopy2D(), WlzCMeshFlatten2D5(), WlzCMeshFree(), WlzCMeshIntersect2Mesh2D(), WlzCMeshNew2D(), WlzFreeDomain(), and WlzFreeObj().
WlzErrorNum WlzCMeshFree2D5 | ( | WlzCMesh2D5 * | mesh | ) |
Free's the 2D5 mesh, it's cells, nodes and elements.
mesh | Mesh to free. |
References AlcBlockStackFree(), AlcVectorFree(), _WlzCMeshCellGrid2D5::allCE, _WlzCMesh2D5::cGrid, _WlzCMeshRes::elm, _WlzCMesh2D5::linkcount, _WlzCMeshRes::nod, _WlzCMesh2D5::res, _WlzCMeshEntRes::vec, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzUnlink().
Referenced by WlzCMeshCopy2D5(), WlzCMeshFree(), WlzCMeshFromGM(), WlzCMeshNew2D5(), and WlzFreeObj().
WlzErrorNum WlzCMeshFree3D | ( | WlzCMesh3D * | mesh | ) |
Free's the 3D mesh, it's cells, nodes and elements.
mesh | Mesh to free. |
References AlcBlockStackFree(), AlcVectorFree(), _WlzCMeshCellGrid3D::allCE, _WlzCMesh3D::cGrid, _WlzCMeshRes::elm, _WlzCMesh3D::linkcount, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMeshEntRes::vec, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzUnlink().
Referenced by WlzCMeshCopy3D(), WlzCMeshFree(), WlzCMeshNew3D(), WlzFreeDomain(), and WlzFreeObj().
WlzErrorNum WlzCMeshDelNod2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshNod2D * | nod | ||
) |
Deletes the 2D mesh node. This function assumes that the node is no longer used by any elements.
mesh | The mesh to which the node belongs. |
nod | The given node. |
References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh2D::res, WLZ_ERR_DOMAIN_NULL, and WLZ_ERR_NONE.
Referenced by 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.
mesh | The mesh to which the node belongs. |
nod | The given node. |
References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh2D5::res, WLZ_ERR_DOMAIN_NULL, and WLZ_ERR_NONE.
Referenced by 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.
mesh | The mesh to which the node belongs. |
nod | The given node. |
References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::nod, _WlzCMesh3D::res, WLZ_ERR_DOMAIN_NULL, and WLZ_ERR_NONE.
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.
mesh | The mesh to which the element belongs. |
elm | The given element. |
References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::elm, _WlzCMesh2D::res, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzCMeshVerify2D().
Referenced by WlzCMeshBoundConform2D().
WlzErrorNum WlzCMeshDelElm2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzCMeshElm2D5 * | elm | ||
) |
Deletes the 2D5 mesh element and any mesh nodes that are used exclusively by this mesh element.
mesh | The mesh to which the element belongs. |
elm | The given element. |
References _WlzCMeshEntRes::delEntCb, _WlzCMeshRes::elm, _WlzCMesh2D5::res, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, 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.
mesh | The mesh to which the element belongs. |
elm | The given element. |
References _WlzCMeshNod3D::edu, _WlzCMeshFace::edu, _WlzCMeshFace::elm, _WlzCMeshElm3D::face, _WlzCMeshEdgU3D::nnxt, _WlzCMeshEdgU3D::nod, _WlzCMeshFace::opp, WLZ_ERR_NONE, and WlzCMeshDelNod3D().
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.
mesh | Input mesh |
nod | Given mesh node. |
References _WlzCMeshNod2D::idx.
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.
mesh | Input mesh |
nod | Given mesh node. |
References _WlzCMeshNod2D5::idx.
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.
mesh | Input mesh |
nod | Given mesh node. |
References _WlzCMeshNod3D::idx.
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.
mesh | Input mesh |
elm | Given mesh element. |
References _WlzCMeshElm2D::idx.
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.
mesh | Input mesh |
elm | Given mesh element. |
References _WlzCMeshElm2D5::idx.
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.
mesh | Input mesh |
elm | Given mesh element. |
References _WlzCMeshElm3D::idx.
void WlzCMeshDelUnusedNodes3D | ( | WlzCMesh3D * | mesh | ) |
Deletes any unused neodes, ie nodes that do not have edge uses, from the given mesh.
mesh | Given mesh. |
References AlcVectorItemGet(), _WlzCMeshNod3D::edu, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_3D, and WlzCMeshDelNod3D().
void WlzCMeshDelUnusedNodes2D5 | ( | WlzCMesh2D5 * | mesh | ) |
Deletes any unused neodes, ie nodes that do not have edge uses, from the given mesh.
mesh | Given 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.
mesh | Given mesh. |
References AlcVectorItemGet(), _WlzCMeshNod2D::edu, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, WLZ_CMESH_2D, and WlzCMeshDelNod2D().
WlzErrorNum WlzCMeshAffineTransformMesh2D | ( | WlzCMesh2D * | mesh, |
WlzAffineTransform * | tr | ||
) |
Affine transforms the node positions of the given 2D mesh.
mesh | Given mesh. |
tr | Affine transform. |
References AlcVectorItemGet(), _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzCMeshEntRes::vec, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WlzAffineTransformDimension(), WlzAffineTransformVertexD2(), WlzCMeshReassignGridCells2D(), WlzCMeshUpdateBBox2D(), and WlzCMeshUpdateMaxSqEdgLen2D().
Referenced by WlzCMeshFromObj2D().
WlzErrorNum WlzCMeshAffineTransformMesh2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzAffineTransform * | tr | ||
) |
Affine transforms the node positions of the given 2D5 mesh.
mesh | Given mesh. |
tr | Affine transform. |
References AlcVectorItemGet(), _WlzCMeshNod2D5::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D5::pos, _WlzCMesh2D5::res, _WlzCMeshEntRes::vec, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WlzAffineTransformDimension(), WlzAffineTransformVertexD3(), WlzCMeshReassignGridCells2D5(), WlzCMeshUpdateBBox2D5(), and WlzCMeshUpdateMaxSqEdgLen2D5().
WlzErrorNum WlzCMeshAffineTransformMesh3D | ( | WlzCMesh3D * | mesh, |
WlzAffineTransform * | tr | ||
) |
Affine transforms the node positions of the given 3D mesh.
mesh | Given mesh. |
tr | Affine transform. |
References AlcVectorItemGet(), _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzCMeshEntRes::vec, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WlzAffineTransformDimension(), WlzAffineTransformVertexD3(), WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox3D(), and WlzCMeshUpdateMaxSqEdgLen3D().
Referenced by WlzCMeshFromObj3D().
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().
mesh | Given mesh. |
obj | Object with domain to which the mesh should conform. |
mtd | Method for determining the position of a vertex just outside the object's domain, see WlzGeomObjLineSegIntersect2D(). |
tol | Acceptable 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.
On return the mesh bounding box and location grid will be invalid and the following functions should be called: WlzCMeshUpdateBBox3D(), WlzCMeshUpdateMaxSqEdgLen3D() and WlzCMeshReassignGridCells3D().
mesh | Given mesh. |
obj | Object with domain to which the mesh should conform. |
mtd | Method for determining the position of a vertex just outside the object's domain, see WlzGeomObjLineSegIntersect3D(). |
tol | Acceptable 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.
elm | Given 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.
elm | Given element, must be valid. |
dstMinSq | Destination pointer for minimum squared edge length, may be NULL. |
dstMaxSq | Destination 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.
double WlzCMeshElmMinEdgLnSq3D | ( | WlzCMeshElm3D * | elm | ) |
Computes the square of the minimum edge length for the element.
elm | Given element. |
References _WlzCMeshElm3D::idx, 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 WlzCMeshReassignGridCells2D | ( | WlzCMesh2D * | mesh, |
int | newNumNod | ||
) |
Allocates a new cell grid and then reassigns the nodes to the cells.
mesh | The mesh. |
newNumNod | New expected number of nodes. |
References _WlzCMesh2D::bBox, _WlzCMeshCellGrid2D::cellSz, _WlzCMesh2D::cGrid, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D::res, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_NONE, _WlzDBox2::xMax, _WlzDBox2::xMin, _WlzDBox2::yMax, and _WlzDBox2::yMin.
Referenced by WlzCMeshAffineTransformMesh2D(), WlzCMeshCopy2D(), WlzCMeshExtract2D(), WlzCMeshFlatten2D5(), WlzCMeshFromBalLBTDom2D(), WlzCMeshFromObj2D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshLaplacianSmooth2D(), WlzCMeshLPFilter(), and WlzCMeshSetVertices2D().
WlzErrorNum WlzCMeshReassignGridCells2D5 | ( | WlzCMesh2D5 * | mesh, |
int | newNumNod | ||
) |
Allocates a new cell grid and then reassigns the nodes and elements to the cells.
mesh | The mesh. |
newNumNod | New 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 _WlzCMesh2D5::bBox, _WlzCMeshCellGrid2D5::cellSz, _WlzCMesh2D5::cGrid, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D5::res, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.
Referenced by WlzCMeshAffineTransformMesh2D5(), WlzCMeshCopy2D5(), and WlzCMeshFromGM().
WlzErrorNum WlzCMeshReassignGridCells3D | ( | WlzCMesh3D * | mesh, |
int | newNumNod | ||
) |
Allocates a new cell grid and then reassigns the nodes and elements to the cells.
mesh | The mesh. |
newNumNod | New 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 _WlzCMesh3D::bBox, _WlzCMeshCellGrid3D::cellSz, _WlzCMesh3D::cGrid, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh3D::res, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.
Referenced by WlzCMeshAffineTransformMesh3D(), WlzCMeshCopy3D(), WlzCMeshFromBalLBTDom3D(), WlzCMeshFromObj3D(), WlzCMeshLaplacianSmooth3D(), WlzCMeshLPFilter(), and WlzCMeshSetVertices3D().
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.
mesh | The mesh. |
pos | Given node position. |
tol | Tollerance to use when finding mesh node. |
dstNod | Destination pointer for the matched node which will be NULL if there is no node at the given position. Must not be NULL. |
References _WlzCMeshCellGrid2D::cellSz, _WlzCMesh2D::cGrid, _WlzDVertex2::vtX, and _WlzDVertex2::vtY.
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.
mesh | The mesh. |
pos | Given node position. |
tol | Tollerance to use when finding mesh node. |
dstNod | Destination pointer for the matched node which will be NULL if there is no node at the given position. Must not be NULL. |
References _WlzCMeshCellGrid2D5::cellSz, _WlzCMesh2D5::cGrid, _WlzDVertex3::vtX, _WlzDVertex3::vtY, and _WlzDVertex3::vtZ.
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.
mesh | The mesh. |
pos | Given node position. |
dstGPos | Destination pointer for the grid position. Must not be NULL. |
dstPrev | Destination 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. |
tol | Tollerance to use when finding mesh node. |
dstNod | Destination pointer for the matched node which will be NULL if there is no node at the given position. Must not be NULL. |
References _WlzCMeshCellGrid3D::cellSz, _WlzCMesh3D::cGrid, _WlzDVertex3::vtX, _WlzDVertex3::vtY, and _WlzDVertex3::vtZ.
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.
mesh | The mesh. |
nPos | Given vertex position. |
tol | Match tolerance. |
References WlzCMeshLocateNod2D().
Referenced by 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.
mesh | The mesh. |
nPos | Given vertex position. |
tol | Match 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.
mesh | The mesh. |
nPos | Given vertex position. |
tol | Match 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.
mesh | The mesh. |
nNod | Number of node positions to match. |
nPos | Node positions. |
tol | Match tolerance. |
mNod | Array for matched nodes. |
References WlzCMeshMatchNod2D().
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.
mesh | The mesh. |
nNod | Number of node positions to match. |
nPos | Node positions. |
tol | Match tolerance. |
mNod | Array 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.
mesh | The mesh. |
nNod | Number of node positions to match. |
nPos | Node positions. |
tol | Match tolerance. |
mNod | Array for matched nodes. |
References WlzCMeshMatchNod3D().
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.
mesh | The mesh. |
nNod | Number of node positions to match. |
nPos | Node positions. |
tol | Match tolerance. |
mIdx | For 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.
mesh | The mesh. |
nNod | Number of node positions to match. |
nPos | Node positions. |
tol | Match tolerance. |
mIdx | For 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.
mesh | The mesh. |
nNod | Number of node positions to match. |
nPos | Node positions. |
tol | Match tolerance. |
mIdx | For 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.
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.
mesh | The mesh. |
lastElmIdx | Last element index to help efficient location. If negative this is ignored. |
pX | Column coordinate of position. |
pY | Line coordinate of position. |
pZ | Plane coordinate of position (ignored for 2D). |
exhaustive | If 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. |
dstCloseNod | If 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.
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.
mesh | The mesh. |
lastElmIdx | Last element index to help efficient location. If negative this is ignored. |
pX | Column coordinate of position. |
pY | Line coordinate of position. |
exhaustive | If 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. |
dstCloseNod | If 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 WlzCMeshCurvToImage(), WlzCMeshElmEnclosingPos(), WlzCMeshTransformVtxAry2D(), WlzCMeshTransformVtxAry2F(), and WlzCMeshTransformVtxAry2I().
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.
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.
mesh | The mesh. |
dummyLastElmIdx | Last element index used to help efficient location for 2D and 3D, but ignored by this function. |
pX | Column coordinate of position. |
pY | Line coordinate of position. |
pZ | Plane coordinate of position. |
exhaustive | If 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. |
dstCloseNod | If 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 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.
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.
mesh | The mesh. |
lastElmIdx | Last element index to help efficient location. If negative this is ignored. |
pX | Column coordinate of position. |
pY | Line coordinate of position. |
pZ | Plane coordinate of position. |
exhaustive | If 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. |
dstCloseNod | If 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 WlzCMeshElmEnclosingPos(), WlzCMeshTransformVtxAry3D(), WlzCMeshTransformVtxAry3F(), WlzCMeshTransformVtxAry3I(), and WlzCMeshTrRegSM3D().
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.
mesh | The mesh. |
dstPos | Destination pointer for found position within element. Not set if element returned is invalid. |
pos | Given vertex position. |
dMax | Maximum 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.
mesh | The mesh. |
dstPos | Destination pointer for found position within element. Not set if element returned is invalid. May be NULL. |
pos | Given vertex position. |
dMax | Maximum distance for found position from given position. |
References _WlzCMeshCellGrid2D::cellSz, _WlzCMesh2D::cGrid, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D::res, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, and _WlzDVertex2::vtY.
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.
mesh | The mesh. |
dstPos | Destination pointer for found position within element. Not set if element returned is invalid. |
pos | Given vertex position. |
dMax | Maximum distance for found position from given position. |
References _WlzCMeshCellGrid3D::cellSz, _WlzCMesh3D::cGrid, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh3D::res, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, and _WlzDVertex3::vtZ.
Referenced by WlzCMeshElmClosestPosIn().
int WlzCMeshClosestNod2D | ( | WlzCMesh2D * | mesh, |
WlzDVertex2 | pos | ||
) |
Finds the index of the closest node to the given position.
Finds the index of the closest node to the given position by spiraling out from the cell containing the given position.
mesh | Given mesh. |
pos | Given position. |
References _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D::res, _WlzIVertex2::vtX, and _WlzIVertex2::vtY.
int WlzCMeshClosestNod2D5 | ( | WlzCMesh2D5 * | mesh, |
WlzDVertex3 | p | ||
) |
Finds the index of the closest node to the given position.
Finds the index of the closest node to the given position by spiraling out from the cell containing the given position.
mesh | Given mesh. |
p | Given position. |
References _WlzCMesh2D5::bBox, _WlzCMeshCellGrid2D5::cellSz, _WlzCMesh2D5::cGrid, _WlzCMeshCellGrid2D5::nCells, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh2D5::res, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_MESH_TOLERANCE, WLZ_VTX_3_SET, _WlzDBox3::xMin, _WlzDBox3::yMin, and _WlzDBox3::zMin.
Referenced by WlzCMeshClosePointDom2D5(), and WlzCMeshCompSurfMap().
int WlzCMeshClosestNod3D | ( | WlzCMesh3D * | mesh, |
WlzDVertex3 | pos | ||
) |
Finds the index of the closest node to the given position.
Finds the index of the closest node to the given position by spiraling out from the cell containing the given position.
mesh | Given mesh. |
pos | Given position. |
References _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMesh3D::res, _WlzIVertex3::vtX, _WlzIVertex3::vtY, and _WlzIVertex3::vtZ.
int WlzCMeshElmEnclosesPos2D | ( | WlzCMeshElm2D * | elm, |
WlzDVertex2 | gPos | ||
) |
Checks whether the vertex at the given position is within the given mesh element.
elm | Given mesh element. |
gPos | Given vertex position. |
References _WlzCMeshElm2D::edu, _WlzCMeshEdgU2D::nod, _WlzCMeshNod2D::pos, and WlzGeomVxInTriangle2D().
int WlzCMeshElmEnclosesPos2D5 | ( | WlzCMeshElm2D5 * | elm, |
WlzDVertex3 | gPos | ||
) |
Checks whether the vertex at the given position is within the given mesh element.
elm | Given mesh element. |
gPos | Given vertex position. |
References _WlzCMeshElm2D5::edu, _WlzCMeshEdgU2D5::nod, _WlzCMeshNod2D5::pos, WLZ_MESH_TOLERANCE, and WlzGeomVxInTriangle3D().
int WlzCMeshElmEnclosesPos3D | ( | WlzCMeshElm3D * | elm, |
WlzDVertex3 | gPos | ||
) |
Checks whether the vertex at the given position is within the given mesh element.
elm | Given mesh element. |
gPos | Given 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().
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.
gObj | Given conforming mesh object. |
applyDsp | Apply displacement if non-zero and the given object has valid displacements in it's indexed values. |
dstErr | Destination error pointer, may be NULL. |
References AlcVectorExtendAndGet(), AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzDomain::cm2d5, _WlzValues::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzCMeshNod2D::flags, _WlzCMeshNod2D::idx, _WlzCMeshElm2D::idx, _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzObject::type, _WlzCMesh2D::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::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(), WlzCMeshNew2D(), WlzCMeshReassignGridCells2D(), WlzCMeshSetElm2D(), WlzCMeshUpdateBBox2D(), WlzIndexedValueGet(), 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.
obj | Given domain object. |
minElmSz | Minimum element size. |
maxElmSz | Minimum element size. |
dstDilObj | Destination pointer for the dilated object used to build the mesh. |
conform | If non-zero make the mesh conform to the object's domain. outside the object if non-zero. |
dstErr | Destination 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.
obj | Given domain object. |
minElmSz | Minimum element size. |
maxElmSz | Minimum element size. |
dstDilObj | Destination pointer for the dilated object used to build the mesh, may be NULL. |
conform | If non-zero make boundary elements conform to the given domain by decomposing them. Any elements with all nodes outside the given domain are deleted. |
dstErr | Destination 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.
obj | Given domain object. |
minElmSz | Minimum element size. |
maxElmSz | Minimum element size. |
dstDilObj | Destination pointer for the dilated object used to build the mesh, may be NULL. |
conform | If non-zero make boundary elements conform to the given domain by decomposing them. Any elements with all nodes outside the given domain are deleted. |
dstErr | Destination 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().
WlzCMesh2D5* WlzCMeshFromGM | ( | WlzGMModel * | model, |
WlzErrorNum * | dstErr | ||
) |
Constructs a 2D5 mesh from a 3D geometric model.
model | The given model which must be 2D. |
dstErr | Destination error pointer may be NULL. |
References AlcVectorExtendAndGet(), AlcVectorItemGet(), _WlzGMVertexT::diskT, _WlzGMLoopT::edgeT, _WlzCMeshRes::elm, _WlzGMModelR::face, _WlzCMeshNod2D5::flags, _WlzGMVertex::idx, _WlzGMFace::idx, _WlzGMResIdx::idxLut, _WlzGMFace::loopT, _WlzGMEdgeT::next, _WlzCMeshRes::nod, _WlzGMResource::numElm, _WlzGMResource::numIdx, _WlzCMeshNod2D5::pos, _WlzGMEdgeT::prev, _WlzGMModel::res, _WlzCMesh2D5::res, _WlzGMModel::type, _WlzGMResource::vec, _WlzCMeshEntRes::vec, _WlzGMDiskT::vertex, _WlzGMModelR::vertex, _WlzGMResIdxTb::vertex, _WlzGMEdgeT::vertexT, WLZ_CMESH_NOD_FLAG_NONE, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_GMELMFLG_VERTEX, WLZ_GMMOD_3D, WLZ_GMMOD_3I, WLZ_GMMOD_3N, WlzCMeshAllocNod2D5(), WlzCMeshFree2D5(), WlzCMeshNew2D5(), WlzCMeshNewElm2D5(), WlzCMeshReassignGridCells2D5(), WlzCMeshUpdateBBox2D5(), WlzCMeshUpdateMaxSqEdgLen2D5(), WlzGMModelResIdx(), and WlzGMVertexGetG3D().
Referenced by WlzCMeshCompSurfMap().
WlzCMesh2D* WlzCMeshFromBalLBTDom2D | ( | WlzLBTDomain2D * | lDom, |
WlzObject * | iObj, | ||
WlzErrorNum * | dstErr | ||
) |
Constructs a 2D mesh from a balanced 2D linear binary tree domain.
lDom | Linear binary tree domain. |
iObj | Index object for lDom. |
dstErr | Destination 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(), 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.
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.
lDom | Linear binary tree domain. |
iObj | Index object for lDom. |
dstErr | Destination error pointer may be NULL. |
References _WlzCMesh3D::bBox, _WlzLBTDomain3D::kol1, _WlzLBTDomain3D::lastkl, _WlzLBTDomain3D::lastln, _WlzLBTDomain3D::lastpl, _WlzLBTDomain3D::line1, _WlzLBTDomain3D::nNodes, _WlzLBTDomain3D::plane1, _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WlzCMeshNew3D(), WlzCMeshReassignGridCells3D(), WlzGreyValueMakeWSp(), _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, 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.
\[ 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.
gObj | Given 2D5 conforming mesh object. |
nrmFlg | All normals will have unit length if this flag is non-zero. |
dstErr | Destination 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.
WlzErrorNum WlzCMeshElmFuse2D | ( | WlzCMesh2D * | mesh, |
WlzCMeshElm2D * | gElm | ||
) |
Fuses the given element in the mesh.
mesh | The mesh. |
gElm | Element to be removed by fusion. |
References _WlzCMeshElm2D::edu, _WlzCMeshElm2D::idx, _WlzCMeshEdgU2D::opp, _WlzCMesh2D::type, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, and WLZ_ERR_PARAM_NULL.
Referenced by WlzCMeshBoundConform2D().