Package org.robwork.sdurw_geometry
Class PointCloud
- java.lang.Object
-
- org.robwork.sdurw_geometry.GeometryData
-
- org.robwork.sdurw_geometry.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.robwork.sdurw_geometry.GeometryData
GeometryData.GeometryType
-
-
Constructor Summary
Constructors Constructor Description PointCloud()
constructorPointCloud(int w, int h)
constructorPointCloud(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
Vector3Df
get(long row, long column)
static long
getCPtr(PointCloud obj)
SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t
getData()
returns a char pointer to the image dataTransform3Df
getDataTransform()
int
getHeight()
TriMeshPtr
getTriMesh()
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.TriMeshPtr
getTriMesh(boolean forceCopy)
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.GeometryData.GeometryType
getType()
the type of this primitiveint
getWidth()
width of the point cloud data.boolean
isOrdered()
static PointCloudPtr
loadPCD(java.lang.String filename)
load point cloud from PCD filevoid
resize(int w, int h)
set width of point cloud.static void
savePCD(PointCloud cloud, java.lang.String filename)
save point cloud in PCD file format (PCL library format)static void
savePCD(PointCloud cloud, java.lang.String filename, Transform3Df t3d)
save point cloud in PCD file format (PCL library format)void
set(long row, long column, Vector3Df d)
long
size()
gets the number of points in the point cloud.-
Methods inherited from class org.robwork.sdurw_geometry.GeometryData
getCPtr, isConvex, toString
-
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(PointCloud obj)
-
delete
public void delete()
- Overrides:
delete
in classGeometryData
-
getType
public GeometryData.GeometryType getType()
Description copied from class:GeometryData
the type of this primitive- Overrides:
getType
in classGeometryData
-
size
public long size()
gets the number of points in the point cloud.
-
isOrdered
public boolean isOrdered()
-
getData
public SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t getData()
returns a char pointer to the image data- Returns:
- char pointer to the image data
-
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 widthh
- [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 classGeometryData
- 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 classGeometryData
- Returns:
- TriMesh representation of this GeometryData
-
getDataTransform
public Transform3Df getDataTransform()
-
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 savefilename
- [in] the name of the file to save tot3d
- [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 savefilename
- [in] the name of the file to save to
-
-