Inshaping: include/HyperCloud.h Source File

Inshaping

Inshaping  0.1
HyperCloud.h
Go to the documentation of this file.
1 /*
2 @author:Elliott Zheng
3 @date: 2018/4/12
4 */
5 
6 #ifndef HYPER_CLOUD_HEADER
7 #define HYPER_CLOUD_HEADER
8 
9 //Local
10 #include "GenericChunkedArray.h"
11 #include "GenericIndexedCloudPersist.h"
12 #include "PointProjectionTools.h"
13 #include <Eigen/Dense>
14 #include<pcl/point_types.h>
15 #include<memory>
16 
17 namespace CCLib
18 {
19 
20  class PointsContainer;
21  class ScalarField;
24 
26 
29  class CC_CORE_LIB_API HyperCloud : public GenericIndexedCloudPersist
30  {
31  public:
32  typedef std::shared_ptr<HyperCloud> Ptr;
33 
35  HyperCloud();
36 
38  virtual ~HyperCloud();
39 
40  //**** inherited form GenericCloud ****//
41  virtual unsigned size() const;
42  virtual void forEach(genericPointAction action);
43 
44  virtual void getBoundingBox(CCVector3& bbMin, CCVector3& bbMax);
45  virtual std::vector<Eigen::Vector3d> getOBB();
46  virtual void placeIteratorAtBeginning();
47  virtual const CCVector3* getNextPoint();
48  virtual bool enableScalarField();
49  virtual bool isScalarFieldEnabled() const;
50  virtual void setPointScalarValue(unsigned pointIndex, ScalarType value);
51  virtual ScalarType getPointScalarValue(unsigned pointIndex) const;
52 
53  //**** inherited form GenericIndexedCloud ****//
54  virtual const CCVector3* getPoint(unsigned index) { return getPointPersistentPtr(index); }
55 
56 
57  //**** ���Լ�д��*********************//
58 
59  //���ص��Eigen::Vector3d ���ͣ����Ƕ���������IJ����Dz���Ӱ�쵽Դ���Ƶ� inline virtual const Eigen::Vector3d getEigenVec(unsigned index); inline virtual const pcl::PointXYZ getPointXYZ(unsigned index); //�������� Eigen::Vector3d getBaryCenter(); void addCloud(CCLib::HyperCloud& cloud); virtual void getPoint(unsigned index, CCVector3& P) const; //**** inherited form GenericIndexedCloudPersist ****// virtual const CCVector3* getPointPersistentPtr(unsigned index); //! Clears cloud void clear(); //! Point insertion mechanism /** The point data will be duplicated in memory. \param P the point to insert **/ virtual void addPoint(const CCVector3 &P); virtual void addPoint(const Eigen::Vector3d& p); //! Point insertion mechanism /** The point data will be duplicated in memory. \param P the point to insert (as a 3-size array) **/ virtual void addPoint(const PointCoordinateType P[]); //! Reserves some memory for hosting the points /** \param n the number of points **/ virtual bool reserve(unsigned n); //! Presets the size of the vector used to store the points /** \param n the number of points **/ virtual bool resize(unsigned n); //! Applies a rigid transformation to the cloud /** WARNING: THIS METHOD IS NOT COMPATIBLE WITH PARALLEL STRATEGIES \param trans transformation (scale * rotation matrix + translation vector) **/ virtual void applyTransformation(PointProjectionTools::Transformation& trans); //! Returns associated scalar field (if any) ScalarField* getScalarField() { return m_scalarField; } //! Returns associated scalar field (if any) (const version) const ScalarField* getScalarField() const { return m_scalarField; } protected: //! Point container typedef GenericChunkedArray<3, PointCoordinateType> PointsContainer; //! 3D Points container PointsContainer* m_points; //! The points distances ScalarField* m_scalarField; //! Iterator on the points container unsigned globalIterator; //! Bounding-box validity bool m_validBB; }; /*@}*/ } #endif //HYPER_CLOUD_HEADER
60  inline virtual const Eigen::Vector3d getEigenVec(unsigned index);
61 
62  inline virtual const pcl::PointXYZ getPointXYZ(unsigned index);
63 
64  //�������� Eigen::Vector3d getBaryCenter(); void addCloud(CCLib::HyperCloud& cloud); virtual void getPoint(unsigned index, CCVector3& P) const; //**** inherited form GenericIndexedCloudPersist ****// virtual const CCVector3* getPointPersistentPtr(unsigned index); //! Clears cloud void clear(); //! Point insertion mechanism /** The point data will be duplicated in memory. \param P the point to insert **/ virtual void addPoint(const CCVector3 &P); virtual void addPoint(const Eigen::Vector3d& p); //! Point insertion mechanism /** The point data will be duplicated in memory. \param P the point to insert (as a 3-size array) **/ virtual void addPoint(const PointCoordinateType P[]); //! Reserves some memory for hosting the points /** \param n the number of points **/ virtual bool reserve(unsigned n); //! Presets the size of the vector used to store the points /** \param n the number of points **/ virtual bool resize(unsigned n); //! Applies a rigid transformation to the cloud /** WARNING: THIS METHOD IS NOT COMPATIBLE WITH PARALLEL STRATEGIES \param trans transformation (scale * rotation matrix + translation vector) **/ virtual void applyTransformation(PointProjectionTools::Transformation& trans); //! Returns associated scalar field (if any) ScalarField* getScalarField() { return m_scalarField; } //! Returns associated scalar field (if any) (const version) const ScalarField* getScalarField() const { return m_scalarField; } protected: //! Point container typedef GenericChunkedArray<3, PointCoordinateType> PointsContainer; //! 3D Points container PointsContainer* m_points; //! The points distances ScalarField* m_scalarField; //! Iterator on the points container unsigned globalIterator; //! Bounding-box validity bool m_validBB; }; /*@}*/ } #endif //HYPER_CLOUD_HEADER
65  Eigen::Vector3d getBaryCenter();
66 
67  void addCloud(CCLib::HyperCloud& cloud);
68 
69  virtual void getPoint(unsigned index, CCVector3& P) const;
70 
71  //**** inherited form GenericIndexedCloudPersist ****//
72  virtual const CCVector3* getPointPersistentPtr(unsigned index);
73 
75  void clear();
76 
78 
81  virtual void addPoint(const CCVector3 &P);
82 
83  virtual void addPoint(const Eigen::Vector3d& p);
84 
86 
90  virtual void addPoint(const PointCoordinateType P[]);
91 
92 
94 
96  virtual bool reserve(unsigned n);
97 
99 
101  virtual bool resize(unsigned n);
102 
104 
107  virtual void applyTransformation(PointProjectionTools::Transformation& trans);
108 
109 
111  ScalarField* getScalarField() { return m_scalarField; }
112 
114  const ScalarField* getScalarField() const { return m_scalarField; }
115 
116  protected:
117 
119  typedef GenericChunkedArray<3, PointCoordinateType> PointsContainer;
120 
123 
124 
126  ScalarField* m_scalarField;
127 
129  unsigned globalIterator;
130 
132  bool m_validBB;
133  };
134 
136 }
137 
138 #endif //HYPER_CLOUD_HEADER
139 
const ScalarField * getScalarField() const
Returns associated scalar field (if any) (const version)
Definition: HyperCloud.h:114
ScalarField * m_scalarField
The points distances.
Definition: HyperCloud.h:126
GenericChunkedArray< 3, PointCoordinateType > PointsContainer
Point container.
Definition: HyperCloud.h:119
bool m_validBB
Bounding-box validity.
Definition: HyperCloud.h:132
Definition: HyperCloud.h:17
PointsContainer * m_points
3D Points container
Definition: HyperCloud.h:122
virtual const CCVector3 * getPoint(unsigned index)
Definition: HyperCloud.h:54
std::shared_ptr< HyperCloud > Ptr
Definition: HyperCloud.h:32
An Extended point cloud (with point duplication mechanism)
Definition: HyperCloud.h:29
ScalarField * getScalarField()
Returns associated scalar field (if any)
Definition: HyperCloud.h:111
unsigned globalIterator
Iterator on the points container.
Definition: HyperCloud.h:129
Generated by   doxygen 1.8.14