Package mgui.geometry

Class PointSet3D

java.lang.Object
mgui.geometry.Shape3D
mgui.geometry.PointSet3D
All Implemented Interfaces:
java.lang.Cloneable, Shape, XMLObject

public class PointSet3D
extends Shape3D
Represents a set of 3D points.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

    • nodes

      public float[] nodes
    • n

      public int n
  • Constructor Details

    • PointSet3D

      public PointSet3D()
    • PointSet3D

      public PointSet3D​(float[] nodes)
    • PointSet3D

      public PointSet3D​(PointSet3D set_to_copy)
  • 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 as Point3f's. This list is a copy, so operations performed on these nodes will not affect this shape.
      Specified by:
      getVertices in class Shape3D
      Returns:
    • getCoords

      public float[] getCoords()
      Specified by:
      getCoords in interface Shape
      Specified by:
      getCoords in class Shape3D
    • finalize

      public void finalize()
      Overrides:
      finalize in class java.lang.Object
    • getVertex

      public org.jogamp.vecmath.Point3f getVertex​(int i)
      Description copied from class: Shape3D
      Returns the vertex at the specified index as a Point3f. 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.

      Specified by:
      getVertex in class Shape3D
      Returns:
    • 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); } }
      Overrides:
      clone in class Shape3D
    • setFromPointSet

      public void setFromPointSet​(PointSet3D set)
    • 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)
      Specified by:
      setCoords in interface Shape
      Specified by:
      setCoords in class Shape3D
    • setVertices

      public void setVertices​(java.util.ArrayList<org.jogamp.vecmath.Point3f> list)
      Specified by:
      setVertices in class Shape3D