Package mgui.geometry
Class PointSet3D
java.lang.Object
mgui.geometry.Shape3D
mgui.geometry.PointSet3D
public class PointSet3D extends Shape3D
Represents a set of 3D points.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType
-
Field Summary
Fields inherited from class mgui.geometry.Shape3D
xml_count, xml_current_block, xml_encoding, xml_itr, xml_vertices
-
Constructor Summary
Constructors Constructor Description PointSet3D()
PointSet3D(float[] nodes)
PointSet3D(PointSet3D set_to_copy)
-
Method Summary
Modifier and Type Method Description int
addVertex(org.jogamp.vecmath.Point3f vertex)
void
addVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> list)
void
clear()
java.lang.Object
clone()
T must be 4 x 4 transformation matrix public boolean transform(Matrix T){ for (int i = 0; i < n; i++){ Matrix node = arMath.getMatrixFromPoint3d(new Point3d(getNode(i))); node = node.transpose().times(T); Point3f p = new Point3f(arMath.getPoint3dFromMatrix(node)); this.setNode(i, p); } }void
finalize()
float[]
getCoords()
org.jogamp.vecmath.Point3f
getVertex(int i)
Returns the vertex at the specified index as aPoint3f
.java.util.ArrayList<org.jogamp.vecmath.Point3f>
getVertices()
Returns a list of this shape's nodes asPoint3f
's.void
removeNode(int i)
void
setCoords(float[] coords)
void
setFromPointSet(PointSet3D set)
void
setVertex(int i, org.jogamp.vecmath.Point3f p)
void
setVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> list)
void
writeXML(int tab, java.io.Writer writer, InterfaceProgressBar progress_bar)
Methods inherited from class mgui.geometry.Shape3D
contains, getBoundBox, getCenter, getDTD, getLocalName, getProximity, getProximityPoint, getShortXML, getSize, getXML, getXML, getXMLSchema, handleXMLElementEnd, handleXMLElementStart, handleXMLString, loadAsciiCoords, loadBinaryCoords, loadCoords, loadXMLCoord, setVertices, transform, transform, writeAsciiCoords, writeBinaryCoords, writeCoords, writeXML, writeXML, writeXML
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
nodes
public float[] nodes -
n
public int n
-
-
Constructor Details
-
PointSet3D
public PointSet3D() -
PointSet3D
public PointSet3D(float[] nodes) -
PointSet3D
-
-
Method Details
-
addVertex
public int addVertex(org.jogamp.vecmath.Point3f vertex) -
clear
public void clear() -
removeNode
public void removeNode(int i) -
getVertices
public java.util.ArrayList<org.jogamp.vecmath.Point3f> getVertices()Description copied from class:Shape3D
Returns a list of this shape's nodes asPoint3f
's. This list is a copy, so operations performed on these nodes will not affect this shape.- Specified by:
getVertices
in classShape3D
- Returns:
-
getCoords
public float[] getCoords() -
finalize
public void finalize()- Overrides:
finalize
in classjava.lang.Object
-
getVertex
public org.jogamp.vecmath.Point3f getVertex(int i)Description copied from class:Shape3D
Returns the vertex at the specified index as aPoint3f
. This vertex is a copy, so operations performed on it will not affect this shape.Note: subclasses may want to provide a more efficient implementation of this method.
-
setVertex
public void setVertex(int i, org.jogamp.vecmath.Point3f p) -
addVertices
public void addVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> list) -
clone
public java.lang.Object clone()T must be 4 x 4 transformation matrix public boolean transform(Matrix T){ for (int i = 0; i < n; i++){ Matrix node = arMath.getMatrixFromPoint3d(new Point3d(getNode(i))); node = node.transpose().times(T); Point3f p = new Point3f(arMath.getPoint3dFromMatrix(node)); this.setNode(i, p); } } -
setFromPointSet
-
writeXML
public void writeXML(int tab, java.io.Writer writer, InterfaceProgressBar progress_bar) throws java.io.IOException- Throws:
java.io.IOException
-
setCoords
public void setCoords(float[] coords) -
setVertices
public void setVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> list)- Specified by:
setVertices
in classShape3D
-