1 #ifndef MESHING_POINT_CLOUD_H 2 #define MESHING_POINT_CLOUD_H 5 #include <KrisLibrary/math/vector.h> 6 #include <KrisLibrary/utils/PropertyMap.h> 54 bool LoadPCL(
const char* fn);
55 bool SavePCL(
const char* fn)
const;
56 bool LoadPCL(istream& in);
57 bool SavePCL(ostream& out)
const;
66 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);
76 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);
80 void Transform(
const Matrix4& mat);
82 bool IsStructured()
const;
83 int GetStructuredWidth()
const;
84 int GetStructuredHeight()
const;
85 void SetStructured(
int w,
int h);
87 void SetOrigin(
const Vector3& origin);
90 int PropertyIndex(
const string& name)
const;
91 bool HasProperty(
const string& name)
const {
return PropertyIndex(name) >= 0; }
98 bool GetProperty(
const string& name,vector<Real>& items)
const;
105 int SetProperty(
const string& name,
const vector<Real>& items);
107 void RemoveProperty(
const string& name);
111 void GetSubCloud(
const string& property,Real value,
PointCloud3D& subcloud);
113 void GetSubCloud(
const string& property,Real minValue,Real maxValue,
PointCloud3D& subcloud);
115 bool HasXYZAsProperties()
const;
117 void SetXYZAsProperties(
bool);
118 bool HasNormals()
const;
119 bool GetNormals(vector<Vector3>& normals)
const;
120 void SetNormals(
const vector<Vector3>& normals);
123 void ComputeNormals(Real radius=0);
124 bool HasColor()
const;
125 bool HasOpacity()
const;
127 bool HasRGBA()
const;
129 bool UnpackColorChannels(
bool alpha=
false);
131 bool PackColorChannels(
const char* fmt=
"rgba");
132 bool GetColors(vector<Real>& r,vector<Real>& g,vector<Real>& b,vector<Real>& a)
const;
133 bool GetColors(vector<Vector4>& rgba)
const;
134 void SetColors(
const vector<Real>& r,
const vector<Real>& g,
const vector<Real>& b,
bool includeAlpha =
false);
135 void SetColors(
const vector<Real>& r,
const vector<Real>& g,
const vector<Real>& b,
const vector<Real>& a,
bool includeAlpha =
true);
136 void SetColors(
const vector<Vector4>& rgba,
bool includeAlpha=
true);
138 bool GetUV(vector<Vector2>& uvs)
const;
139 void SetUV(
const vector<Vector2>& uvs);
141 vector<Vector3> points;
142 vector<string> propertyNames;
143 vector<Vector> properties;
The namespace for all classes/functions in the Meshing package.
Definition: AnyGeometry.h:11
A 3D vector class.
Definition: math3d/primitives.h:136
A 3D point cloud class.
Definition: PointCloud.h:50
Definition: rayprimitives.h:132
Class declarations for useful 3D math types.
A 4x4 matrix class.
Definition: math3d/primitives.h:626
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:13
A simple map from keys to values.
Definition: PropertyMap.h:27