MeVisLab Toolbox Reference
MinimalDistancePointClouds.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 
17 
18 #pragma once
19 
20 #include "../MLPointCloudUtilsSystem.h"
21 
22 #include "mlVector3.h"
23 
24 
25 ML_START_NAMESPACE
26 
27 class TileSphere;
28 class TileSphereHashTable;
29 
34 {
35 public:
36 
41 
43  void setPointSets(const std::vector<ml::Vector3>& pointCloud1, const std::vector<ml::Vector3>& pointCloud2);
46  void setFirstPointSet(const std::vector<ml::Vector3>& pointCloud);
49  void setFirstSinglePoint(const ml::Vector3& point);
50 
51 
55  void setNumEntries(int entries);
57  void setParams(int entries, int partition);
59  void setError(float error);
60 
63  void computeDistance(float* &point1, float* &point2);
66  void computeDistance(ml::Vector3& point1, ml::Vector3& point2);
67 
68 
73 
75  void verbose(bool onOff);
76 
77 
78 private:
79 
81  float* _pointSet1;
83  float* _pointSet2;
85  size_t _size1, _size2;
87  unsigned int _sphereIndex;
89  TileSphereHashTable* _hashTable;
90 
92  TileSphere* _tileSphere1;
94  TileSphere* _tileSphere2;
95 
97  float _error;
98 
100  bool _verbose;
101 
103  int _entries, _partition;
104 
106  TileSphere* generateTree(float* pointSet, size_t size);
107 
109  void getBB(float* pointSet, size_t size, float& minX, float& maxX, float& minY, float& maxY, float& minZ, float& maxZ);
110 };
111 
112 ML_END_NAMESPACE
#define MLPOINTCLOUDUTILS_EXPORT
The MinimalDistancePointClouds implements a fast nearest pair search algorithm described by Sean Quin...
void setParams(int entries, int partition)
Sets fix values for both objects for _entries and _partition.
void computeDistance(ml::Vector3 &point1, ml::Vector3 &point2)
Returns two points with minimal distance as Vector3.
void computeDistance(float *&point1, float *&point2)
Returns a copy of the both points with the minimal distance.
TileSphereHashTable * getHashTable()
Returns a pointer to the hash table.
void setFirstPointSet(const std::vector< ml::Vector3 > &pointCloud)
Sets only the first point set anew.
void setNumEntries(int entries)
This parameter describes how many points can be put as maximum into one sub sphere,...
void setPointSets(const std::vector< ml::Vector3 > &pointCloud1, const std::vector< ml::Vector3 > &pointCloud2)
This method passes the two point clouds in the form of two standard vectors.
void setError(float error)
Describes the maintainable error. 0 = 0% and 1 = 100%. The default value is 0.
MinimalDistancePointClouds()
Constructor.
void setFirstSinglePoint(const ml::Vector3 &point)
Sets only the first point set anew, which consists only of a single point.
int getUniqueIndex()
Returns a unique index for each tile sphere.
virtual ~MinimalDistancePointClouds()
Destructor.
void verbose(bool onOff)
Dumps the console with additional debugging info.
TileSphereHashTable is used in the classes MinimalDistancePointClouds and TileSphere.
TileSphere is used in the class MinimalDistancePointClouds.
Definition: TileSphere.h:37