Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef PCL_OUTOFCORE_ITERATOR_BASE_H_
00040 #define PCL_OUTOFCORE_ITERATOR_BASE_H_
00041
00042 #include <iterator>
00043
00044 #include <pcl/point_types.h>
00045
00046 #include <pcl/outofcore/octree_base.h>
00047 #include <pcl/outofcore/octree_base_node.h>
00048 #include <pcl/outofcore/octree_disk_container.h>
00049
00050 namespace pcl
00051 {
00052 namespace outofcore
00053 {
00059 template<typename PointT, typename ContainerT>
00060 class OutofcoreIteratorBase : public std::iterator<std::forward_iterator_tag,
00061 const OutofcoreOctreeBaseNode<ContainerT, PointT>,
00062 void,
00063 const OutofcoreOctreeBaseNode<ContainerT, PointT>*,
00064 const OutofcoreOctreeBaseNode<ContainerT, PointT>&>
00065 {
00066 public:
00067 typedef typename pcl::outofcore::OutofcoreOctreeBase<ContainerT, PointT> OctreeDisk;
00068 typedef typename pcl::outofcore::OutofcoreOctreeBaseNode<ContainerT, PointT> OctreeDiskNode;
00069
00070 typedef typename pcl::outofcore::OutofcoreOctreeBase<ContainerT, PointT>::BranchNode BranchNode;
00071 typedef typename pcl::outofcore::OutofcoreOctreeBase<ContainerT, PointT>::LeafNode LeafNode;
00072
00073 typedef typename OctreeDisk::OutofcoreNodeType OutofcoreNodeType;
00074
00075 explicit
00076 OutofcoreIteratorBase (OctreeDisk& octree_arg)
00077 : octree_ (octree_arg), currentNode_ (NULL)
00078 {
00079 reset ();
00080 }
00081
00082 virtual
00083 ~OutofcoreIteratorBase ()
00084 {
00085 }
00086
00087 OutofcoreIteratorBase (const OutofcoreIteratorBase& src)
00088 : octree_ (src.octree_), currentNode_ (src.currentNode_)
00089 {
00090 }
00091
00092 inline OutofcoreIteratorBase&
00093 operator = (const OutofcoreIteratorBase& src)
00094 {
00095 octree_ = src.octree_;
00096 currentNode_ = src.currentNode_;
00097 currentOctreeDepth_ = src.currentOctreeDepth_;
00098 }
00099
00100
00101 inline OutofcoreNodeType*
00102 operator* () const
00103 {
00104 return (this->getCurrentOctreeNode ());
00105 }
00106
00107 virtual inline OutofcoreNodeType*
00108 getCurrentOctreeNode () const
00109 {
00110 return (currentNode_);
00111 }
00112
00113 virtual inline void
00114 reset ()
00115 {
00116 currentNode_ = static_cast<OctreeDiskNode*> (octree_.getRootNode ());
00117 currentOctreeDepth_ = 0;
00118 max_depth_ = static_cast<unsigned int> (octree_.getDepth ());
00119 }
00120
00121 inline void
00122 setMaxDepth (unsigned int max_depth)
00123 {
00124 if (max_depth > static_cast<unsigned int> (octree_.getDepth ()))
00125 {
00126 max_depth = static_cast<unsigned int> (octree_.getDepth ());
00127 }
00128
00129 max_depth_ = max_depth;
00130 }
00131
00132 protected:
00133 OctreeDisk& octree_;
00134 OctreeDiskNode* currentNode_;
00135 unsigned int currentOctreeDepth_;
00136 unsigned int max_depth_;
00137 };
00138
00139
00140 #if 0
00141 class PCL_EXPORTS OutofcoreBreadthFirstIterator : public OutofcoreIteratorBase
00142 {
00143
00144
00145
00146
00147 };
00148
00149 class PCL_EXPORTS OutofcoreLeafIterator : public OutofcoreIteratorBase
00150 {
00151
00152
00153
00154 };
00155 #endif
00156 }
00157 }
00158
00159 #endif //PCL_OUTOFCORE_ITERATOR_BASE_H_