Module pointcloud

Class CloudList

All Implemented Interfaces:
NodeContext, ProducingNode, BoundedCloud, Cloud, CloudContext, DisposableField, Manageable, Shareable, Disposable

public class CloudList extends CloudArray
An extension of a Cloud array to view point as list. It also implements some methods for applying clustering tools.
  • Field Details

  • Constructor Details

    • CloudList

      public CloudList()
      A constructor to get an empty point cloud. The point cloud will have a default color and an empty list of points.
    • CloudList

      public CloudList(Node n)
    • CloudList

      public CloudList(Cloud apc)
    • CloudList

      public CloudList(Node parent, List<ArrayPoint> points)
      A constructor to get a point cloud with a list of points. The color will be a default color.
      Parameters:
      points - The list of points for the point cloud
    • CloudList

      public CloudList(float[] f)
  • Method Details

    • setNode

      public void setNode(Node cnode)
      Specified by:
      setNode in interface NodeContext
      Overrides:
      setNode in class CloudArray
    • editable

      public boolean editable()
      Description copied from interface: Cloud
      A cloud is editable if it is possible to add and remove points. Being able to setPoint does not make the cloud editable as is change either all or none of hte points.
      Specified by:
      editable in interface Cloud
      Overrides:
      editable in class CloudArray
    • createNew

      public Cloud createNew()
      Specified by:
      createNew in interface Cloud
      Overrides:
      createNew in class CloudArray
    • getNumberOfPoints

      public int getNumberOfPoints()
      Returns the number of points in this point cloud.
      Specified by:
      getNumberOfPoints in interface Cloud
      Overrides:
      getNumberOfPoints in class CloudArray
      Returns:
      The number of points in this point cloud
    • addPoint

      public void addPoint(ArrayPoint point)
      Adds a point to this point cloud. The point cloud reference of the point is replaced with this point cloud.
      Parameters:
      point - The point to add
    • getPoints

      public Cloud.Point[] getPoints()
      Returns the list of points of this point cloud.
      Specified by:
      getPoints in interface Cloud
      Overrides:
      getPoints in class CloudArray
      Returns:
      The list of points in this point cloud
    • getCenter

      public Vector3f getCenter()
      Returns the center position of this point cloud as a point object. This method does not return the point with the most-centric position, it returns a position with the average position of all points in the point cloud instead.
      Specified by:
      getCenter in interface BoundedCloud
      Overrides:
      getCenter in class CloudArray
      Returns:
      The center position of this point cloud as a point object
    • getCenterX

      public float getCenterX()
      Returns the center x position of this point cloud.
      Overrides:
      getCenterX in class CloudArray
      Returns:
      The center x position of this point cloud
    • getCenterY

      public float getCenterY()
      Returns the center y position of this point cloud.
      Overrides:
      getCenterY in class CloudArray
      Returns:
      The center y position of this point cloud
    • getCenterZ

      public float getCenterZ()
      Returns the center z position of this point cloud.
      Overrides:
      getCenterZ in class CloudArray
      Returns:
      The center z position of this point cloud
    • getMinimumX

      public float getMinimumX()
      Returns the minimum x position of this point cloud.
      Specified by:
      getMinimumX in interface BoundedCloud
      Overrides:
      getMinimumX in class CloudArray
      Returns:
      The minimum x position of this point cloud
    • getMaximumX

      public float getMaximumX()
      Returns the maximum x position of this point cloud.
      Specified by:
      getMaximumX in interface BoundedCloud
      Overrides:
      getMaximumX in class CloudArray
      Returns:
      The maximum x position of this point cloud
    • getMinimumY

      public float getMinimumY()
      Returns the minimum y position of this point cloud.
      Specified by:
      getMinimumY in interface BoundedCloud
      Overrides:
      getMinimumY in class CloudArray
      Returns:
      The minimum y position of this point cloud
    • getMaximumY

      public float getMaximumY()
      Returns the maximum y position of this point cloud.
      Specified by:
      getMaximumY in interface BoundedCloud
      Overrides:
      getMaximumY in class CloudArray
      Returns:
      The maximum y position of this point cloud
    • getMinimumZ

      public float getMinimumZ()
      Returns the minimum z position of this point cloud.
      Specified by:
      getMinimumZ in interface BoundedCloud
      Overrides:
      getMinimumZ in class CloudArray
      Returns:
      The minimum z position of this point cloud
    • getMaximumZ

      public float getMaximumZ()
      Returns the maximum z position of this point cloud.
      Specified by:
      getMaximumZ in interface BoundedCloud
      Overrides:
      getMaximumZ in class CloudArray
      Returns:
      The maximum z position of this point cloud
    • getExtremum

      public float getExtremum(char dimension, char operator)
      Returns the extremum value of this point cloud. The requested extremum value is specified with the given dimension and the given operator. To get a minimum value, the operator must be '-'. To get a maximum value, the operator must be '+'. To get a minimum in x, y or z direction, the dimension parameter must be 'x', 'y' or 'z'.
      Parameters:
      dimension - Must be 'x', 'y' or 'z' to get the correct dimension
      operator - Must be '-' to get a minimum or '+' to get a maximum
      Returns:
      The minimum or maximum value in the requested dimension
    • getValue

      public float getValue(int index, char dimension)
      Returns the x, y or z coordinate at the given index. The dimension parameter must be 'x', 'y' or 'z' to get the x, y or z coordinate. If the dimension parameter is wrong or the index is outside the point list, an exception is thrown.
      Parameters:
      index - The index of the returned point
      dimension - The dimension (x, y, or z) of the returned point
      Returns:
      The dimension value of the requested point
      Throws:
      IllegalArgumentException - If the index is < 0, too high or the dimension parameter is invalid
    • setPointCloudOfPoints

      public static void setPointCloudOfPoints(CloudList pointCloud, List<ArrayPoint> points)
      Sets the given point cloud as point cloud of all given points.
      Parameters:
      pointCloud - The point cloud to set in all points
      points - The list of points where to set the point cloud
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Cloud
      To be part of the graph a cloud need to be added to a node. This return the cloudNode associated to this cloud if any.
      Specified by:
      isEmpty in interface Cloud
      Overrides:
      isEmpty in class CloudArray
    • setPoints

      public void setPoints(Cloud.Point[] points)
      Specified by:
      setPoints in interface Cloud
      Overrides:
      setPoints in class CloudArray
    • setPoints

      public void setPoints(float[] points)
      Overrides:
      setPoints in class CloudArray
    • addPoints

      public void addPoints(Cloud.Point[] points)
      Specified by:
      addPoints in interface Cloud
      Overrides:
      addPoints in class CloudArray
    • addPoint

      public void addPoint(Cloud.Point p)
      Specified by:
      addPoint in interface Cloud
      Overrides:
      addPoint in class CloudArray
    • remove

      public Cloud.Point remove(Object i)
      Specified by:
      remove in interface Cloud
      Overrides:
      remove in class CloudArray
    • remove

      public Cloud.Point[] remove(Object[] i)
      Specified by:
      remove in interface Cloud
      Overrides:
      remove in class CloudArray
    • removeAll

      public void removeAll()
      Specified by:
      removeAll in interface Cloud
      Overrides:
      removeAll in class CloudArray
    • setListPoints

      public void setListPoints(List<ArrayPoint> points)
    • getListPoints

      public List<ArrayPoint> getListPoints()
    • peek

      public Cloud.Point peek()
      Specified by:
      peek in interface Cloud
      Overrides:
      peek in class CloudArray
    • pop

      public Cloud.Point pop()
      Specified by:
      pop in interface Cloud
      Overrides:
      pop in class CloudArray
    • push

      public void push(Cloud.Point p)
      Specified by:
      push in interface Cloud
      Overrides:
      push in class CloudArray
    • pointsToFloat

      public float[] pointsToFloat()
      Parallel version
      Specified by:
      pointsToFloat in interface Cloud
      Overrides:
      pointsToFloat in class CloudArray
    • floatsToPoint

      public Cloud.Point[] floatsToPoint(float[] f)
      Specified by:
      floatsToPoint in interface Cloud
      Overrides:
      floatsToPoint in class CloudArray
    • getMimeType

      public MimeType getMimeType()
      Description copied from class: CloudArray
      Serialization management
      Overrides:
      getMimeType in class CloudArray
    • hasContent

      public boolean hasContent()
      Description copied from class: EmbeddedSharedObject
      True if the object is not "empty" as its persistence depends how the mimetype write content, a java object with some value could be defined as "empty"
      Overrides:
      hasContent in class CloudArray
    • create

      public static CloudList create(Aggregate a, Cloud.Point p)
    • produceNode

      public Node produceNode()
      Description copied from class: CloudArray
      Add Object to graph
      Specified by:
      produceNode in interface ProducingNode
      Overrides:
      produceNode in class CloudArray
    • getManageableType

      public ManageableType getManageableType()
      Specified by:
      getManageableType in interface Manageable
      Overrides:
      getManageableType in class CloudArray