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 intaddVertex(org.jogamp.vecmath.Point3f vertex)voidaddVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> list)voidclear()java.lang.Objectclone()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); } }voidfinalize()float[]getCoords()org.jogamp.vecmath.Point3fgetVertex(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.voidremoveNode(int i)voidsetCoords(float[] coords)voidsetFromPointSet(PointSet3D set)voidsetVertex(int i, org.jogamp.vecmath.Point3f p)voidsetVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> list)voidwriteXML(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, writeXMLMethods 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:Shape3DReturns 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:
getVerticesin classShape3D- Returns:
-
getCoords
public float[] getCoords() -
finalize
public void finalize()- Overrides:
finalizein classjava.lang.Object
-
getVertex
public org.jogamp.vecmath.Point3f getVertex(int i)Description copied from class:Shape3DReturns 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:
setVerticesin classShape3D
-