Workspace 6.21.5
|
A functor that splits a point cloud into multiple sub-regions (patches) and computes multiple levels of detail (LODs) for each. More...
#include <Rendering/SceneComponents/splitandlodpointcloud.h>
Classes | |
class | LodSettings |
Settings for computing LOD for each patch. More... | |
struct | PatchIndex |
An index referring to a specific patch. The index corresponds to the patch's coordinates in 3 dimensions (x, y and z). More... | |
class | PatchList |
Represents a list of patches; sub-regions of a point cloud. More... | |
class | SplitSettings |
Settings that control how a point cloud is split into patches. More... | |
Public Types | |
using | MeshList = QList< Mesh::MeshModelInterface * > |
enum | PatchCountSpecification { Auto , Manual } |
Defines how the number of patches is determined - manually by the user or automatically based on the number of points in the model. More... | |
using | QuadtreePlane = LinearSpatialPartitioningTree::QuadtreePlane |
using | TreeLayout = LinearSpatialPartitioningTree::TreeLayout |
Public Member Functions | |
SplitAndLodPointCloud (const SplitSettings &splitSettings, const LodSettings &lodSettings, std::function< void()> preCellProcessFunc=[] {}, std::function< void()> postCellProcessFunc=[] {}) | |
SplitAndLodPointCloud (std::function< void()> preCellProcessFunc=[] {}, std::function< void()> postCellProcessFunc=[] {}) | |
~SplitAndLodPointCloud () | |
QList< PatchIndex > | createPatches () |
const SplitSettings & | getSplitSettings () const |
bool | initSettings (const QString &baseId, Mesh::MeshModelInterface &pointCloud, PatchList &patchesOut) |
bool | lodPatchCloud (const PatchIndex &patchIndex, DataExecution::ObjectDictionary &diagnostics) |
bool | operator() (const QString &baseId, Mesh::MeshModelInterface &pointCloud, PatchList &patchesOut, DataExecution::ObjectDictionary &diagnosticsOut) |
void | setLodSettings (const LodSettings &lodSettings) |
void | setSplitSettings (const SplitSettings &splitSettings) |
The number and size of patches can be controlled through input parameters, as can the maximum and base levels of detail. Levels of detail are specified as LOD number 0 (zero) being the most detailed, and LOD N (dependent on the number of points and their density) being the least detailed.
The algorithm uses a sparse linear octree (or quad-tree if requested - useful for long, thin clouds) to sub-divide each patch into cells. For each cell at each level in the tree, the node closest to the cell's centroid is added to the LOD cloud associated with that level in the tree, along with all of the nodes associated with the previous LOD level. In order to ensure that calling code is always interacting with real point cloud data, no synthetic nodes are created.
Example: we have a patch containing 100 nodes spread out in an equally spaced 10 x 10 grid. Our algorithm will yield the following LODs for this patch:
LOD 0 - 100 points (full detail) LOD 1 - 85 points (1 for each of the 64 sub-cells, plus 21 from the previous level) LOD 2 - 21 points (1 for each of the 16 sub-cells, plus 5 from the previous level) LOD 3 - 5 points (1 for each of the 4 sub-cells, plus 1 from the previous level) LOD 4 - 1 point (least detail)
All LOD data is created by referencing points at LOD 0, so memory utilisation is minimised and state data is preserved on all individual points. Because no synthetic nodes are generated, no averaging of state data occurs.
using MeshList = QList<Mesh::MeshModelInterface*> |
SplitAndLodPointCloud | ( | std::function< void()> | preCellProcessFunc = [] {} , |
std::function< void()> | postCellProcessFunc = [] {} |
||
) |
SplitAndLodPointCloud | ( | const SplitSettings & | splitSettings, |
const LodSettings & | lodSettings, | ||
std::function< void()> | preCellProcessFunc = [] {} , |
||
std::function< void()> | postCellProcessFunc = [] {} |
||
) |
|
default |
QList< SplitAndLodPointCloud::PatchIndex > createPatches | ( | ) |
const SplitAndLodPointCloud::SplitSettings & getSplitSettings | ( | ) | const |
bool initSettings | ( | const QString & | baseId, |
Mesh::MeshModelInterface & | pointCloud, | ||
PatchList & | patchesOut | ||
) |
bool lodPatchCloud | ( | const PatchIndex & | patchIndex, |
DataExecution::ObjectDictionary & | diagnostics | ||
) |
bool operator() | ( | const QString & | baseId, |
Mesh::MeshModelInterface & | pointCloud, | ||
PatchList & | patchesOut, | ||
DataExecution::ObjectDictionary & | diagnosticsOut | ||
) |
baseId | The unique base identifier to associated with all output patches. |
pointCloud | Point cloud to split into patches, each with multiple LODs (levels of detail). |
patchesOut | (out) The output patches produced by executing the functor. |
diagnosticsOut | (out) Diagnostic information computed during this execution. |
Executes the SplitAndLodPointCloud functor on the target pointCloud, returning a list of patches in patchesOut. Each output patch is a MeshModelInstance with multiple LOD levels, each with a distance associated with them.
void setLodSettings | ( | const LodSettings & | lodSettings | ) |
void setSplitSettings | ( | const SplitSettings & | splitSettings | ) |