24 class ccPointCloudLODThread;
94 ?
static_cast<unsigned char>(
95 std::max<size_t>(1,
m_levels.size())) -
134 inline Node&
node(int32_t index,
unsigned char level) {
135 assert(level <
m_levels.size() && index >= 0 &&
136 index <
m_levels[level].data.size());
140 inline const Node&
node(int32_t index,
unsigned char level)
const {
141 assert(level <
m_levels.size() && index >= 0 &&
142 index <
m_levels[level].data.size());
165 unsigned& remainingPointsAtThisLevel);
279 unsigned char maxLevel)
283 if (testVisibility) {
286 testVisibility =
false;
290 testVisibility =
true;
300 for (
int i = 0; i < 8; ++i) {
304 render(childNode, testVisibility);
Intersection sphereInFrustum(const CCVector3f &c, float r) const
const Frustum & m_frustum
PointCloudLODRenderer(ccPointCloudLOD &lod, RenderFunc &func, const Frustum &frustum, unsigned char maxLevel)
void render(const ccPointCloudLOD::Node &node, bool testVisibility)
std::function< void(const ccPointCloudLOD::Node &)> RenderFunc
QSharedPointer< ccOctree > Shared
Shared pointer.
L.O.D. (Level of Detail) structure.
QMutex m_mutex
For concurrent access.
bool isUnderConstruction()
Returns whether the structure is initialized or not.
State getState()
Returns the current state.
void clear()
Clears the structure.
bool allDisplayed() const
Returns whether all points have been displayed or not.
int32_t newCell(unsigned char level)
Reserves a new cell at a given level.
const Node & root() const
LODIndexSet m_indexMap
Index map.
ccPointCloudLODThread * m_thread
Computing thread.
void shrink_to_fit()
Shrinks the internal data to its minimum size.
LODIndexSet m_lastIndexMap
Last index map (pointer on)
const LODIndexSet & getLasIndexMap() const
Returns the last index map.
LODIndexSet & getIndexMap(unsigned char level, unsigned &maxCount, unsigned &remainingPointsAtThisLevel)
Builds an index map with the remaining visible points.
void unlock()
Unlocks the structure.
const Node & node(int32_t index, unsigned char level) const
uint32_t flagVisibility(const Frustum &frustum, ccClipPlaneSet *clipPlanes=0)
Test all cells visibility with a given frustum.
void clearExtended(bool autoStopThread, State newState)
Clears the structure (with more options)
ccPointCloudLOD()
Default constructor.
uint32_t addNPointsToIndexMap(Node &node, uint32_t count)
size_t memory() const
Returns the memory used by the structure (in bytes)
RenderParams m_currentState
Current rendering state.
virtual ~ccPointCloudLOD()
Destructor.
Node & node(int32_t index, unsigned char level)
bool isBroken()
Returns whether the structure is broken or not.
void setState(State state)
Sets the current state.
void resetVisibility()
Updates the max radius per level FOR ALL CELLS.
void lock()
Locks the structure.
bool init(ccPointCloud *cloud)
Initializes the construction process (asynchronous)
std::vector< Level > m_levels
Per-level cells data.
unsigned char maxLevel()
Returns the maximum accessible level.
void clearData()
Clears the internal (nodes) data.
State
Structure initialization state.
bool isInitialized()
Returns whether the structure is initialized or not.
static const unsigned char UNDEFINED
Undefined visibility flag.
const ccOctree::Shared & octree() const
Returns the associated octree.
friend ccPointCloudLODThread
ccOctree::Shared m_octree
Associated octree.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
std::vector< ccClipPlane > ccClipPlaneSet
std::vector< unsigned > LODIndexSet
L.O.D. indexes set.
unsigned count
Index count for this level.
LODLevelDesc()
Default constructor.
unsigned startIndex
Start index (refers to the 'indexes' table)
LODLevelDesc(unsigned _startIndex, unsigned _count)
Constructor from a start index and a count value.
Node(uint8_t _level=0)
Default constructor.
uint32_t displayedPointCount
std::array< int32_t, 8 > childIndexes
Parameters of the current render state.
int unfinishedLevel
Previously unfinished level.
uint32_t visiblePoints
Number of visible points (for the last visibility test)
unsigned unfinishedPoints
Previously unfinished level.
uint32_t displayedPoints
Number of already displayed points.