ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccPointCloudLOD Class Reference

L.O.D. (Level of Detail) structure. More...

#include <ecvPointCloudLOD.h>

Collaboration diagram for ccPointCloudLOD:
[legend]

Classes

struct  Level
 
struct  Node
 Octree 'tree' node. More...
 
struct  RenderParams
 Parameters of the current render state. More...
 

Public Types

enum  State { NOT_INITIALIZED, UNDER_CONSTRUCTION, INITIALIZED, BROKEN }
 Structure initialization state. More...
 

Public Member Functions

 ccPointCloudLOD ()
 Default constructor. More...
 
virtual ~ccPointCloudLOD ()
 Destructor. More...
 
bool init (ccPointCloud *cloud)
 Initializes the construction process (asynchronous) More...
 
void lock ()
 Locks the structure. More...
 
void unlock ()
 Unlocks the structure. More...
 
State getState ()
 Returns the current state. More...
 
void clear ()
 Clears the structure. More...
 
const ccOctree::Shared & octree () const
 Returns the associated octree. More...
 
bool isNull ()
 
bool isInitialized ()
 Returns whether the structure is initialized or not. More...
 
bool isUnderConstruction ()
 Returns whether the structure is initialized or not. More...
 
bool isBroken ()
 Returns whether the structure is broken or not. More...
 
unsigned char maxLevel ()
 Returns the maximum accessible level. More...
 
Node & node (int32_t index, unsigned char level)
 
const Node & node (int32_t index, unsigned char level) const
 
Node & root ()
 
const Node & root () const
 
uint32_t flagVisibility (const Frustum &frustum, ccClipPlaneSet *clipPlanes=0)
 Test all cells visibility with a given frustum. More...
 
LODIndexSet & getIndexMap (unsigned char level, unsigned &maxCount, unsigned &remainingPointsAtThisLevel)
 Builds an index map with the remaining visible points. More...
 
const LODIndexSet & getLasIndexMap () const
 Returns the last index map. More...
 
bool allDisplayed () const
 Returns whether all points have been displayed or not. More...
 
size_t memory () const
 Returns the memory used by the structure (in bytes) More...
 

Static Public Attributes

static const unsigned char UNDEFINED = 255
 Undefined visibility flag. More...
 

Protected Member Functions

void setState (State state)
 Sets the current state. More...
 
void clearExtended (bool autoStopThread, State newState)
 Clears the structure (with more options) More...
 
void clearData ()
 Clears the internal (nodes) data. More...
 
int32_t newCell (unsigned char level)
 Reserves a new cell at a given level. More...
 
void shrink_to_fit ()
 Shrinks the internal data to its minimum size. More...
 
void resetVisibility ()
 Updates the max radius per level FOR ALL CELLS. More...
 
uint32_t addNPointsToIndexMap (Node &node, uint32_t count)
 

Protected Attributes

friend ccPointCloudLODThread
 
std::vector< Level > m_levels
 Per-level cells data. More...
 
RenderParams m_currentState
 Current rendering state. More...
 
LODIndexSet m_indexMap
 Index map. More...
 
LODIndexSet m_lastIndexMap
 Last index map (pointer on) More...
 
ccOctree::Shared m_octree
 Associated octree. More...
 
ccPointCloudLODThread * m_thread
 Computing thread. More...
 
QMutex m_mutex
 For concurrent access. More...
 
State m_state
 State. More...
 

Detailed Description

L.O.D. (Level of Detail) structure.

Member Enumeration Documentation

◆ State

Structure initialization state.

Enumerator
NOT_INITIALIZED 
UNDER_CONSTRUCTION 
INITIALIZED 
BROKEN 

Constructor & Destructor Documentation

◆ ccPointCloudLOD()

ccPointCloudLOD::ccPointCloudLOD ( )

Default constructor.

References clearData().

Referenced by memory().

◆ ~ccPointCloudLOD()

ccPointCloudLOD::~ccPointCloudLOD ( )
virtual

Destructor.

References clear().

Member Function Documentation

◆ addNPointsToIndexMap()

uint32_t ccPointCloudLOD::addNPointsToIndexMap ( Node &  node,
uint32_t  count 
)
protected

◆ allDisplayed()

bool ccPointCloudLOD::allDisplayed ( ) const
inline

Returns whether all points have been displayed or not.

References ccPointCloudLOD::RenderParams::displayedPoints, m_currentState, and ccPointCloudLOD::RenderParams::visiblePoints.

◆ clear()

void ccPointCloudLOD::clear ( )

Clears the structure.

References m_levels, m_mutex, m_state, m_thread, and NOT_INITIALIZED.

Referenced by ccPointCloud::clearLOD(), and ~ccPointCloudLOD().

◆ clearData()

void ccPointCloudLOD::clearData ( )
protected

Clears the internal (nodes) data.

References m_levels.

Referenced by ccPointCloudLOD(), and ccPointCloudLODThread::run().

◆ clearExtended()

void ccPointCloudLOD::clearExtended ( bool  autoStopThread,
State  newState 
)
protected

Clears the structure (with more options)

◆ flagVisibility()

uint32_t ccPointCloudLOD::flagVisibility ( const Frustum &  frustum,
ccClipPlaneSet *  clipPlanes = 0 
)

◆ getIndexMap()

◆ getLasIndexMap()

const LODIndexSet& ccPointCloudLOD::getLasIndexMap ( ) const
inline

Returns the last index map.

References m_lastIndexMap.

◆ getState()

State ccPointCloudLOD::getState ( )
inline

Returns the current state.

References lock(), m_state, and unlock().

Referenced by isBroken(), isInitialized(), isNull(), and isUnderConstruction().

◆ init()

bool ccPointCloudLOD::init ( ccPointCloud *  cloud)

Initializes the construction process (asynchronous)

References ccPointCloudLODThread, isBroken(), and m_thread.

Referenced by ccPointCloud::initLOD().

◆ isBroken()

bool ccPointCloudLOD::isBroken ( )
inline

Returns whether the structure is broken or not.

References BROKEN, and getState().

Referenced by init().

◆ isInitialized()

bool ccPointCloudLOD::isInitialized ( )
inline

Returns whether the structure is initialized or not.

References getState(), and INITIALIZED.

◆ isNull()

bool ccPointCloudLOD::isNull ( )
inline

Returns whether the structure is null (i.e. not under construction or initialized) or not

References getState(), and NOT_INITIALIZED.

◆ isUnderConstruction()

bool ccPointCloudLOD::isUnderConstruction ( )
inline

Returns whether the structure is initialized or not.

References getState(), and UNDER_CONSTRUCTION.

◆ lock()

void ccPointCloudLOD::lock ( )
inline

Locks the structure.

References m_mutex.

Referenced by getState(), and setState().

◆ maxLevel()

unsigned char ccPointCloudLOD::maxLevel ( )
inline

Returns the maximum accessible level.

References INITIALIZED, m_levels, m_mutex, and m_state.

◆ memory()

size_t ccPointCloudLOD::memory ( ) const

Returns the memory used by the structure (in bytes)

References ccPointCloudLOD(), and m_levels.

Referenced by ccPointCloudLODThread::run().

◆ newCell()

int32_t ccPointCloudLOD::newCell ( unsigned char  level)
protected

Reserves a new cell at a given level.

Returns
the new cell index in the array corresponding to this level (see m_levels)

References ccPointCloudLOD::Level::data, and m_levels.

Referenced by ccPointCloudLODThread::fillNode(), and ccPointCloudLODThread::run().

◆ node() [1/2]

◆ node() [2/2]

const Node& ccPointCloudLOD::node ( int32_t  index,
unsigned char  level 
) const
inline

References m_levels.

◆ octree()

const ccOctree::Shared& ccPointCloudLOD::octree ( ) const
inline

Returns the associated octree.

References m_octree.

◆ resetVisibility()

void ccPointCloudLOD::resetVisibility ( )
protected

Updates the max radius per level FOR ALL CELLS.

Resets the internal visibility flags All nodes are flagged as 'INSIDE' (= visible) and their 'visibleCount' attribute is set to 0.

References data, INITIALIZED, Frustum::INSIDE, m_currentState, m_levels, and m_state.

Referenced by flagVisibility().

◆ root() [1/2]

Node& ccPointCloudLOD::root ( )
inline

References node().

Referenced by flagVisibility(), and ccPointCloudLODThread::run().

◆ root() [2/2]

const Node& ccPointCloudLOD::root ( ) const
inline

References node().

◆ setState()

void ccPointCloudLOD::setState ( State  state)
inlineprotected

Sets the current state.

References lock(), m_state, and unlock().

Referenced by ccPointCloudLODThread::run().

◆ shrink_to_fit()

void ccPointCloudLOD::shrink_to_fit ( )
protected

Shrinks the internal data to its minimum size.

References data, m_levels, and m_mutex.

Referenced by ccPointCloudLODThread::run().

◆ unlock()

void ccPointCloudLOD::unlock ( )
inline

Unlocks the structure.

References m_mutex.

Referenced by getState(), and setState().

Member Data Documentation

◆ ccPointCloudLODThread

friend ccPointCloudLOD::ccPointCloudLODThread
protected

Referenced by init().

◆ m_currentState

RenderParams ccPointCloudLOD::m_currentState
protected

Current rendering state.

Referenced by allDisplayed(), flagVisibility(), getIndexMap(), and resetVisibility().

◆ m_indexMap

LODIndexSet ccPointCloudLOD::m_indexMap
protected

Index map.

Referenced by addNPointsToIndexMap(), and getIndexMap().

◆ m_lastIndexMap

LODIndexSet ccPointCloudLOD::m_lastIndexMap
protected

Last index map (pointer on)

Referenced by getIndexMap(), and getLasIndexMap().

◆ m_levels

std::vector<Level> ccPointCloudLOD::m_levels
protected

◆ m_mutex

QMutex ccPointCloudLOD::m_mutex
protected

For concurrent access.

Referenced by clear(), lock(), maxLevel(), shrink_to_fit(), and unlock().

◆ m_octree

ccOctree::Shared ccPointCloudLOD::m_octree
protected

Associated octree.

Referenced by addNPointsToIndexMap(), getIndexMap(), and octree().

◆ m_state

State ccPointCloudLOD::m_state
protected

◆ m_thread

ccPointCloudLODThread* ccPointCloudLOD::m_thread
protected

Computing thread.

Referenced by clear(), and init().

◆ UNDEFINED

const unsigned char ccPointCloudLOD::UNDEFINED = 255
static

Undefined visibility flag.

Referenced by getIndexMap().


The documentation for this class was generated from the following files: