KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
Geometry::CollisionPointCloud Class Reference

A point cloud with a fast collision detection data structure. More...

#include <CollisionPointCloud.h>

Inheritance diagram for Geometry::CollisionPointCloud:
Meshing::PointCloud3D

Public Member Functions

 CollisionPointCloud (const Meshing::PointCloud3D &pc)
 
 CollisionPointCloud (const CollisionPointCloud &pc)
 
void InitCollisions ()
 
- Public Member Functions inherited from Meshing::PointCloud3D
void Clear ()
 
bool LoadPCL (const char *fn)
 
bool SavePCL (const char *fn) const
 
bool LoadPCL (istream &in)
 
bool SavePCL (ostream &out) const
 
void FromDepthImage (int w, int h, float wfov, float hfov, const std::vector< float > &depths, const std::vector< unsigned int > &rgb, float invalidDepth=0.0)
 Converts a w x h depth image to a structured point cloud. The camera frame is x right, y down, z forward. More...
 
void FromDepthImage (int w, int h, float wfov, float hfov, float depthscale, const std::vector< unsigned short > &depths, const std::vector< unsigned int > &rgb, unsigned short invalidDepth=0)
 Converts a w x h depth image to a structured point cloud. The camera frame is x right, y down, z forward. More...
 
void GetAABB (Vector3 &bmin, Vector3 &bmax) const
 Returns the bounding box of the point set.
 
void Transform (const Matrix4 &mat)
 Transforms all points and, if present, normals.
 
bool IsStructured () const
 A structured point cloud has settings "width" and "height". Invalid points are marked as (0,0,0) (preferred) or (nan,nan,nan)
 
int GetStructuredWidth () const
 
int GetStructuredHeight () const
 
void SetStructured (int w, int h)
 
Vector3 GetOrigin () const
 
void SetOrigin (const Vector3 &origin)
 
RigidTransform GetViewpoint () const
 
void SetViewpoint (const RigidTransform &T)
 
int PropertyIndex (const string &name) const
 
bool HasProperty (const string &name) const
 
bool GetProperty (const string &name, vector< Real > &items) const
 
void SetProperty (const string &name, const vector< Real > &items)
 
void RemoveProperty (const string &name)
 
void GetSubCloud (const Vector3 &bmin, const Vector3 &bmax, PointCloud3D &subcloud)
 Extracts all points within the bounding box [bmin,bmax].
 
void GetSubCloud (const string &property, Real value, PointCloud3D &subcloud)
 Extracts all points with the named property = value.
 
void GetSubCloud (const string &property, Real minValue, Real maxValue, PointCloud3D &subcloud)
 Extracts all points with the minValue <= named property <= maxValue.
 
bool HasXYZAsProperties () const
 Some point clouds have properties x, y, and z rather than specifying points.
 
void SetXYZAsProperties (bool)
 Convert to/from x, y, z as properties vs points.
 
bool HasNormals () const
 
bool GetNormals (vector< Vector3 > &normals) const
 
void SetNormals (const vector< Vector3 > &normals)
 
void ComputeNormals (Real radius=0)
 
bool HasColor () const
 
bool HasOpacity () const
 
bool HasRGB () const
 
bool HasRGBA () const
 
bool UnpackColorChannels (bool alpha=false)
 Converts rgb or rgba packed color channels to r,g,b / r,g,b,a channels. Removes old channels.
 
bool PackColorChannels (const char *fmt="rgba")
 Converts unpacked color channels into packed channel. fmt is the desired property, either "rgb" or "rgba". Removes old channels.
 
bool GetColors (vector< Real > &r, vector< Real > &g, vector< Real > &b, vector< Real > &a) const
 
bool GetColors (vector< Vector4 > &rgba) const
 
void SetColors (const vector< Real > &r, const vector< Real > &g, const vector< Real > &b, bool includeAlpha=false)
 
void SetColors (const vector< Real > &r, const vector< Real > &g, const vector< Real > &b, const vector< Real > &a, bool includeAlpha=true)
 
void SetColors (const vector< Vector4 > &rgba, bool includeAlpha=true)
 
bool HasUV () const
 
bool GetUV (vector< Vector2 > &uvs) const
 
void SetUV (const vector< Vector2 > &uvs)
 

Public Attributes

AABB3D bblocal
 The local bounding box of the point cloud.
 
RigidTransform currentTransform
 The transformation of the point cloud in space.
 
Real gridResolution
 default value is 0, which auto-determines from point cloud
 
GridSubdivision3D grid
 
shared_ptr< OctreePointSetoctree
 
- Public Attributes inherited from Meshing::PointCloud3D
vector< Vector3points
 
vector< string > propertyNames
 
vector< Vectorproperties
 
PropertyMap settings
 

Detailed Description

A point cloud with a fast collision detection data structure.

Member Function Documentation

void Geometry::CollisionPointCloud::InitCollisions ( )

Sets up the collision detection data structures. This is automatically called during initialization, and needs to be called any time the point cloud changes

References Math::IsFinite().


The documentation for this class was generated from the following files: