|
ReUseX
0.0.1
3D Point Cloud Processing for Building Reuse
|
Compact spatial hash-grid for fast overlap queries during layout. More...
#include <labelLayoutSolver.hpp>

Classes | |
| struct | Node |
Public Member Functions | |
| FlatUniformGrid () | |
| void | resize (int w, int h, int gridSize) |
| Resize the grid to cover a canvas of w×h pixels using cells of gridSize. | |
| void | clear () |
| Reset all cells, keeping allocated memory. | |
| void | insert (int id, const LayoutBox &box) |
Insert item id with the given box into the grid. | |
| template<typename Visitor> | |
| void | query (const LayoutBox &box, std::vector< int > &visitedToken, int cookie, Visitor &&visitor) |
Invoke visitor for each unique item overlapping box. | |
Public Attributes | |
| int | rows = 0 |
| int | cols = 0 |
| float | cellW = 100.0f |
| float | cellH = 100.0f |
| float | invCellW = 0.01f |
| float | invCellH = 0.01f |
| std::vector< int > | gridHead |
| std::vector< Node > | nodes |
Compact spatial hash-grid for fast overlap queries during layout.
All object and label boxes are inserted into a uniform grid so that candidate overlap checks only need to visit a small neighbourhood rather than the full item list.
Definition at line 103 of file labelLayoutSolver.hpp.
|
inline |
Definition at line 116 of file labelLayoutSolver.hpp.
References nodes.
|
inline |
|
inline |
Insert item id with the given box into the grid.
Definition at line 146 of file labelLayoutSolver.hpp.
References ReUseX::vision::osd::LayoutBox::bottom, cols, gridHead, invCellH, invCellW, ReUseX::vision::osd::LayoutBox::left, nodes, ReUseX::vision::osd::LayoutBox::right, rows, and ReUseX::vision::osd::LayoutBox::top.
|
inline |
Invoke visitor for each unique item overlapping box.
visitedToken and cookie are used to avoid visiting the same item twice per query.
Definition at line 166 of file labelLayoutSolver.hpp.
References ReUseX::vision::osd::LayoutBox::bottom, cols, gridHead, invCellH, invCellW, ReUseX::vision::osd::LayoutBox::left, nodes, ReUseX::vision::osd::LayoutBox::right, rows, and ReUseX::vision::osd::LayoutBox::top.
|
inline |
| float ReUseX::vision::osd::FlatUniformGrid::cellH = 100.0f |
Definition at line 106 of file labelLayoutSolver.hpp.
Referenced by resize().
| float ReUseX::vision::osd::FlatUniformGrid::cellW = 100.0f |
Definition at line 106 of file labelLayoutSolver.hpp.
Referenced by resize().
| int ReUseX::vision::osd::FlatUniformGrid::cols = 0 |
| std::vector<int> ReUseX::vision::osd::FlatUniformGrid::gridHead |
| float ReUseX::vision::osd::FlatUniformGrid::invCellH = 0.01f |
Definition at line 107 of file labelLayoutSolver.hpp.
| float ReUseX::vision::osd::FlatUniformGrid::invCellW = 0.01f |
Definition at line 107 of file labelLayoutSolver.hpp.
| std::vector<Node> ReUseX::vision::osd::FlatUniformGrid::nodes |
Definition at line 114 of file labelLayoutSolver.hpp.
Referenced by clear(), FlatUniformGrid(), insert(), and query().
| int ReUseX::vision::osd::FlatUniformGrid::rows = 0 |