de.jreality.scene
Class PointSet

java.lang.Object
  extended by de.jreality.scene.SceneGraphNode
      extended by de.jreality.scene.Geometry
          extended by de.jreality.scene.PointSet
Direct Known Subclasses:
IndexedLineSet

public class PointSet
extends Geometry

A set of points in 3 space.

Vertices can be specified with either 3- or 4-D coordinates. The point set is represented as set of attribute/value pairs. The values are typically arrays of data, with one vector or scalar per point. Every point set must contain a value for the Attribute.COORDINATES. Other built-in attributes include:

Accessing instances of this class directly requires use of the class DataList. Users who prefer to avoid this are recommended to use PointSetFactory to construct instances of this class.

Author:
Tim Hoffmann, gunn

Field Summary
 
Fields inherited from class de.jreality.scene.Geometry
CATEGORY_EDGE, CATEGORY_FACE, CATEGORY_VERTEX
 
Constructor Summary
PointSet()
           
PointSet(int numPoints)
           
PointSet(java.lang.String name)
           
PointSet(java.lang.String name, int numPoints)
           
 
Method Summary
 void accept(SceneGraphVisitor v)
          The accept method for a SceneGraphVisitor.
 int getNumPoints()
          The number of vertices defines the length of all data lists associated with vertex attributes.
 DataListSet getVertexAttributes()
          Returns a read-only view to all currently defined vertex attributes.
 DataList getVertexAttributes(Attribute attr)
           
 void setNumPoints(int numVertices)
          Sets the number of vertices, implies removal of all previously defined vertex attributes.
 void setVertexAttributes(Attribute attr, DataList dl)
           
 void setVertexAttributes(DataListSet dls)
           
 void setVertexCountAndAttributes(Attribute attr, DataList dl)
           
 void setVertexCountAndAttributes(DataListSet dls)
           
 
Methods inherited from class de.jreality.scene.Geometry
addGeometryListener, getAttributes, getAttributes, getGeometryAttributeCathegories, getGeometryAttributes, getGeometryAttributes, getNumEntries, removeGeometryListener, setAttributes, setAttributes, setCountAndAttributes, setCountAndAttributes, setGeometryAttributes, setGeometryAttributes, setNumEntries
 
Methods inherited from class de.jreality.scene.SceneGraphNode
getName, getOwner, getThreadSafe, isReadOnly, setName, setOwner, setReadOnly, setThreadSafe, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PointSet

public PointSet()

PointSet

public PointSet(int numPoints)

PointSet

public PointSet(java.lang.String name)

PointSet

public PointSet(java.lang.String name,
                int numPoints)
Method Detail

getNumPoints

public int getNumPoints()
The number of vertices defines the length of all data lists associated with vertex attributes.


setNumPoints

public void setNumPoints(int numVertices)
Sets the number of vertices, implies removal of all previously defined vertex attributes.

Parameters:
numVertices - the number of vertices to set >=0

getVertexAttributes

public DataListSet getVertexAttributes()
Returns a read-only view to all currently defined vertex attributes. You can copy all currently defined vertex attributes to another PointSet using target.setVertexAttributes(source.getVertexAttributes()) These attributes are copied then, not shared. Thus modifying either source or target afterwards will not affect the other.

See Also:
setVertexAttributes(DataListSet), Geometry.getGeometryAttributes()

getVertexAttributes

public DataList getVertexAttributes(Attribute attr)

setVertexAttributes

public void setVertexAttributes(DataListSet dls)

setVertexAttributes

public void setVertexAttributes(Attribute attr,
                                DataList dl)

setVertexCountAndAttributes

public void setVertexCountAndAttributes(Attribute attr,
                                        DataList dl)

setVertexCountAndAttributes

public void setVertexCountAndAttributes(DataListSet dls)

accept

public void accept(SceneGraphVisitor v)
Description copied from class: SceneGraphNode
The accept method for a SceneGraphVisitor.

Overrides:
accept in class Geometry