de.jreality.geometry
Class GeometryUtility

java.lang.Object
  extended by de.jreality.geometry.GeometryUtility

public class GeometryUtility
extends Object

Static methods for various geometric operations.

There are a few basic categories:

Author:
Charles Gunn and others

Field Summary
static String BOUNDING_BOX
          For setting the bounding box of the geometry; Value: Rectangle3D.
static String FACTORY
           
static String HEIGHT_FIELD_SHAPE
          For identifying this IndexedFaceSet as a QuadMesh with a single value at each point (z-value on a regular x-y 2D domain); Value: Rectangle2D identifies the 2D domain.
static String METRIC
          For setting the metric (Pn) of the geometry; Value: Integer
static String QUAD_MESH_SHAPE
          For identifying this IndexedFaceSet as a QuadMesh; Value: Dimension.
 
Method Summary
static void calculateAndSetFaceNormals(IndexedFaceSet ifs)
          Deprecated. Use IndexedFaceSetUtility.calculateAndSetFaceNormals(IndexedFaceSet) instead
static void calculateAndSetNormals(IndexedFaceSet ifs)
          Deprecated. Use IndexedFaceSetUtility.calculateAndSetNormals(IndexedFaceSet) instead
static void calculateAndSetVertexNormals(IndexedFaceSet ifs)
          Deprecated. Use IndexedFaceSetUtility.calculateAndSetVertexNormals(IndexedFaceSet) instead
static Rectangle3D calculateBoundingBox(double[][] verts)
          Deprecated. Use BoundingBoxUtility.calculateBoundingBox(double[][]) instead
static Rectangle3D calculateBoundingBox(double[] initialMatrix, SceneGraphComponent sgc)
          Deprecated. Use BoundingBoxUtility.calculateBoundingBox(double[],SceneGraphComponent) instead
static Rectangle3D calculateBoundingBox(PointSet ps)
          Deprecated. Use BoundingBoxUtility.calculateBoundingBox(PointSet) instead
static Rectangle3D calculateBoundingBox(SceneGraphComponent sgc)
          Deprecated. Use BoundingBoxUtility.calculateBoundingBox(SceneGraphComponent) instead
static Rectangle3D calculateBoundingBox(Sphere sph)
          Deprecated. Use BoundingBoxUtility.calculateBoundingBox(Sphere) instead
static Rectangle3D calculateChildrenBoundingBox(SceneGraphComponent sgc)
          Deprecated. Use BoundingBoxUtility.calculateChildrenBoundingBox(SceneGraphComponent) instead
static double[][] calculateFaceNormals(IndexedFaceSet ifs)
          Deprecated. Use IndexedFaceSetUtility.calculateFaceNormals(IndexedFaceSet) instead
static double[][] calculateFaceNormals(IndexedFaceSet ifs, int metric)
          Deprecated. Use IndexedFaceSetUtility.calculateFaceNormals(IndexedFaceSet,int) instead
static double[][] calculateFaceNormals(int[][] indices, double[][] verts, int metric)
          Deprecated. Use IndexedFaceSetUtility.calculateFaceNormals(int[][],double[][],int) instead
static void calculateFaceNormals(SceneGraphComponent c)
          Deprecated. Use IndexedFaceSetUtility.calculateFaceNormals(SceneGraphComponent) instead
static double[][] calculateVertexNormals(IndexedFaceSet ifs)
          Deprecated. Use IndexedFaceSetUtility.calculateVertexNormals(IndexedFaceSet) instead
static double[][] calculateVertexNormals(IndexedFaceSet ifs, int metric)
          Deprecated. Use IndexedFaceSetUtility.calculateVertexNormals(IndexedFaceSet,int) instead
static double[][] calculateVertexNormals(int[][] indices, double[][] vertsAs2D, double[][] fn, int metric)
          Deprecated. Use IndexedFaceSetUtility.calculateVertexNormals(int[][],double[][],double[][],int) instead
static void calculateVertexNormals(SceneGraphComponent c)
          Deprecated. Use IndexedFaceSetUtility.calculateVertexNormals(SceneGraphComponent) instead
static SceneGraphComponent flatten(SceneGraphComponent sgc)
          Deprecated. Use SceneGraphUtility.flatten(SceneGraphComponent) instead
static SceneGraphComponent flatten(SceneGraphComponent sgc, boolean rejectInvis)
          Deprecated. Use SceneGraphUtility.flatten(SceneGraphComponent,boolean) instead
static AbstractGeometryFactory getFactory(Geometry g)
           
static int getMetric(Geometry g)
           
static int getVectorLength(DataList ps)
          Find out the length of the first element of this DataList.
static int getVectorLength(PointSet ps)
          Find out the length of the coordinates for a single vertex of this PointSet.
static void setFactory(Geometry g, AbstractGeometryFactory fac)
          Set the geometry attribute FACTORY to the given factory, which may be null.
static void setMetric(Geometry g, int s)
          Set the metric (Pn) associated to this geometry.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOUNDING_BOX

public static String BOUNDING_BOX
For setting the bounding box of the geometry; Value: Rectangle3D.

See Also:
Geometry#setGeometryAttributes(Attribute, Object).

QUAD_MESH_SHAPE

public static String QUAD_MESH_SHAPE
For identifying this IndexedFaceSet as a QuadMesh; Value: Dimension.

See Also:
Geometry#setGeometryAttributes(Attribute, Object)., QuadMeshFactory

HEIGHT_FIELD_SHAPE

public static String HEIGHT_FIELD_SHAPE
For identifying this IndexedFaceSet as a QuadMesh with a single value at each point (z-value on a regular x-y 2D domain); Value: Rectangle2D identifies the 2D domain.

See Also:
Geometry#setGeometryAttributes(Attribute, Object)., HeightFieldFactory

METRIC

public static String METRIC
For setting the metric (Pn) of the geometry; Value: Integer

See Also:
Geometry#setGeometryAttributes(Attribute, Object).

FACTORY

public static String FACTORY
Method Detail

getMetric

public static int getMetric(Geometry g)

getFactory

public static AbstractGeometryFactory getFactory(Geometry g)

setFactory

public static void setFactory(Geometry g,
                              AbstractGeometryFactory fac)
Set the geometry attribute FACTORY to the given factory, which may be null.

Parameters:
g -
fac -

setMetric

public static void setMetric(Geometry g,
                             int s)
Set the metric (Pn) associated to this geometry.

Parameters:
g -
s -

getVectorLength

public static int getVectorLength(DataList ps)
Find out the length of the first element of this DataList.

Parameters:
ps -
Returns:

getVectorLength

public static int getVectorLength(PointSet ps)
Find out the length of the coordinates for a single vertex of this PointSet.

Parameters:
ps -
Returns:

calculateBoundingBox

public static Rectangle3D calculateBoundingBox(double[] initialMatrix,
                                               SceneGraphComponent sgc)
Deprecated. Use BoundingBoxUtility.calculateBoundingBox(double[],SceneGraphComponent) instead


calculateBoundingBox

public static Rectangle3D calculateBoundingBox(double[][] verts)
Deprecated. Use BoundingBoxUtility.calculateBoundingBox(double[][]) instead


calculateBoundingBox

public static Rectangle3D calculateBoundingBox(PointSet ps)
Deprecated. Use BoundingBoxUtility.calculateBoundingBox(PointSet) instead


calculateBoundingBox

public static Rectangle3D calculateBoundingBox(SceneGraphComponent sgc)
Deprecated. Use BoundingBoxUtility.calculateBoundingBox(SceneGraphComponent) instead


calculateBoundingBox

public static Rectangle3D calculateBoundingBox(Sphere sph)
Deprecated. Use BoundingBoxUtility.calculateBoundingBox(Sphere) instead


calculateChildrenBoundingBox

public static Rectangle3D calculateChildrenBoundingBox(SceneGraphComponent sgc)
Deprecated. Use BoundingBoxUtility.calculateChildrenBoundingBox(SceneGraphComponent) instead


calculateAndSetFaceNormals

public static void calculateAndSetFaceNormals(IndexedFaceSet ifs)
Deprecated. Use IndexedFaceSetUtility.calculateAndSetFaceNormals(IndexedFaceSet) instead


calculateAndSetNormals

public static void calculateAndSetNormals(IndexedFaceSet ifs)
Deprecated. Use IndexedFaceSetUtility.calculateAndSetNormals(IndexedFaceSet) instead


calculateAndSetVertexNormals

public static void calculateAndSetVertexNormals(IndexedFaceSet ifs)
Deprecated. Use IndexedFaceSetUtility.calculateAndSetVertexNormals(IndexedFaceSet) instead


calculateFaceNormals

public static double[][] calculateFaceNormals(IndexedFaceSet ifs)
Deprecated. Use IndexedFaceSetUtility.calculateFaceNormals(IndexedFaceSet) instead


calculateFaceNormals

public static double[][] calculateFaceNormals(IndexedFaceSet ifs,
                                              int metric)
Deprecated. Use IndexedFaceSetUtility.calculateFaceNormals(IndexedFaceSet,int) instead


calculateFaceNormals

public static double[][] calculateFaceNormals(int[][] indices,
                                              double[][] verts,
                                              int metric)
Deprecated. Use IndexedFaceSetUtility.calculateFaceNormals(int[][],double[][],int) instead


calculateFaceNormals

public static void calculateFaceNormals(SceneGraphComponent c)
Deprecated. Use IndexedFaceSetUtility.calculateFaceNormals(SceneGraphComponent) instead


calculateVertexNormals

public static double[][] calculateVertexNormals(IndexedFaceSet ifs)
Deprecated. Use IndexedFaceSetUtility.calculateVertexNormals(IndexedFaceSet) instead


calculateVertexNormals

public static double[][] calculateVertexNormals(IndexedFaceSet ifs,
                                                int metric)
Deprecated. Use IndexedFaceSetUtility.calculateVertexNormals(IndexedFaceSet,int) instead


calculateVertexNormals

public static double[][] calculateVertexNormals(int[][] indices,
                                                double[][] vertsAs2D,
                                                double[][] fn,
                                                int metric)
Deprecated. Use IndexedFaceSetUtility.calculateVertexNormals(int[][],double[][],double[][],int) instead


calculateVertexNormals

public static void calculateVertexNormals(SceneGraphComponent c)
Deprecated. Use IndexedFaceSetUtility.calculateVertexNormals(SceneGraphComponent) instead


flatten

public static SceneGraphComponent flatten(SceneGraphComponent sgc)
Deprecated. Use SceneGraphUtility.flatten(SceneGraphComponent) instead


flatten

public static SceneGraphComponent flatten(SceneGraphComponent sgc,
                                          boolean rejectInvis)
Deprecated. Use SceneGraphUtility.flatten(SceneGraphComponent,boolean) instead