public class PointSetFactory extends AbstractPointSetFactory
PointSet
for details of the
underlying point set.
There are different formats which can be used to set this data, and corresponding methods for setting
this data. You must first set the number of vertices using setVertexCount(int)
. Then
vertex attributes can be set. For example to set the attribute Attribute.COORDINATES
:
In the case the argument is double[]
then the length must be length 3 or 4 times the number of vertices.
(Point sets can have either ordinary or homogeneouse coordinates). This vector length (3 or 4) is sometimes called the
fiber length of the data.
There are analogous methods for setting the built-in attributes normals, colors, texture coordinates, relative radii, and labels.
Texture coordinates can have fiber length 2, 3, or 4. Normals in euclidean case must have fiber length 3; otherwise they should have
length 4. Labels are represented by an array of type String[]
.
For attributes not included in the built-in set, use the methods
setVertexAttribute(Attribute, DataList)
setVertexAttribute(Attribute, double[])
setVertexAttribute(Attribute, double[][])
Each instance of a factory always acts on the same instance of PointSet
. To get this instance use the
method getPointSet()
. To edit the instance, call the various set methods, then call AbstractGeometryFactory.update()
.
You don't need to call getPointSet()
again, as it always returns the same value.
You can also request the factory to automatically generate vertex labels (which are strings displayed
as 3D text at the position of the vertices) using the method AbstractPointSetFactory.setGenerateVertexLabels(boolean)
. This
will generate labels showing the index of the point within the point array.
The abstract superclass AbstractPointSetFactory
is not visible publicly.
It provides protected methods to subclasses. Subclasses such as this one
can then decide which of these methods to reveal by implementing them as public
methods.
To specify that the geometry should be handled according to non-euclidean metric, use the method AbstractGeometryFactory.setMetric(int)
.
This has little significance for the point sets, but becomes more important for subclasses such as IndexedFaceSetFactory
.
This class writes itself For an example, see this tutorial.
See DataList
.
Constructor and Description |
---|
PointSetFactory() |
Modifier and Type | Method and Description |
---|---|
PointSet |
getPointSet() |
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 |
setVertexCoordinates(DataList data) |
void |
setVertexCoordinates(double[] data) |
void |
setVertexCoordinates(double[][] data) |
void |
setVertexCount(int count) |
void |
setVertexLabels(String[] data) |
void |
setVertexNormals(DataList data) |
void |
setVertexNormals(double[] data) |
void |
setVertexNormals(double[][] data) |
void |
setVertexRelativeRadii(double[] data) |
void |
setVertexTextureCoordinates(DataList data) |
void |
setVertexTextureCoordinates(double[] data) |
void |
setVertexTextureCoordinates(double[][] data) |
getVertexCount, isGenerateVertexLabels, setGenerateVertexLabels
getGeometry, getMetric, setMetric, update
public void setVertexCount(int count)
setVertexCount
in class AbstractPointSetFactory
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 setVertexNormals(DataList data)
public void setVertexNormals(double[] data)
public void setVertexNormals(double[][] data)
public void setVertexColors(DataList data)
public void setVertexColors(double[] data)
public void setVertexColors(Color[] data)
public void setVertexColors(double[][] data)
public void setVertexTextureCoordinates(DataList data)
public void setVertexTextureCoordinates(double[] data)
public void setVertexTextureCoordinates(double[][] data)
public void setVertexLabels(String[] data)
public void setVertexRelativeRadii(double[] data)
public PointSet getPointSet()
getPointSet
in class AbstractPointSetFactory