MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/CompactNSearch / NeighborhoodSearch

Class NeighborhoodSearch

include/CompactNSearch.h:19–147  ·  view source on GitHub ↗

* @class NeighborhoodSearch * Stores point data multiple set of points in which neighborhood information for a fixed * radius r should be generated. */

Source from the content-addressed store, hash-verified

17* radius r should be generated.
18*/
19class NeighborhoodSearch
20{
21
22public:
23
24 /**
25 * Constructor.
26 * Creates a new instance of the neighborhood search class.
27 * @param r Search radius. If two points are closer to each other than a distance r they are considered neighbors.
28 * @param erase_empty_cells If true. Empty cells in spatial hashing grid are erased if the points move.
29 */
30 NeighborhoodSearch(Real r, bool erase_empty_cells = false);
31
32 /**
33 * Destructor.
34 */
35 virtual ~NeighborhoodSearch() = default;
36
37 /**
38 * Get method to access a point set.
39 * @param i Index of the point set to retrieve.
40 */
41 PointSet const& point_set(unsigned int i) const { return m_point_sets[i]; }
42
43 /**
44 * Get method to access a point set.
45 * @param i Index of the point set to retrieve.
46 */
47 PointSet & point_set(unsigned int i) { return m_point_sets[i]; }
48
49
50 /**
51 * Returns the number of point sets contained in the search.
52 */
53 std::size_t n_point_sets() const { return m_point_sets.size(); }
54
55 /**
56 * Get method to access the list of point sets.
57 */
58 std::vector<PointSet> const& point_sets() const { return m_point_sets; }
59
60 /**
61 * Get method to access the list of point sets.
62 */
63 std::vector<PointSet> & point_sets() { return m_point_sets; }
64
65 /**
66 * Increases the size of a point set under the assumption that the existing points remain at
67 * the same position.
68 * @param i Index of point set that will be resized.
69 * @param x Pointer to the point position data. Must point to continguous data of 3 * n
70 * real values.
71 * @param n Number of points.
72 */
73 void increase_point_set_size(unsigned int i, Real const* x, std::size_t n);
74
75 /**
76 * Creates and adds a new set of points.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected