16 #ifndef SURGSIM_DATASTRUCTURES_OCTREENODEPLYREADERDELEGATE_H 17 #define SURGSIM_DATASTRUCTURES_OCTREENODEPLYREADERDELEGATE_H 19 #include "SurgSim/DataStructures/PlyReaderDelegate.h" 20 #include "SurgSim/DataStructures/OctreeNode.h" 21 #include "SurgSim/DataStructures/EmptyData.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;
83 double xMin = std::numeric_limits<double>::signaling_NaN();
84 double yMin = std::numeric_limits<double>::signaling_NaN();
85 double zMin = std::numeric_limits<double>::signaling_NaN();
86 double xMax = std::numeric_limits<double>::signaling_NaN();
87 double yMax = std::numeric_limits<double>::signaling_NaN();
88 double zMax = std::numeric_limits<double>::signaling_NaN();
97 double x = std::numeric_limits<double>::signaling_NaN();
98 double y = std::numeric_limits<double>::signaling_NaN();
99 double z = std::numeric_limits<double>::signaling_NaN();
113 double x = std::numeric_limits<double>::signaling_NaN();
114 double y = std::numeric_limits<double>::signaling_NaN();
115 double z = std::numeric_limits<double>::signaling_NaN();
124 bool m_haveDimensions;
133 template <
typename Data>
149 std::shared_ptr<OctreeNode<Data>> getOctree();
151 void processVoxel(
const std::string& elementName)
override;
158 std::shared_ptr<OctreeNode<Data>> m_octree;
164 #include "SurgSim/DataStructures/OctreeNodePlyReaderDelegate-inl.h" Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void * beginBounds(const std::string &elementName, size_t count)
Callback function, begin the processing of the bounds.
Definition: OctreeNodePlyReaderDelegate.cpp:101
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
bool registerDelegate(PlyReader *reader) override
Registers the delegate with the reader.
Definition: OctreeNodePlyReaderDelegate.cpp:38
Eigen::AlignedBox< double, 3 > m_boundingBox
Bounding box, will be initialized from the file.
Definition: OctreeNodePlyReaderDelegate.h:92
virtual void * beginVoxel(const std::string &elementName, size_t count)
Callback function, begin the processing of the voxels.
Definition: OctreeNodePlyReaderDelegate.cpp:122
Data Structure to receive the bounds information.
Definition: OctreeNodePlyReaderDelegate.h:81
Wrapper for the C .ply file parser This class wraps the main functionality for the original C ...
Definition: PlyReader.h:85
virtual ~OctreeNodePlyReaderDelegateBase()
Destructor.
Definition: OctreeNodePlyReaderDelegate.cpp:33
void * beginSpacing(const std::string &elementName, size_t count)
Callback function, begin the processing of the bounds.
Definition: OctreeNodePlyReaderDelegate.cpp:115
virtual void initializeOctree()=0
Set up the octree, this is left up to the derived classes.
Subclass the OctreeNodePLyReaderDelegateBase class to enable processing of the templated data...
Definition: OctreeNode.h:113
Delegate to read Octrees from ply files, this is the abstract base class, to let us modify loading by...
Definition: OctreeNodePlyReaderDelegate.h:30
void * beginDimension(const std::string &elementName, size_t count)
Callback function, begin the processing of the dimension.
Definition: OctreeNodePlyReaderDelegate.cpp:108
bool m_haveSpacing
Definition: OctreeNodePlyReaderDelegate.h:123
virtual void processVoxel(const std::string &elementName)=0
Callback function to process one voxel.
Data structure to receive the dimension information from the file.
Definition: OctreeNodePlyReaderDelegate.h:103
OctreeNodePlyReaderDelegateBase()
Constructor.
Definition: OctreeNodePlyReaderDelegate.cpp:25
int m_numLevels
Calculated number of levels for the octree.
Definition: OctreeNodePlyReaderDelegate.h:119
Data structure to receive the specific voxel information from the file.
Definition: OctreeNodePlyReaderDelegate.h:111
Octree data structure.
Definition: OctreeNode.h:131
PlyReaderDelegate abstract class.
Definition: PlyReaderDelegate.h:31
Data structure to receive the spacing information from the file.
Definition: OctreeNodePlyReaderDelegate.h:95