|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jreality.geometry.IndexedFaceSetUtility
public class IndexedFaceSetUtility
Static methods for editing and processing instances of IndexedFaceSet
.
Method Summary | |
---|---|
static SceneGraphComponent |
_mergeIndexedFaceSets(SceneGraphComponent sgc)
Deprecated. use GeometryMergeFactory |
static void |
assignSmoothVertexNormals(IndexedFaceSet ifs,
double maxAngle,
int digits)
Averages the vertex normals for duplicate coordinates. |
static void |
assignSmoothVertexNormals(IndexedFaceSet ifs,
int digits)
Averages the vertex normals for duplicate coordinates. |
static void |
assignVertexTangents(IndexedFaceSet ifs)
|
static IndexedFaceSet |
binaryRefine(IndexedFaceSet ifs)
Only applicable for ifs all of whose faces are triangles; then each triangle is broken into four smaller triangles by bisecting the edges. |
static void |
calculateAndSetEdgesFromFaces(IndexedFaceSet ifs)
|
static void |
calculateAndSetFaceNormals(IndexedFaceSet ifs)
|
static void |
calculateAndSetNormals(IndexedFaceSet ifs)
|
static void |
calculateAndSetVertexNormals(IndexedFaceSet ifs)
|
static double[][] |
calculateFaceNormals(IndexedFaceSet ifs)
|
static double[][] |
calculateFaceNormals(IndexedFaceSet ifs,
int metric)
|
static double[][] |
calculateFaceNormals(int[][] indices,
double[][] verts,
int metric)
Calculate face normals for the faces defined by the index list indices and the vertex list verts, with respect to the given metric. |
static void |
calculateFaceNormals(SceneGraphComponent c)
Traverse a scene graph, calculating (and setting) face normals for all instances of IndexedFaceSet . |
static double[][] |
calculateVertexNormals(IndexedFaceSet ifs)
|
static double[][] |
calculateVertexNormals(IndexedFaceSet ifs,
int metric)
|
static double[][] |
calculateVertexNormals(int[][] indices,
double[][] vertsAs2D,
double[][] fn,
int metric)
Calculate the vertex normals of the vertices by averaging the face normals of all faces to which the vertex belongs. |
static void |
calculateVertexNormals(SceneGraphComponent c)
Traverse a scene graph, calculating (and setting) vertex normals for all instances of IndexedFaceSet . |
static double[][] |
calculateVertexTangents(DoubleArrayArray texCoords,
DoubleArrayArray vertexCoordinates,
DoubleArrayArray vertexNormals,
IntArrayArray faceIndices)
calculates face tangents, converted from http://www.terathon.com/code/tangent.php |
static IndexedFaceSet |
constructPolygon(double[][] points)
A simple constructor for an IndexedFaceSet with a single face. |
static IndexedFaceSet |
constructPolygon(IndexedFaceSet ifs,
double[][] points)
A simple constructor for an IndexedFaceSet with a single face. |
static IndexedFaceSet |
constructPolygon(IndexedFaceSet ifs,
double[][] points,
int sig)
|
static IntArrayArray |
edgesFromFaces(int[][] faces)
|
static IntArrayArray |
edgesFromFaces(IntArrayArray faces)
TODO optimize in case its a QuadMesh (u+v curves instead of u*v segments) |
static double[][] |
extractEdge(double[][] curve,
IndexedFaceSet ifs,
int which)
Deprecated. Use IndexedLineSetUtility.extractCurve(double[][], IndexedLineSet, int) . |
static IndexedFaceSet |
extractFace(IndexedFaceSet ifs,
int which)
|
static int |
getTotalNumFaces(IndexedFaceSet[] ifs)
Returns the total nubmer of faces in array of indexed face sets. |
static int |
getTotalNumLines(IndexedLineSet[] ils)
Returns the total nubmer of lines in array of indexed line sets. |
static int |
getTotalNumPoints(PointSet[] ps)
Returns the total number of points in array of point sets. |
static IndexedFaceSet |
implode(IndexedFaceSet ifs,
double factor)
For each face of ifs, replace it with a face gotten by: if factor > 0: a shrunken version of the face (factor == 1 gives original face), or if factor < 0: a hole is cut out of the face, corresponding to the shrunken version with the same absolute value. |
static boolean |
makeConsistentOrientation(IndexedFaceSet ifs)
makes a consistent orientated version of the "face Indices" if possible. |
static double[][] |
mergeDoubleArrayArrayEdgeAttribute(IndexedLineSet[] ils,
Attribute attr)
Deprecated. use GeometryMergeFactory |
static double[][] |
mergeDoubleArrayArrayFaceAttribute(IndexedFaceSet[] ifs,
Attribute attr)
Deprecated. use GeometryMergeFactory |
static double[][] |
mergeDoubleArrayArrayVertexAttribute(PointSet[] ps,
Attribute attr)
Deprecated. use GeometryMergeFactory |
static IndexedFaceSet |
mergeIndexedFaceSets(IndexedFaceSet[] ifs)
Deprecated. use GeometryMergeFactory |
static SceneGraphComponent |
mergeIndexedFaceSets(SceneGraphComponent sgc)
Deprecated. use GeometryMergeFactory |
static IndexedLineSet |
mergeIndexedLineSets(IndexedLineSet[] ils)
Deprecated. use GeometryMergeFactory |
static SceneGraphComponent |
mergeIndexedLineSets(SceneGraphComponent sgc)
Deprecated. use GeometryMergeFactory |
static int[][] |
mergeIntArrayArrayEdgeAttribute(IndexedLineSet[] ils,
Attribute attr)
Deprecated. use GeometryMergeFactory |
static int[][] |
mergeIntArrayArrayFaceAttribute(IndexedFaceSet[] ifs,
Attribute attr)
Deprecated. use GeometryMergeFactory |
static IndexedFaceSet |
removeTextureCoordinateJumps(IndexedFaceSet src,
double jumpSize)
A special purpose code for the Buddy-Baer project which might be useful for other situations where texture coordinates wrap around. |
static IndexedFaceSet |
representAsSceneGraph(IndexedFaceSet exists,
Rectangle3D box)
Update the vertices of an existing IFS to match the state of box. |
static IndexedFaceSet |
representAsSceneGraph(Rectangle3D box)
Represent an instance of Rectangle3D as an instance of IndexedFaceSet . |
static void |
simpleTriangulate(IndexedFaceSet ifs)
Do a simple (dumb) triangulation of the indexed face set Edit the input IFS; if you want a copy, make it before calling this method. |
static IndexedFaceSet[] |
splitIfsToPrimitiveFaces(IndexedFaceSet ifs)
|
static IndexedFaceSet |
triangulate(IndexedFaceSet fs)
This mehtod assumes that the faces in the given IndexedFaceSet are planar embedded polygons. |
static void |
triangulateBarycentric(IndexedFaceSet ifs)
|
static IndexedFaceSet |
triangulateRectangularPatch(double[][][] levels)
Generates a triangulated sphere from a given set of equally spaced longitude (theta) circles. |
static IndexedFaceSet |
truncate(IndexedFaceSet ifs)
Truncate the corners of each face of ifs. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static IndexedFaceSet binaryRefine(IndexedFaceSet ifs)
ifs
-
public static void calculateAndSetEdgesFromFaces(IndexedFaceSet ifs)
public static IndexedFaceSet constructPolygon(double[][] points)
points
-
public static IndexedFaceSet constructPolygon(IndexedFaceSet ifs, double[][] points)
ifs
- points
-
public static IndexedFaceSet constructPolygon(IndexedFaceSet ifs, double[][] points, int sig)
public static IntArrayArray edgesFromFaces(int[][] faces)
public static IntArrayArray edgesFromFaces(IntArrayArray faces)
faces
-
public static double[][] extractEdge(double[][] curve, IndexedFaceSet ifs, int which)
IndexedLineSetUtility.extractCurve(double[][], IndexedLineSet, int)
.
GeometryUtility.QUAD_MESH_SHAPE
), then this will
correspond to a u- or v- parameter curve.
curve
- ifs
- which
-
public static IndexedFaceSet extractFace(IndexedFaceSet ifs, int which)
public static int getTotalNumFaces(IndexedFaceSet[] ifs)
ifs
- array of indexed faces sets
public static int getTotalNumLines(IndexedLineSet[] ils)
ifs
- array of indexed line sets
public static int getTotalNumPoints(PointSet[] ps)
ps
- array of point sets
public static IndexedFaceSet implode(IndexedFaceSet ifs, double factor)
ifs
- factor
-
public static double[][] mergeDoubleArrayArrayFaceAttribute(IndexedFaceSet[] ifs, Attribute attr)
GeometryMergeFactory
public static double[][] mergeDoubleArrayArrayEdgeAttribute(IndexedLineSet[] ils, Attribute attr)
GeometryMergeFactory
public static double[][] mergeDoubleArrayArrayVertexAttribute(PointSet[] ps, Attribute attr)
GeometryMergeFactory
public static IndexedFaceSet mergeIndexedFaceSets(IndexedFaceSet[] ifs)
GeometryMergeFactory
public static IndexedLineSet mergeIndexedLineSets(IndexedLineSet[] ils)
GeometryMergeFactory
public static SceneGraphComponent mergeIndexedFaceSets(SceneGraphComponent sgc)
GeometryMergeFactory
public static SceneGraphComponent _mergeIndexedFaceSets(SceneGraphComponent sgc)
GeometryMergeFactory
public static SceneGraphComponent mergeIndexedLineSets(SceneGraphComponent sgc)
GeometryMergeFactory
public static int[][] mergeIntArrayArrayFaceAttribute(IndexedFaceSet[] ifs, Attribute attr)
GeometryMergeFactory
public static int[][] mergeIntArrayArrayEdgeAttribute(IndexedLineSet[] ils, Attribute attr)
GeometryMergeFactory
public static IndexedFaceSet removeTextureCoordinateJumps(IndexedFaceSet src, double jumpSize)
src
- jumpSize
-
public static IndexedFaceSet representAsSceneGraph(IndexedFaceSet exists, Rectangle3D box)
exists
- box
-
public static IndexedFaceSet representAsSceneGraph(Rectangle3D box)
Rectangle3D
as an instance of IndexedFaceSet
.
box
-
public static IndexedFaceSet[] splitIfsToPrimitiveFaces(IndexedFaceSet ifs)
ifs
-
public static IndexedFaceSet triangulate(IndexedFaceSet fs)
fs
-
public static void simpleTriangulate(IndexedFaceSet ifs)
ifs
- public static IndexedFaceSet truncate(IndexedFaceSet ifs)
ifs
-
public static void assignVertexTangents(IndexedFaceSet ifs)
public static double[][] calculateVertexTangents(DoubleArrayArray texCoords, DoubleArrayArray vertexCoordinates, DoubleArrayArray vertexNormals, IntArrayArray faceIndices)
texCoords
- vertexCoordinates
- vertexNormals
- faceIndices
-
public static void assignSmoothVertexNormals(IndexedFaceSet ifs, double maxAngle, int digits)
ifs
- the IndexedFaceSet to changemaxAngle
- the maximum angle in degrees between two normals for being flippeddigits
- the number of digits to respect for comparing coordinatespublic static void assignSmoothVertexNormals(IndexedFaceSet ifs, int digits)
ifs
- digits
- public static void triangulateBarycentric(IndexedFaceSet ifs)
public static IndexedFaceSet triangulateRectangularPatch(double[][][] levels)
public static boolean makeConsistentOrientation(IndexedFaceSet ifs)
numVertices
- faces
-
Exception
public static void calculateAndSetFaceNormals(IndexedFaceSet ifs)
public static void calculateAndSetNormals(IndexedFaceSet ifs)
public static void calculateAndSetVertexNormals(IndexedFaceSet ifs)
public static double[][] calculateFaceNormals(IndexedFaceSet ifs)
public static double[][] calculateFaceNormals(IndexedFaceSet ifs, int metric)
public static double[][] calculateFaceNormals(int[][] indices, double[][] verts, int metric)
indices
- verts
- metric
-
public static void calculateFaceNormals(SceneGraphComponent c)
IndexedFaceSet
. If face normals are already
present, they are not calculated again. The setting has to take place
after the traversal due to locking considerations.
c
- public static double[][] calculateVertexNormals(IndexedFaceSet ifs)
public static double[][] calculateVertexNormals(IndexedFaceSet ifs, int metric)
public static double[][] calculateVertexNormals(int[][] indices, double[][] vertsAs2D, double[][] fn, int metric)
Note: This method currently does not
correctly average vertices lying on the boundary of a closed quad mesh
.
indices
- vertsAs2D
- fn
- metric
-
public static void calculateVertexNormals(SceneGraphComponent c)
IndexedFaceSet
. If vertex normals are already
present, they are not calculated again. The setting has to take place
after the traversal due to locking considerations.
c
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |