Class Utils

java.lang.Object
de.grogra.pointcloud.utils.Utils

public class Utils extends Object
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • translate

      public static void translate(PointCloudBase pc, Tuple3d translation)
      translate the pointcloud with the translation vector.
      Parameters:
      pc -
      coordinate - the new origin (a node that is going to be pushed to the (0,0,0)
    • translate

      public static void translate(Node[] pcs, Tuple3d translation)
    • setAsOrigin

      public static void setAsOrigin(PointCloudBase pc, PointCloudLeaf newOrigin, Tuple3d coordinate)
      Translate the pointcloud base to use the coordinate as new origin based on the newOrigin leaf provided.
      Parameters:
      pc -
      newOrigin -
      coordinate -
    • setAsOrigin

      public static void setAsOrigin(Node[] pcs, PointCloudLeaf newOrigin, Tuple3d coordinate)
    • fromSourceName

      public static Node[] fromSourceName(Graph g, String name)
      Return the PointCloudBase that have the given source name (i.e. the pointcloud created from a file). One file usually create several pointcloudbase objects (one for the points, one for the faces, one for the edges).
      Parameters:
      name -
      Returns:
    • fromRoot

      public static Node[] fromRoot(Node root)
      Return the PointCloudBase that are one depth bellow the given root. When imported pointclouds file create several PointCloudBase that are linked to a node before being added to the main graph. That node is the one expected here.
      Parameters:
      root -
    • isLeafOverPlane

      public static boolean isLeafOverPlane(Null leaf, Plane plane)
      Determine whether a leaf node is above or under a given plane
      Parameters:
      leaf - The leaf to be checked
      plane - The plane to check against
      Returns:
      true if the leaf is over the given plane else false
    • getLeafNodes

      public static List<Node> getLeafNodes(PointCloudBase pc)
      Returns all leaf nodes as list of nodes
      Parameters:
      pc - the point cloud containing the leaf nodes
      Returns:
      list of nodes