opensurgsim
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase Class Referenceabstract

Delegate to read Octrees from ply files, this is the abstract base class, to let us modify loading by datatype. More...

#include <OctreeNodePlyReaderDelegate.h>

Inheritance diagram for SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase:
SurgSim::DataStructures::PlyReaderDelegate SurgSim::DataStructures::OctreeNodePlyReaderDelegate< Data >

Classes

struct  BoundsData
 Data Structure to receive the bounds information. More...
 
struct  DimensionData
 Data structure to receive the dimension information from the file. More...
 
struct  SpacingData
 Data structure to receive the spacing information from the file. More...
 
struct  VoxelData
 Data structure to receive the specific voxel information from the file. More...
 

Public Member Functions

 OctreeNodePlyReaderDelegateBase ()
 Constructor.
 
virtual ~OctreeNodePlyReaderDelegateBase ()
 Destructor.
 
bool registerDelegate (PlyReader *reader) override
 Registers the delegate with the reader. More...
 
bool fileIsAcceptable (const PlyReader &reader) override
 Check whether the file in the reader can be used with this delegate, this gives the delegate a chance to make sure that all the elements and properties that are required are available in the file encapsulated by the reader.
 
void * beginBounds (const std::string &elementName, size_t count)
 Callback function, begin the processing of the bounds. More...
 
void * beginDimension (const std::string &elementName, size_t count)
 Callback function, begin the processing of the dimension. More...
 
void * beginSpacing (const std::string &elementName, size_t count)
 Callback function, begin the processing of the bounds. More...
 
virtual void * beginVoxel (const std::string &elementName, size_t count)
 Callback function, begin the processing of the voxels. More...
 
virtual void processVoxel (const std::string &elementName)=0
 Callback function to process one voxel. More...
 
- Public Member Functions inherited from SurgSim::DataStructures::PlyReaderDelegate
virtual ~PlyReaderDelegate ()
 Virtual destructor.
 

Protected Member Functions

virtual void initializeOctree ()=0
 Set up the octree, this is left up to the derived classes.
 

Protected Attributes

struct SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::BoundsData m_bounds
 
Eigen::AlignedBox< double, 3 > m_boundingBox
 Bounding box, will be initialized from the file.
 
struct SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::SpacingData m_spacing
 
struct SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::DimensionData m_dimension
 
struct SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::VoxelData m_voxel
 
int m_numLevels = -1
 Calculated number of levels for the octree.
 
bool m_haveSpacing
 
bool m_haveDimensions
 
bool m_haveBounds
 

Detailed Description

Delegate to read Octrees from ply files, this is the abstract base class, to let us modify loading by datatype.

Member Function Documentation

§ beginBounds()

void * SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::beginBounds ( const std::string &  elementName,
size_t  count 
)

Callback function, begin the processing of the bounds.

Parameters
elementNameName of the element.
countNumber of entries.
Exceptions
SurgSim::Framework::AssertionFailureif count != 1, only one bounds entry is expected
Returns
memory for bounds data to the reader.

§ beginDimension()

void * SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::beginDimension ( const std::string &  elementName,
size_t  count 
)

Callback function, begin the processing of the dimension.

Parameters
elementNameName of the element.
countNumber of entries.
Exceptions
SurgSim::Framework::AssertionFailureif count != 1, only one dimesion entry is expected
Returns
memory for dimension data to the reader.

§ beginSpacing()

void * SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::beginSpacing ( const std::string &  elementName,
size_t  count 
)

Callback function, begin the processing of the bounds.

Parameters
elementNameName of the element.
countNumber of entries.
Exceptions
SurgSim::Framework::AssertionFailureif count != 1, only one spacing entry is expected
Returns
memory for spacing data to the reader.

§ beginVoxel()

void * SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::beginVoxel ( const std::string &  elementName,
size_t  count 
)
virtual

Callback function, begin the processing of the voxels.

Parameters
elementNameName of the element.
countNumber of bounds entry.
Returns
memory for voxel data to the reader.

§ processVoxel()

virtual void SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::processVoxel ( const std::string &  elementName)
pure virtual

Callback function to process one voxel.

This is left up to the subclasses, they might have to deal with data specific processing

Parameters
elementNameName of the element.

Implemented in SurgSim::DataStructures::OctreeNodePlyReaderDelegate< Data >.

§ registerDelegate()

bool SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::registerDelegate ( PlyReader reader)
overridevirtual

Registers the delegate with the reader.

Parameters
[out]readerThe reader that should be used by the delegate.
Returns
true usually if the reader is valid and fileIsAcceptable() is true.

Implements SurgSim::DataStructures::PlyReaderDelegate.

Member Data Documentation

§ m_haveSpacing

bool SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::m_haveSpacing
protected

Check wether we actually received the appropriate information, if not we can't initialize the octree


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