COGS
Computer Graphics Structures library
cogs::io::DataBlockImporter Class Reference

Enables reading of cogs structures into files. More...

Public Member Functions

 DataBlockImporter ()
 Creates importer with default DataBlockManager object.
 
 DataBlockImporter (const std::shared_ptr< DataBlockManager > &datablock_manager)
 Creates importer with custom DataBlockManager object.
 
 DataBlockImporter (const DataBlockImporter &)=delete
 
DataBlockImporter & operator= (const DataBlockImporter &)=delete
 
 DataBlockImporter (const DataBlockImporter &&)=delete
 
DataBlockImporter & operator= (const DataBlockImporter &&)=delete
 
bool OpenFile (const std::string &filename)
 Opens file for reading and fetches file header information.
 
void CloseFile ()
 Closes currently opened file, disabling getters.
 
bool IsFileOpen () const
 Checks if a file is currently open.
 
size_t GetPointCloudCount () const
 Returns number of available all point cloud objects.
 
bool ReadPointCloud (cogs::PointCloud &out_cloud, DataBlockIndex id=0)
 Loads object with specified index from file. Returns success.
 
size_t GetScanCount () const
 Returns number of available point cloud objects with scan information.
 
bool ReadScan (cogs::Scan &out_scan, DataBlockIndex id=0)
 Loads object with specified index from file. Returns success.
 
size_t GetMeshCount () const
 Returns number of available mesh objects.
 
bool ReadMesh (cogs::Mesh &out_mesh, DataBlockIndex id=0)
 Loads object with specified index from file. Returns success.
 

Detailed Description

Enables reading of cogs structures into files.

When file is open, only header is fetched, containing information about data available in file and it counts. When user gets specific object, it is imported directly from file. When file is closed, no data can be obtained.

By default, exporter supports only predefined data blocks, but can be altered to support also custom data blocks, when user-defined DataBlockManager is provided during class construction.

For more information about cogs file io system, see page COGS File Format.