Go to the documentation of this file.
16 #ifndef SURGSIM_DATASTRUCTURES_OCTREENODEPLYREADERDELEGATE_H
17 #define SURGSIM_DATASTRUCTURES_OCTREENODEPLYREADERDELEGATE_H
25 namespace DataStructures
49 void*
beginBounds(
const std::string& elementName,
size_t count);
56 void*
beginDimension(
const std::string& elementName,
size_t count);
63 void*
beginSpacing(
const std::string& elementName,
size_t count);
69 virtual void*
beginVoxel(
const std::string& elementName,
size_t count);
74 virtual void processVoxel(
const std::string& elementName) = 0;
133 template <
typename Data>
149 std::shared_ptr<OctreeNode<Data>>
getOctree();
151 void processVoxel(
const std::string& elementName)
override;
void * beginDimension(const std::string &elementName, size_t count)
Callback function, begin the processing of the dimension.
Definition: OctreeNodePlyReaderDelegate.cpp:108
double y
Definition: OctreeNodePlyReaderDelegate.h:98
double zMax
Definition: OctreeNodePlyReaderDelegate.h:88
bool m_haveDimensions
Definition: OctreeNodePlyReaderDelegate.h:124
virtual void initializeOctree()=0
Set up the octree, this is left up to the derived classes.
double x
Definition: OctreeNodePlyReaderDelegate.h:97
Data structure to receive the spacing information from the file.
Definition: OctreeNodePlyReaderDelegate.h:95
double xMax
Definition: OctreeNodePlyReaderDelegate.h:86
Data structure to receive the dimension information from the file.
Definition: OctreeNodePlyReaderDelegate.h:103
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...
Definition: OctreeNodePlyReaderDelegate.cpp:83
OctreeNodePlyReaderDelegate()
Constructor.
Definition: OctreeNodePlyReaderDelegate-inl.h:25
double z
Definition: OctreeNodePlyReaderDelegate.h:99
bool registerDelegate(PlyReader *reader) override
Registers the delegate with the reader.
Definition: OctreeNodePlyReaderDelegate.cpp:38
virtual ~OctreeNodePlyReaderDelegate()
Destructor.
Definition: OctreeNodePlyReaderDelegate-inl.h:40
Definition: CompoundShapeToGraphics.cpp:29
void * beginSpacing(const std::string &elementName, size_t count)
Callback function, begin the processing of the bounds.
Definition: OctreeNodePlyReaderDelegate.cpp:115
unsigned int z
Definition: OctreeNodePlyReaderDelegate.h:107
OctreeNodePlyReaderDelegateBase()
Constructor.
Definition: OctreeNodePlyReaderDelegate.cpp:25
Data Structure to receive the bounds information.
Definition: OctreeNodePlyReaderDelegate.h:81
double z
Definition: OctreeNodePlyReaderDelegate.h:115
Eigen::AlignedBox< double, 3 > m_boundingBox
Bounding box, will be initialized from the file.
Definition: OctreeNodePlyReaderDelegate.h:92
struct SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::BoundsData m_bounds
Subclass the OctreeNodePLyReaderDelegateBase class to enable processing of the templated data,...
Definition: OctreeNode.h:113
virtual void processVoxel(const std::string &elementName)=0
Callback function to process one voxel.
Data structure to receive the specific voxel information from the file.
Definition: OctreeNodePlyReaderDelegate.h:111
Delegate to read Octrees from ply files, this is the abstract base class, to let us modify loading by...
Definition: OctreeNodePlyReaderDelegate.h:30
Wrapper for the C .ply file parser This class wraps the main functionality for the original C ....
Definition: PlyReader.h:85
bool m_haveBounds
Definition: OctreeNodePlyReaderDelegate.h:125
int m_numLevels
Calculated number of levels for the octree.
Definition: OctreeNodePlyReaderDelegate.h:119
double zMin
Definition: OctreeNodePlyReaderDelegate.h:85
double x
Definition: OctreeNodePlyReaderDelegate.h:113
unsigned int y
Definition: OctreeNodePlyReaderDelegate.h:106
void initializeOctree() override
Set up the octree, this is left up to the derived classes.
Definition: OctreeNodePlyReaderDelegate-inl.h:62
double y
Definition: OctreeNodePlyReaderDelegate.h:114
Octree data structure.
Definition: OctreeNode.h:131
virtual ~OctreeNodePlyReaderDelegateBase()
Destructor.
Definition: OctreeNodePlyReaderDelegate.cpp:33
std::shared_ptr< OctreeNode< Data > > m_octree
The octree that will be filled with the data from the file.
Definition: OctreeNodePlyReaderDelegate.h:158
void * beginBounds(const std::string &elementName, size_t count)
Callback function, begin the processing of the bounds.
Definition: OctreeNodePlyReaderDelegate.cpp:101
struct SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::VoxelData m_voxel
unsigned int x
Definition: OctreeNodePlyReaderDelegate.h:105
struct SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::DimensionData m_dimension
bool m_haveSpacing
Definition: OctreeNodePlyReaderDelegate.h:123
PlyReaderDelegate abstract class.
Definition: PlyReaderDelegate.h:31
std::shared_ptr< OctreeNode< Data > > getOctree()
Definition: OctreeNodePlyReaderDelegate-inl.h:46
double yMax
Definition: OctreeNodePlyReaderDelegate.h:87
double yMin
Definition: OctreeNodePlyReaderDelegate.h:84
void processVoxel(const std::string &elementName) override
Callback function to process one voxel.
Definition: OctreeNodePlyReaderDelegate-inl.h:52
struct SurgSim::DataStructures::OctreeNodePlyReaderDelegateBase::SpacingData m_spacing
virtual void * beginVoxel(const std::string &elementName, size_t count)
Callback function, begin the processing of the voxels.
Definition: OctreeNodePlyReaderDelegate.cpp:122
double xMin
Definition: OctreeNodePlyReaderDelegate.h:83