|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jreality.geometry.AbstractGeometryFactory
de.jreality.geometry.QuadMeshFactory
public class QuadMeshFactory
This factory class supports creating and editing of quad meshes, that is, regular meshes of quadrilaterals. In contrast to the
IndexedFaceSetFactory
where the face indices must be explicitly set, this factory expects that the data provided to
the setVertexCoordinates(DataList)
method and its variants, is arranged in the special form corresponding to a quad mesh, and
does not allow the face indices to be explicitly set.
Instead of providing face indices, this factory has two methods setULineCount(int)
and setVLineCount(int)
to
describe the dimensions of the quad mesh. If you think of the data arranged in a 2D array, the rows have length u and there are v rows.
To support this picture further, there is another method provided for specifying the underlying point set: setVertexCoordinates(double[][][])
.
In this 3D array, the left-most index counts off the rows, the middle index runs through a given row, and the right most index runs through
the data for a specific vertex. There are analogous methods for setting the vertex normals, texture coordinates, colors, and relative radii.
There are also methods for specifying whether the quad mesh wraps around in the two parameter directions: setClosedInUDirection(boolean)
and
setClosedInVDirection(boolean)
. Defaults for both is false
. This is used for
example in the case that vertex normals are automatically generated, to identify correctly which faces are adjecent
to a given vertex. Note: in case the surface is closed in one or the other direction, the factory does not remove the duplicated vertices.
There are also some other new control methods:
setGenerateTextureCoordinates(boolean)
Generate texture coordinates mapping quad-mesh to unit square in (u,v) spacesetEdgeFromQuadMesh(boolean)
If true
, generate long edges, one for each row of the mesh. (See IndexedLineSet
).
The underlying geometry managed by this factory is an instance of IndexedFaceSet
-- there is no QuadMesh class. However,
the factory provides the instance with an Attribute
, GeometryUtility.QUAD_MESH_SHAPE
whose value is an instance of Dimension
specifying the (u,v) dimensions of the mesh -- in case a backend can optimize its handling of the geometry.
For an example, see this tutorial.
QuadMeshFactory
Constructor Summary | |
---|---|
QuadMeshFactory()
|
Method Summary | |
---|---|
int |
getEdgeCount()
|
IndexedFaceSet |
getIndexedFaceSet()
|
IndexedLineSet |
getIndexedLineSet()
|
int |
getLineCount()
Deprecated. Use setEdgeCount(int) . |
PointSet |
getPointSet()
|
IndexedFaceSet |
getQuadMesh()
|
int |
getULineCount()
|
double |
getUTextureScale()
|
double |
getUTextureShift()
|
int |
getVertexCount()
|
int |
getVLineCount()
|
double |
getVTextureScale()
|
double |
getVTextureShift()
|
boolean |
isClosedInUDirection()
|
boolean |
isClosedInVDirection()
|
boolean |
isEdgeFromQuadMesh()
|
boolean |
isGenerateAABBTree()
|
boolean |
isGenerateEdgeLabels()
|
boolean |
isGenerateEdgesFromFaces()
|
boolean |
isGenerateFaceLabels()
|
boolean |
isGenerateFaceNormals()
|
boolean |
isGenerateTextureCoordinates()
|
boolean |
isGenerateVertexLabels()
|
boolean |
isGenerateVertexNormals()
|
void |
setClosedInUDirection(boolean close)
|
void |
setClosedInVDirection(boolean close)
|
void |
setEdgeFromQuadMesh(boolean b)
|
void |
setFaceAttribute(Attribute attr,
DataList data)
Superclass methods are protected so we override to make public Documentation is lacking ... |
void |
setFaceAttribute(Attribute attr,
double[] data)
|
void |
setFaceAttribute(Attribute attr,
double[][] data)
|
void |
setFaceAttributes(DataListSet dls)
|
void |
setFaceColors(DataList data)
|
void |
setFaceColors(double[] data)
|
void |
setFaceColors(double[][] data)
|
void |
setFaceCount(int count)
|
void |
setFaceLabels(String[] data)
|
void |
setFaceNormals(DataList data)
|
void |
setFaceNormals(double[] data)
|
void |
setFaceNormals(double[][] data)
|
void |
setGenerateAABBTree(boolean generate)
|
void |
setGenerateEdgeLabels(boolean generateEdgeLabels)
|
void |
setGenerateEdgesFromFaces(boolean generateEdgesFromFaces)
|
void |
setGenerateFaceLabels(boolean generateFaceLabels)
|
void |
setGenerateFaceNormals(boolean generateFaceNormals)
|
void |
setGenerateTextureCoordinates(boolean generateTextureCoordinates)
|
void |
setGenerateVertexLabels(boolean generateVertexLabels)
|
void |
setGenerateVertexNormals(boolean generateVertexNormals)
|
void |
setLineCount(int count)
Deprecated. Use setEdgeCount(int) . |
void |
setULineCount(int newU)
|
void |
setUTextureScale(double textureScale)
|
void |
setUTextureShift(double textureShift)
|
void |
setVertexAttribute(Attribute attr,
DataList data)
|
void |
setVertexAttribute(Attribute attr,
double[] data)
|
void |
setVertexAttribute(Attribute attr,
double[][] data)
|
void |
setVertexAttributes(DataListSet dls)
|
void |
setVertexColors(Color[] data)
|
void |
setVertexColors(DataList data)
|
void |
setVertexColors(double[] data)
|
void |
setVertexColors(double[][] data)
|
void |
setVertexColors(double[][][] cs)
|
void |
setVertexCoordinates(DataList data)
|
void |
setVertexCoordinates(double[] data)
|
void |
setVertexCoordinates(double[][] data)
|
void |
setVertexCoordinates(double[][][] points)
A convenience method to allow users to work with a rectangular 3D array to describe a quad mesh |
void |
setVertexCount(int count)
|
void |
setVertexLabels(String[] data)
|
void |
setVertexNormals(DataList data)
|
void |
setVertexNormals(double[] data)
|
void |
setVertexNormals(double[][] data)
|
void |
setVertexNormals(double[][][] data)
|
void |
setVertexTextureCoordinates(DataList data)
|
void |
setVertexTextureCoordinates(double[] data)
|
void |
setVertexTextureCoordinates(double[][] data)
|
void |
setVertexTextureCoordinates(double[][][] data)
|
void |
setVLineCount(int newV)
|
void |
setVTextureScale(double textureScale)
|
void |
setVTextureShift(double textureShift)
|
Methods inherited from class de.jreality.geometry.AbstractGeometryFactory |
---|
getGeometry, getMetric, setMetric, update |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QuadMeshFactory()
Method Detail |
---|
public IndexedFaceSet getQuadMesh()
public void setVertexAttribute(Attribute attr, DataList data)
public void setVertexAttribute(Attribute attr, double[] data)
public void setVertexAttribute(Attribute attr, double[][] data)
public void setVertexAttributes(DataListSet dls)
public void setVertexCoordinates(DataList data)
public void setVertexCoordinates(double[] data)
public void setVertexCoordinates(double[][] data)
public void setVertexCoordinates(double[][][] points)
points
- a 3-dimension, rectangular array; the first to dimension must equal
the number of v-lines (@link getVLineCount) and u-lines (@link getULineCount).public void setVertexColors(double[][][] cs)
public void setVertexColors(Color[] data)
public void setVertexNormals(DataList data)
public void setVertexNormals(double[] data)
public void setVertexNormals(double[][] data)
public void setVertexNormals(double[][][] data)
public void setVertexColors(DataList data)
public void setVertexColors(double[] data)
public void setVertexColors(double[][] data)
public void setVertexTextureCoordinates(DataList data)
public void setVertexTextureCoordinates(double[] data)
public void setVertexTextureCoordinates(double[][] data)
public void setVertexTextureCoordinates(double[][][] data)
public void setVertexLabels(String[] data)
public void setFaceAttribute(Attribute attr, DataList data)
public void setFaceAttribute(Attribute attr, double[] data)
public void setFaceAttribute(Attribute attr, double[][] data)
public void setFaceAttributes(DataListSet dls)
public void setFaceNormals(DataList data)
public void setFaceNormals(double[] data)
public void setFaceNormals(double[][] data)
public void setFaceColors(DataList data)
public void setFaceColors(double[] data)
public void setFaceColors(double[][] data)
public void setFaceLabels(String[] data)
public void setVertexCount(int count)
public void setFaceCount(int count)
public int getULineCount()
public int getVLineCount()
public void setULineCount(int newU)
public void setVLineCount(int newV)
public boolean isClosedInUDirection()
public boolean isClosedInVDirection()
public void setClosedInUDirection(boolean close)
public void setClosedInVDirection(boolean close)
public boolean isGenerateTextureCoordinates()
public void setGenerateTextureCoordinates(boolean generateTextureCoordinates)
public double getUTextureScale()
public void setUTextureScale(double textureScale)
public double getVTextureScale()
public void setVTextureScale(double textureScale)
public double getUTextureShift()
public void setUTextureShift(double textureShift)
public double getVTextureShift()
public void setVTextureShift(double textureShift)
public boolean isEdgeFromQuadMesh()
public void setEdgeFromQuadMesh(boolean b)
public IndexedFaceSet getIndexedFaceSet()
public boolean isGenerateEdgesFromFaces()
public void setGenerateEdgesFromFaces(boolean generateEdgesFromFaces)
public boolean isGenerateVertexNormals()
public void setGenerateVertexNormals(boolean generateVertexNormals)
public boolean isGenerateFaceNormals()
public void setGenerateFaceNormals(boolean generateFaceNormals)
public boolean isGenerateFaceLabels()
public void setGenerateFaceLabels(boolean generateFaceLabels)
public boolean isGenerateAABBTree()
public void setGenerateAABBTree(boolean generate)
public int getEdgeCount()
public int getLineCount()
setEdgeCount(int)
.
public void setLineCount(int count)
setEdgeCount(int)
.
public IndexedLineSet getIndexedLineSet()
public boolean isGenerateEdgeLabels()
public void setGenerateEdgeLabels(boolean generateEdgeLabels)
public int getVertexCount()
public PointSet getPointSet()
public boolean isGenerateVertexLabels()
public void setGenerateVertexLabels(boolean generateVertexLabels)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |