de.jreality.geometry
Class IndexedLineSetFactory
java.lang.Object
de.jreality.geometry.AbstractGeometryFactory
de.jreality.geometry.AbstractPointSetFactory
de.jreality.geometry.AbstractIndexedLineSetFactory
de.jreality.geometry.IndexedLineSetFactory
- All Implemented Interfaces:
- GeometryFactory
public class IndexedLineSetFactory
- extends AbstractIndexedLineSetFactory
This is a factory class for constructing and editing instances of IndexedLineSet
. For an introduction
to the way these geometry factories work, see the documentation for the superclass PointSetFactory
.
In addition to the functionality inherited from PointSetFactory, this class offers methods to set and edit
the edge information of an IndexedLineSet. (Here edge is synonymous with 'line'.) This is first and foremost
an array of type int[][]
which specifies the combinatorics: which vertices are connected by edges.
First call setEdgeCount(int)
to set the number of edges, then
use the method setEdgeIndices(int[][])
and its variants to set this information.
There are also methods for setting the builtin attributes colors and labels. For other attributes, use the
methods:
* For attributes not included in the built-in set, use the methods
You can also request the factory to automatically generate edge labels (which are strings displayed
as 3D text at the midpoint of the edges) using the method AbstractIndexedLineSetFactory.setGenerateEdgeLabels(boolean)
. This
will generate labels showing the index of the edge within the edge array. (Probably only works correctly
when all edges consist of two points).
For an example, see
this tutorial.
- Author:
- gunn
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IndexedLineSetFactory
public IndexedLineSetFactory()
setVertexCount
public void setVertexCount(int count)
- Overrides:
setVertexCount
in class AbstractPointSetFactory
setVertexAttribute
public void setVertexAttribute(Attribute attr,
DataList data)
setVertexAttribute
public void setVertexAttribute(Attribute attr,
double[] data)
setVertexAttribute
public void setVertexAttribute(Attribute attr,
double[][] data)
- Overrides:
setVertexAttribute
in class AbstractPointSetFactory
setVertexAttributes
public void setVertexAttributes(DataListSet dls)
setVertexCoordinates
public void setVertexCoordinates(DataList data)
setVertexCoordinates
public void setVertexCoordinates(double[] data)
setVertexCoordinates
public void setVertexCoordinates(double[][] data)
setVertexNormals
public void setVertexNormals(DataList data)
setVertexNormals
public void setVertexNormals(double[] data)
setVertexNormals
public void setVertexNormals(double[][] data)
setVertexColors
public void setVertexColors(DataList data)
setVertexColors
public void setVertexColors(double[] data)
setVertexColors
public void setVertexColors(java.awt.Color[] data)
setVertexColors
public void setVertexColors(double[][] data)
setVertexTextureCoordinates
public void setVertexTextureCoordinates(DataList data)
setVertexTextureCoordinates
public void setVertexTextureCoordinates(double[] data)
setVertexTextureCoordinates
public void setVertexTextureCoordinates(double[][] data)
setVertexLabels
public void setVertexLabels(java.lang.String[] data)
setVertexRelativeRadii
public void setVertexRelativeRadii(double[] data)
setEdgeCount
public void setEdgeCount(int count)
setEdgeAttribute
public void setEdgeAttribute(Attribute attr,
DataList data)
- It's not documented why, but the superclass methods are protected, so we
have to implement these as public
setEdgeAttribute
public void setEdgeAttribute(Attribute attr,
double[] data)
setEdgeAttribute
public void setEdgeAttribute(Attribute attr,
double[][] data)
setEdgeIndices
public void setEdgeIndices(DataList data)
setEdgeIndices
public void setEdgeIndices(int[][] data)
setEdgeIndices
public void setEdgeIndices(int[] data,
int pointCountPerLine)
setEdgeIndices
public void setEdgeIndices(int[] data)
setEdgeColors
public void setEdgeColors(DataList data)
setEdgeColors
public void setEdgeColors(double[] data)
setEdgeColors
public void setEdgeColors(java.awt.Color[] data)
setEdgeColors
public void setEdgeColors(double[][] data)
setEdgeLabels
public void setEdgeLabels(java.lang.String[] data)
setEdgeRelativeRadii
public void setEdgeRelativeRadii(double[] data)