Class ModelTriangleMeshCurvatures
- java.lang.Object
- 
- gov.nih.mipav.view.renderer.J3D.model.structures.ModelTriangleMeshCurvatures
 
- 
 public class ModelTriangleMeshCurvatures extends java.lang.ObjectStorage representation for a triangle mesh. Each vertex stores the coordinates and the normal vector. Each type of vertex value is stored in a separate array, however, the vertex values correspond based on index into the array. The connectivity of the vertices which form each triangle are stored in the array of indices.
- 
- 
Field SummaryFields Modifier and Type Field Description private float[]m_afMeanCurvaturesArray of mean curvature values at each vertex.private int[]m_aiIndicesArray of triangle vertex connectivity.private javax.vecmath.Point3f[]m_akCoordinatesArray of vertex coordinates.private javax.vecmath.Vector3f[]m_akNormalsArray of vertex normals.private javax.vecmath.Vector3f[]m_akTriangleNormalsArray of triangle normals.
 - 
Constructor SummaryConstructors Constructor Description ModelTriangleMeshCurvatures(ModelTriangleMesh kMesh)Create a set of the min/max curvatures computed for each vertex in the triangle mesh.ModelTriangleMeshCurvatures(javax.vecmath.Point3f[] akCoordinates, int[] aiIndices)Create a set of the min/max curvatures computed for each vertex in the triangle mesh.ModelTriangleMeshCurvatures(javax.vecmath.Point3f[] akCoordinates, javax.vecmath.Vector3f[] akNormals, int[] aiIndices)Create a set of the min/max curvatures computed for each vertex in the triangle mesh.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcomputeCurvatures()Compute the curvatures at each vertex.private voidcomputeTriangleNormals()Compute the normal vector for each triangle as the normal vector to the plane containing the vertices associated with the triangle and considering the vertices to be counterclockwise ordered for a RH rule oriented normal vector.private voidcomputeVertexNormals()Compute the normal vector for each vertex as the normalized average normal vector of all the triangles of which the vertex belongs.private voidgenerateOrthonormalBasis(javax.vecmath.Vector3f kU, javax.vecmath.Vector3f kV, javax.vecmath.Vector3f kW)Generate a set (any set) of orthonormal basis vectors.int[]getCoordinateIndices()Get the array of connectivity among the vertices which define the triangles of the mesh.javax.vecmath.Point3f[]getCoordinates()Get the array of coordinates at each vertex.float[]getMeanCurvatures()Get the array of mean curvature values at each vertex.intgetNumTriangles()Get the number of triangles used to defined the mesh.intgetNumVertices()Get the number of vertices used to define the mesh.javax.vecmath.Vector3f[]getTriangleNormals()Get the array of normal vectors for each triangle.javax.vecmath.Vector3f[]getVertexNormals()Get the array of normal vectors at each vertex.
 
- 
- 
- 
Field Detail- 
m_afMeanCurvaturesprivate float[] m_afMeanCurvatures Array of mean curvature values at each vertex.
 - 
m_aiIndicesprivate final int[] m_aiIndices Array of triangle vertex connectivity.
 - 
m_akCoordinatesprivate final javax.vecmath.Point3f[] m_akCoordinates Array of vertex coordinates.
 - 
m_akNormalsprivate final javax.vecmath.Vector3f[] m_akNormals Array of vertex normals.
 - 
m_akTriangleNormalsprivate final javax.vecmath.Vector3f[] m_akTriangleNormals Array of triangle normals.
 
- 
 - 
Constructor Detail- 
ModelTriangleMeshCurvaturespublic ModelTriangleMeshCurvatures(ModelTriangleMesh kMesh) Create a set of the min/max curvatures computed for each vertex in the triangle mesh. The triangle mesh is specified by the input ModelTrianglMesh instance.- Parameters:
- kMesh- ModelTriangleMesh Input triangle mesh which contains the vertex coordinates and vertex triangle connectivity information.
 
 - 
ModelTriangleMeshCurvaturespublic ModelTriangleMeshCurvatures(javax.vecmath.Point3f[] akCoordinates, int[] aiIndices)Create a set of the min/max curvatures computed for each vertex in the triangle mesh. The triangle mesh is specified by the coordinates of the vertices and the vertex array indices which define the triangle connectivity. From this information, the normal vectors of each triangle can be computed and from that the normal vectors at each vertex can be computed.- Parameters:
- akCoordinates- array of vertex coordinates
- aiIndices- array of vertex indices given triangle connectivity
 
 - 
ModelTriangleMeshCurvaturespublic ModelTriangleMeshCurvatures(javax.vecmath.Point3f[] akCoordinates, javax.vecmath.Vector3f[] akNormals, int[] aiIndices)Create a set of the min/max curvatures computed for each vertex in the triangle mesh. The triangle mesh is specified by the coordinates of the vertices, the normal vectors at each vertex, and the vertex array indices which define the triangle connectivity.- Parameters:
- akCoordinates- array of vertex coordinates
- akNormals- array of vertex normals; Must have at leat the same number of elements as does the akCoordinates array where each element in this normal array corresponds to the vertex coordinate array element at the same index.
- aiIndices- array of vertex indices given triangle connectivity
 
 
- 
 - 
Method Detail- 
getCoordinateIndicespublic int[] getCoordinateIndices() Get the array of connectivity among the vertices which define the triangles of the mesh. Each group of three values in the array contains an index into the vertex array for the vertcies which define a single triangle in the mesh.- Returns:
- int[] Array of vertex indices. Each index in the array should be a non-negative value less than the value returned by getNumVertices(). The dimension of this array should equal three times the value returned by getNumTriangles().
 
 - 
getCoordinatespublic javax.vecmath.Point3f[] getCoordinates() Get the array of coordinates at each vertex.- Returns:
- Point3f[] Array of 3D vertex coordinates. The dimension of this array should equal the value returned by getNumVertices().
 
 - 
getMeanCurvaturespublic float[] getMeanCurvatures() Get the array of mean curvature values at each vertex.- Returns:
- array of vertex mean curvature values where individual values may be signed; the dimension of this array should equal the value returned by getNumVertices().
 
 - 
getNumTrianglespublic int getNumTriangles() Get the number of triangles used to defined the mesh.- Returns:
- number of triangles
 
 - 
getNumVerticespublic int getNumVertices() Get the number of vertices used to define the mesh.- Returns:
- number of vertices
 
 - 
getTriangleNormalspublic javax.vecmath.Vector3f[] getTriangleNormals() Get the array of normal vectors for each triangle.- Returns:
- Vector3f[] Array of 3D normal vectors. The dimension of this array should equal the value returned by getNumTriangles().
 
 - 
getVertexNormalspublic javax.vecmath.Vector3f[] getVertexNormals() Get the array of normal vectors at each vertex.- Returns:
- Vector3f[] Array of 3D normal vectors. The dimension of this array should equal the value returned by getNumVertices().
 
 - 
computeCurvaturesprivate void computeCurvatures() Compute the curvatures at each vertex. Description of the algorithm is found in the embedded comments.
 - 
computeTriangleNormalsprivate void computeTriangleNormals() Compute the normal vector for each triangle as the normal vector to the plane containing the vertices associated with the triangle and considering the vertices to be counterclockwise ordered for a RH rule oriented normal vector. This sets the elements in the m_akTriangleNormals array.
 - 
computeVertexNormalsprivate void computeVertexNormals() Compute the normal vector for each vertex as the normalized average normal vector of all the triangles of which the vertex belongs. Do not call this method unless the m_akTriangleNormals array contains valid normalized normal vectors. This sets the elements in the m_akNormals array.
 - 
generateOrthonormalBasisprivate void generateOrthonormalBasis(javax.vecmath.Vector3f kU, javax.vecmath.Vector3f kV, javax.vecmath.Vector3f kW)Generate a set (any set) of orthonormal basis vectors.- Parameters:
- kU- output vector in orthonormal basis (perpendicular to kW)
- kV- output vector in orthonormal basis (equal to kW cross kU)
- kW- input non-zero vector
 
 
- 
 
-