Drawings SDK Developer Guide > Working with Point Clouds > Working with Point Clouds with PointCloud SDK > Point Cloud Visualization Interface
Point Cloud Visualization Interface

PointCloud SDK provides a special interface to access .rcs point cloud data during the visualization. This interface is represented by the OdRcsDataManager class.

The main task of OdRcsDataManager is to process information about the voxels visible in the current viewport and select the appropriate level of detail (LOD) for each of them.

LOD values are precalculated and stored within .rcs file. OdRcsDataManager checks visibility of each specific voxel for the current viewport and if the voxel is visible, OdRcsDataManager selects an appropriate LOD and loads corresponding number of points from .rcs file to the memory.

OdRcsDataManager works with one specific instance of OdPointCloudScanDatabase.

If you are working with .rcs file you may prepare OdRcsDataManager before the draw process using the following call:

pRcsDataMgr = pRcsFileServices->getRcsDataManager(pScanDb);

If you are working with .rcp file (point cloud project) you should obtain OdRcsDataManager for each of .rcs files (each scan) related to .rcp. In this case you should also pass a pointer to OdPointCloudProjectDatabase object which is a host of your specific .rcs (OdPointCloudScanDatabase):

pRcsDataMgr = pRcsFileServices->getRcsDataManager(pScanDb, pProjDb);

Drawing procedure for each scan within your project might look as follows:


pViewportDraw->geometry().pushModelTransform(pProjDb->getGlobalTransformation());
pViewportDraw->geometry().pushModelTransform(
                                pProjDb->getScanTransform(pScanDb->getScanId()));

OdGiPointCloudPtr pGiPointCloud = pRcsDataMgr->newGiPointCloud(nPointSize);
pViewportDraw->geometry().pointCloud(*pGiPointCloud);

pViewportDraw->geometry().popModelTransform();
pViewportDraw->geometry().popModelTransform();
    

Drawing procedure for a separate scan might look as follows:


pViewportDraw->geometry().pushModelTransform(pScanDb->getTransformMatrix());
	  
OdGiPointCloudPtr pGiPointCloud = pRcsDataMgr->newGiPointCloud(nPointSize);
pViewportDraw->geometry().pointCloud(*pGiPointCloud);

pViewportDraw->geometry().popModelTransform();
    

In the examples above, you may see that OdRcsDataManager provides an instance of OdGiPointCloud class to be passed to the drawing pipeline. Using OdGiPointCloud is a recommended approach for point clouds visualizing.

Any additional info about all these mechanisms you can obtain from comments in the following header files:

  • Kernel/Include/RcsFileServices/RxRcsFileServices.h
  • Kernel/Include/RcsFileServices/OdRcsDataManager.h
  • Kernel/Include/RcsFileServices/OdRcsVisibleVoxelsIterator.h
  • Kernel/Include/Gi/GiPointCloud.h

Additional examples you may find within Drawings SDK and Visualize SDK. Corresponding samples are using PointCloud SDK tools to provide a complete implementation of point clouds visualization.

See Also

Basic Concept and List of Supported Point Cloud Formats

Read .rcs Files

Read .rcp Files

Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.