Class RMPath3D

java.lang.Object
com.inductiveautomation.rm.graphics.RMPath3D
All Implemented Interfaces:
Cloneable

public class RMPath3D extends Object implements Cloneable
This class represents a path in 3D space.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte
     
    static final byte
     
    static final byte
     
    static final byte
     
    static final byte
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new empty path.
    RMPath3D(RMPath aPath, double aDepth)
    Creates a 3D path from a 2D path with a depth.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addPath(RMPath aPath, double aDepth)
    Adds a 2D path to the path3D at the given depth.
    void
    align(RMVector3D aVector)
    Transforms the path so the normal is aligned with the given vector.
    Standard clone implementation.
    void
    Adds a close element to the path3d.
    int
    compare(Object anObj)
    UNUSED!!! Returns wether the given path is behind (ASCEND) or in front (DESCEND) of this path.
    int
    Returns whether receiver is in front (ORDER_ASCEND) or aPath in front (ORDER_DESCEND).
    void
    curveTo(double cp1x, double cp1y, double cp1z, double cp2x, double cp2y, double cp2z, double x, double y, double z)
    Adds a curve-to to the path3d with the given 3d coords.
    Returns the bounding box for the path as {min,max}.
    Returns the center point of the path.
    double
    Returns the distance from a point to the plane of this polygon.
    byte
    getElement(int anIndex)
    Returns the element type at the given index.
    byte
    getElement(int anIndex, RMPoint3D[] points)
    Returns the element at the given index.
    int
    Returns the number of elements in the path3d.
    Returns the normal of the path3d.
    Returns a path for the path3d.
    getPoint(int anIndex)
    Returns the point3d at the given index.
    int
    Returns the number of points in the path3d.
    double
    Returns the max X for the path.
    double
    Returns the max X for the path.
    double
    Returns the max Y for the path.
    double
    Returns the max Y for the path.
    double
    Returns the max Z for the path.
    double
    Returns the max Z for the path.
    void
    lineTo(double x, double y, double z)
    Adds a line to the path3d with the given 3D coords.
    void
    moveTo(double x, double y, double z)
    Adds a moveto to the path3d with the given 3D coords.
    void
    quadTo(double cpx, double cpy, double cpz, double x, double y, double z)
    Adds a quad-to to the path3d with the given 3D control point and coords.
    void
    Reverses the path3d.
    void
    Sets the center point of the path.
    void
    Transforms the path by the given transform3d.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • RMPath3D

      public RMPath3D()
      Creates a new empty path.
    • RMPath3D

      public RMPath3D(RMPath aPath, double aDepth)
      Creates a 3D path from a 2D path with a depth.
  • Method Details

    • getElementCount

      public int getElementCount()
      Returns the number of elements in the path3d.
    • getElement

      public byte getElement(int anIndex)
      Returns the element type at the given index.
    • getPointCount

      public int getPointCount()
      Returns the number of points in the path3d.
    • getPoint

      public RMPoint3D getPoint(int anIndex)
      Returns the point3d at the given index.
    • getElement

      public byte getElement(int anIndex, RMPoint3D[] points)
      Returns the element at the given index.
    • moveTo

      public void moveTo(double x, double y, double z)
      Adds a moveto to the path3d with the given 3D coords.
    • lineTo

      public void lineTo(double x, double y, double z)
      Adds a line to the path3d with the given 3D coords.
    • quadTo

      public void quadTo(double cpx, double cpy, double cpz, double x, double y, double z)
      Adds a quad-to to the path3d with the given 3D control point and coords.
    • curveTo

      public void curveTo(double cp1x, double cp1y, double cp1z, double cp2x, double cp2y, double cp2z, double x, double y, double z)
      Adds a curve-to to the path3d with the given 3d coords.
    • close

      public void close()
      Adds a close element to the path3d.
    • addPath

      public void addPath(RMPath aPath, double aDepth)
      Adds a 2D path to the path3D at the given depth.
    • getCenter

      public RMPoint3D getCenter()
      Returns the center point of the path.
    • setCenter

      public void setCenter(RMPoint3D aPoint)
      Sets the center point of the path.
    • getNormal

      public RMVector3D getNormal()
      Returns the normal of the path3d. Right hand rule for clockwise/counter-clockwise defined polygons.
    • getDistance

      public double getDistance(RMPoint3D aPoint)
      Returns the distance from a point to the plane of this polygon.
    • reverse

      public void reverse()
      Reverses the path3d.
    • transform

      public void transform(RMTransform3D xform)
      Transforms the path by the given transform3d.
    • align

      public void align(RMVector3D aVector)
      Transforms the path so the normal is aligned with the given vector.
    • getPath

      public RMPath getPath()
      Returns a path for the path3d.
    • compare

      public int compare(Object anObj)
      UNUSED!!! Returns wether the given path is behind (ASCEND) or in front (DESCEND) of this path.
    • comparePlane

      public int comparePlane(RMPath3D aPath)
      Returns whether receiver is in front (ORDER_ASCEND) or aPath in front (ORDER_DESCEND). Returns (ORDER_SAME) if the two paths are coplanar, or (ORDER_INDETERMINATE) if they intersect.
    • getBBox

      public RMPoint3D[] getBBox()
      Returns the bounding box for the path as {min,max}.
    • getXMin

      public double getXMin()
      Returns the max X for the path.
    • getXMax

      public double getXMax()
      Returns the max X for the path.
    • getYMin

      public double getYMin()
      Returns the max Y for the path.
    • getYMax

      public double getYMax()
      Returns the max Y for the path.
    • getZMin

      public double getZMin()
      Returns the max Z for the path.
    • getZMax

      public double getZMax()
      Returns the max Z for the path.
    • clone

      public Object clone()
      Standard clone implementation.
      Overrides:
      clone in class Object