Package org.robwork.sdurw
Class PointCloud
- java.lang.Object
-
- org.robwork.sdurw.GeometryData
-
- org.robwork.sdurw.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.GeometryData
GeometryData.GeometryType
-
-
Constructor Summary
Constructors Constructor Description PointCloud()constructorPointCloud(int w, int h)constructor
PointCloud(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()static longgetCPtr(PointCloud obj)SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_tgetData()returns a char pointer to the image data
Transform3DfgetDataTransform()intgetHeight()TriMeshPtrgetTriMesh()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.TriMeshPtrgetTriMesh(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.GeometryTypegetType()the type of this primitive
intgetWidth()width of the point cloud data.booleanisOrdered()static PointCloudPtrloadPCD(java.lang.String filename)load point cloud from PCD file
voidresize(int w, int h)set width of point cloud.static voidsavePCD(PointCloud cloud, java.lang.String filename)save point cloud in PCD file format (PCL library format)
static voidsavePCD(PointCloud cloud, java.lang.String filename, Transform3Df t3d)save point cloud in PCD file format (PCL library format)
longsize()gets the number of points in the point cloud.
-
Methods inherited from class org.robwork.sdurw.GeometryData
getCPtr, isConvex, toString
-
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(PointCloud obj)
-
delete
public void delete()
- Overrides:
deletein classGeometryData
-
getType
public GeometryData.GeometryType getType()
Description copied from class:GeometryDatathe type of this primitive
- Overrides:
getTypein classGeometryData- Returns:
- the type of primitive.
-
size
public long size()
gets the number of points in the point cloud.
- Returns:
- the number of points.
-
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:
- const char pointer to the image data
-
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()
-
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:GeometryDatagets 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.- Overrides:
getTriMeshin classGeometryData- Parameters:
forceCopy- 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.- Returns:
- TriMesh representation of this GeometryData
-
getTriMesh
public TriMeshPtr getTriMesh()
Description copied from class:GeometryDatagets 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.
- Overrides:
getTriMeshin 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
-
-