Class PointCloud


  • public class PointCloud
    extends GeometryData

    A simple point cloud data structure. Points may be ordered or not. An ordered set is
    kept as a single array in row major order and with a width and a height. An unordered array
    must have height==1 and width equal to the number of points.
    • Constructor Detail

      • PointCloud

        public PointCloud​(long cPtr,
                          boolean cMemoryOwn)
      • PointCloud

        public PointCloud()
        constructor
      • PointCloud

        public PointCloud​(int w,
                          int h)
        constructor
        Parameters:
        w -
        h -
    • Method Detail

      • getCPtr

        public static long getCPtr​(PointCloud obj)
      • size

        public long size()
        gets the number of points in the point cloud.
      • isOrdered

        public boolean isOrdered()
      • get

        public Vector3Df get​(long row,
                             long column)
      • set

        public void set​(long row,
                        long column,
                        Vector3Df d)
      • getWidth

        public int getWidth()
        width of the point cloud data. If the data is unordered then this
        will be equal to the number of points.
        Returns:
        width of data points
      • getHeight

        public int getHeight()

        Returns:
        height
      • resize

        public void resize​(int w,
                           int h)
        set width of point cloud. Data elements are accessed as [x+y*width].

        If the current data array cannot contain the elements then it will be resized to
        be able to it.
        Parameters:
        w - [in] new width
        h - [in] new height
      • getTriMesh

        public TriMeshPtr getTriMesh​(boolean forceCopy)
        Description copied from class: GeometryData
        gets a trimesh representation of this geometry data.

        The trimesh that is returned is by default a copy, which means
        ownership is transfered to the caller. Specifying forceCopy to false
        will enable copy by reference and ownership is not necesarilly transfered.
        This is more efficient, though pointer is only alive as long as this
        GeometryData is alive.

        Overrides:
        getTriMesh in class GeometryData
        Returns:
        TriMesh representation of this GeometryData
      • getTriMesh

        public TriMeshPtr getTriMesh()
        Description copied from class: GeometryData
        gets a trimesh representation of this geometry data.

        The trimesh that is returned is by default a copy, which means
        ownership is transfered to the caller. Specifying forceCopy to false
        will enable copy by reference and ownership is not necesarilly transfered.
        This is more efficient, though pointer is only alive as long as this
        GeometryData is alive.

        Overrides:
        getTriMesh in class GeometryData
        Returns:
        TriMesh representation of this GeometryData
      • loadPCD

        public static PointCloudPtr loadPCD​(java.lang.String filename)
        load point cloud from PCD file
        Parameters:
        filename - [in] name of PCD file
        Returns:
        a point cloud
      • savePCD

        public static void savePCD​(PointCloud cloud,
                                   java.lang.String filename,
                                   Transform3Df t3d)
        save point cloud in PCD file format (PCL library format)
        Parameters:
        cloud - [in] the point cloud to save
        filename - [in] the name of the file to save to
        t3d - [in] the transformation of the point cloud
      • savePCD

        public static void savePCD​(PointCloud cloud,
                                   java.lang.String filename)
        save point cloud in PCD file format (PCL library format)
        Parameters:
        cloud - [in] the point cloud to save
        filename - [in] the name of the file to save to