public class QuadMeshFactory extends AbstractQuadMeshFactory
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 AbstractQuadMeshFactory.setULineCount(int)
and AbstractQuadMeshFactory.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: AbstractQuadMeshFactory.setClosedInUDirection(boolean)
and
AbstractQuadMeshFactory.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:
AbstractQuadMeshFactory.setGenerateTextureCoordinates(boolean)
Generate texture coordinates mapping quad-mesh to unit square in (u,v) spaceAbstractQuadMeshFactory.setEdgeFromQuadMesh(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 and Description |
---|
QuadMeshFactory() |
Modifier and Type | Method and Description |
---|---|
IndexedFaceSet |
getQuadMesh() |
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 |
setFaceLabels(String[] data) |
void |
setFaceNormals(DataList data) |
void |
setFaceNormals(double[] data) |
void |
setFaceNormals(double[][] data) |
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 |
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) |
getULineCount, getUTextureScale, getUTextureShift, getVLineCount, getVTextureScale, getVTextureShift, isClosedInUDirection, isClosedInVDirection, isEdgeFromQuadMesh, isGenerateTextureCoordinates, setClosedInUDirection, setClosedInVDirection, setEdgeFromQuadMesh, setFaceCount, setGenerateTextureCoordinates, setULineCount, setUTextureScale, setUTextureShift, setVertexCount, setVLineCount, setVTextureScale, setVTextureShift
getIndexedFaceSet, isGenerateAABBTree, isGenerateEdgesFromFaces, isGenerateFaceLabels, isGenerateFaceNormals, isGenerateVertexNormals, setGenerateAABBTree, setGenerateEdgesFromFaces, setGenerateFaceLabels, setGenerateFaceNormals, setGenerateVertexNormals
getEdgeCount, getIndexedLineSet, getLineCount, isGenerateEdgeLabels, setGenerateEdgeLabels, setLineCount
getPointSet, getVertexCount, isGenerateVertexLabels, setGenerateVertexLabels
getGeometry, getMetric, setMetric, update
public IndexedFaceSet getQuadMesh()
public void setVertexAttribute(Attribute attr, double[] data)
public void setVertexAttribute(Attribute attr, double[][] data)
setVertexAttribute
in class AbstractPointSetFactory
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 two dimensions 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)
setFaceAttribute
in class AbstractQuadMeshFactory
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)