Point Cloud Viewer  1.00
A Viewer to display point clouds with phong shading by converting them to splats.
pointcloudpreprocessing.h
1 #ifndef POINTCLOUDPREPROCESSING_H
2 #define POINTCLOUDPREPROCESSING_H
3 
4 #include "entityoctreecontainer.h"
5 #include "splat.h"
6 #include <Eigen/Dense>
7 
12 {
13 public:
15 
27  static bool convertToSplatCloud(EntityOctreeContainer &container, unsigned int k, float epsilon);
28 
29 private:
31  static Eigen::MatrixXf pca(Eigen::MatrixXf mat);
32  static float growCircularSplat(Splat &splat, Entity **neighbours, float *neighbourDists, unsigned int neighbourCount, float twoEpsilon);
33  static void growEllipticalSplat(Splat &splat, Entity **neighbours, float *neighbourDists, unsigned int neighbourCount, float twoEpsilon);
34  static bool flipNormals(EntityOctreeContainer &container, unsigned int k, unsigned int maxK);
35  static void alignNormal(Splat &prototype, Splat &unalignedSplat);
36  static Eigen::Vector3f convertVec(const QVector3D &vec);
37  static QVector3D convertVec(const Eigen::Vector3f &vec);
38 
39  template<typename T> static void insertIntoSorted(T *list, float *values, unsigned int listLength, T newEntry, float newValue) {
40  unsigned int pos = listLength - 1;
41  if (newValue >= values[pos])
42  return;
43  while (pos > 0 && values[pos-1] > newValue) {
44  values[pos] = values[pos-1];
45  list[pos] = list[pos-1];
46  pos--;
47  }
48  list[pos] = newEntry;
49  values[pos] = newValue;
50  }
51 };
52 
53 #endif // POINTCLOUDPREPROCESSING_H
Stores an entity octree.
Definition: entityoctreecontainer.h:9
Provides a static method for converting a point cloud to a splat cloud.
Definition: pointcloudpreprocessing.h:11
Stores information about a single splat.
Definition: splat.h:13
An element with a location in 3-dimensional space.
Definition: entity.h:9
static bool convertToSplatCloud(EntityOctreeContainer &container, unsigned int k, float epsilon)
Takes a point cloud and converts it to a splat cloud.
Definition: pointcloudpreprocessing.cpp:8