Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
outofcore
outofcore_iterator_base.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2010-2012, Willow Garage, Inc.
6
*
7
* All rights reserved.
8
*
9
* Redistribution and use in source and binary forms, with or without
10
* modification, are permitted provided that the following conditions
11
* are met:
12
*
13
* * Redistributions of source code must retain the above copyright
14
* notice, this list of conditions and the following disclaimer.
15
* * Redistributions in binary form must reproduce the above
16
* copyright notice, this list of conditions and the following
17
* disclaimer in the documentation and/or other materials provided
18
* with the distribution.
19
* * Neither the name of Willow Garage, Inc. nor the names of its
20
* contributors may be used to endorse or promote products derived
21
* from this software without specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
* POSSIBILITY OF SUCH DAMAGE.
35
*
36
* $Id$
37
*/
38
39
#pragma once
40
41
#include <iterator>
42
43
#include <
pcl/point_types.h
>
44
45
#include <pcl/outofcore/octree_base.h>
46
#include <pcl/outofcore/octree_base_node.h>
47
#include <pcl/outofcore/octree_disk_container.h>
48
49
namespace
pcl
50
{
51
namespace
outofcore
52
{
53
/** \brief Abstract octree iterator class
54
* \note This class is based on the octree_iterator written by Julius Kammerl adapted to the outofcore octree. The interface is very similar, but it does \b not inherit the \ref pcl::octree iterator base.
55
* \ingroup outofcore
56
* \author Stephen Fox (foxstephend@gmail.com)
57
*/
58
template
<
typename
Po
int
T,
typename
ContainerT>
59
class
OutofcoreIteratorBase
60
{
61
public
:
62
using
iterator_category
= std::forward_iterator_tag;
63
using
value_type
=
const
OutofcoreOctreeBaseNode<ContainerT, PointT>
;
64
using
difference_type
= void;
65
using
pointer
=
const
OutofcoreOctreeBaseNode<ContainerT, PointT>
*;
66
using
reference
=
const
OutofcoreOctreeBaseNode<ContainerT, PointT>
&;
67
68
using
OctreeDisk
=
pcl::outofcore::OutofcoreOctreeBase<ContainerT, PointT>
;
69
using
OctreeDiskNode
=
pcl::outofcore::OutofcoreOctreeBaseNode<ContainerT, PointT>
;
70
71
using
BranchNode
=
typename
pcl::outofcore::OutofcoreOctreeBase<ContainerT, PointT>::BranchNode
;
72
using
LeafNode
=
typename
pcl::outofcore::OutofcoreOctreeBase<ContainerT, PointT>::LeafNode
;
73
74
using
OutofcoreNodeType
=
typename
OctreeDisk::OutofcoreNodeType
;
75
76
explicit
77
OutofcoreIteratorBase
(
OctreeDisk
& octree_arg)
78
:
octree_
(octree_arg),
currentNode_
(nullptr)
79
{
80
reset
();
81
}
82
83
virtual
84
~OutofcoreIteratorBase
() =
default
;
85
86
OutofcoreIteratorBase
(
const
OutofcoreIteratorBase
& src)
87
:
octree_
(src.
octree_
),
currentNode_
(src.
currentNode_
)
88
{
89
}
90
91
inline
OutofcoreIteratorBase
&
92
operator =
(
const
OutofcoreIteratorBase
& src)
93
{
94
octree_
= src.
octree_
;
95
currentNode_
= src.
currentNode_
;
96
currentOctreeDepth_
= src.
currentOctreeDepth_
;
97
}
98
99
100
inline
OutofcoreNodeType
*
101
operator*
()
const
102
{
103
return
(this->
getCurrentOctreeNode
());
104
}
105
106
virtual
inline
OutofcoreNodeType
*
107
getCurrentOctreeNode
()
const
108
{
109
return
(
currentNode_
);
110
}
111
112
virtual
inline
void
113
reset
()
114
{
115
currentNode_
=
static_cast<
OctreeDiskNode
*
>
(
octree_
.getRootNode ());
116
currentOctreeDepth_
= 0;
117
max_depth_
=
static_cast<
unsigned
int
>
(
octree_
.getDepth ());
118
}
119
120
inline
void
121
setMaxDepth
(
unsigned
int
max_depth)
122
{
123
if
(max_depth >
static_cast<
unsigned
int
>
(
octree_
.getDepth ()))
124
{
125
max_depth =
static_cast<
unsigned
int
>
(
octree_
.getDepth ());
126
}
127
128
max_depth_
= max_depth;
129
}
130
131
protected
:
132
OctreeDisk
&
octree_
;
133
OctreeDiskNode
*
currentNode_
;
134
unsigned
int
currentOctreeDepth_
;
135
unsigned
int
max_depth_
;
136
};
137
138
139
#if 0
140
class
PCL_EXPORTS
OutofcoreBreadthFirstIterator
:
public
OutofcoreIteratorBase
141
{
142
143
144
145
146
};
147
148
class
PCL_EXPORTS OutofcoreLeafIterator :
public
OutofcoreIteratorBase
149
{
150
151
152
153
};
154
#endif
155
}
156
}
pcl::outofcore::OutofcoreBreadthFirstIterator
Definition
outofcore_breadth_first_iterator.h:58
pcl::outofcore::OutofcoreIteratorBase
Abstract octree iterator class.
Definition
outofcore_iterator_base.h:60
pcl::outofcore::OutofcoreIteratorBase::value_type
const OutofcoreOctreeBaseNode< ContainerT, PointT > value_type
Definition
outofcore_iterator_base.h:63
pcl::outofcore::OutofcoreIteratorBase::pointer
const OutofcoreOctreeBaseNode< ContainerT, PointT > * pointer
Definition
outofcore_iterator_base.h:65
pcl::outofcore::OutofcoreIteratorBase::BranchNode
typename pcl::outofcore::OutofcoreOctreeBase< ContainerT, PointT >::BranchNode BranchNode
Definition
outofcore_iterator_base.h:71
pcl::outofcore::OutofcoreIteratorBase::OutofcoreNodeType
typename OctreeDisk::OutofcoreNodeType OutofcoreNodeType
Definition
outofcore_iterator_base.h:74
pcl::outofcore::OutofcoreIteratorBase::max_depth_
unsigned int max_depth_
Definition
outofcore_iterator_base.h:135
pcl::outofcore::OutofcoreIteratorBase::currentNode_
OctreeDiskNode * currentNode_
Definition
outofcore_iterator_base.h:133
pcl::outofcore::OutofcoreIteratorBase::operator=
OutofcoreIteratorBase & operator=(const OutofcoreIteratorBase &src)
Definition
outofcore_iterator_base.h:92
pcl::outofcore::OutofcoreIteratorBase::OctreeDisk
pcl::outofcore::OutofcoreOctreeBase< ContainerT, PointT > OctreeDisk
Definition
outofcore_iterator_base.h:68
pcl::outofcore::OutofcoreIteratorBase::getCurrentOctreeNode
virtual OutofcoreNodeType * getCurrentOctreeNode() const
Definition
outofcore_iterator_base.h:107
pcl::outofcore::OutofcoreIteratorBase::LeafNode
typename pcl::outofcore::OutofcoreOctreeBase< ContainerT, PointT >::LeafNode LeafNode
Definition
outofcore_iterator_base.h:72
pcl::outofcore::OutofcoreIteratorBase::reference
const OutofcoreOctreeBaseNode< ContainerT, PointT > & reference
Definition
outofcore_iterator_base.h:66
pcl::outofcore::OutofcoreIteratorBase::OctreeDiskNode
pcl::outofcore::OutofcoreOctreeBaseNode< ContainerT, PointT > OctreeDiskNode
Definition
outofcore_iterator_base.h:69
pcl::outofcore::OutofcoreIteratorBase::~OutofcoreIteratorBase
virtual ~OutofcoreIteratorBase()=default
pcl::outofcore::OutofcoreIteratorBase::difference_type
void difference_type
Definition
outofcore_iterator_base.h:64
pcl::outofcore::OutofcoreIteratorBase::setMaxDepth
void setMaxDepth(unsigned int max_depth)
Definition
outofcore_iterator_base.h:121
pcl::outofcore::OutofcoreIteratorBase::operator*
OutofcoreNodeType * operator*() const
Definition
outofcore_iterator_base.h:101
pcl::outofcore::OutofcoreIteratorBase::iterator_category
std::forward_iterator_tag iterator_category
Definition
outofcore_iterator_base.h:62
pcl::outofcore::OutofcoreIteratorBase::OutofcoreIteratorBase
OutofcoreIteratorBase(const OutofcoreIteratorBase &src)
Definition
outofcore_iterator_base.h:86
pcl::outofcore::OutofcoreIteratorBase::octree_
OctreeDisk & octree_
Definition
outofcore_iterator_base.h:132
pcl::outofcore::OutofcoreIteratorBase::currentOctreeDepth_
unsigned int currentOctreeDepth_
Definition
outofcore_iterator_base.h:134
pcl::outofcore::OutofcoreIteratorBase::OutofcoreIteratorBase
OutofcoreIteratorBase(OctreeDisk &octree_arg)
Definition
outofcore_iterator_base.h:77
pcl::outofcore::OutofcoreIteratorBase::reset
virtual void reset()
Definition
outofcore_iterator_base.h:113
pcl::outofcore::OutofcoreOctreeBase
This code defines the octree used for point storage at Urban Robotics.
Definition
octree_base.h:151
pcl::outofcore::OutofcoreOctreeBase::BranchNode
OutofcoreOctreeBaseNode< ContainerT, PointT > BranchNode
Definition
octree_base.h:166
pcl::outofcore::OutofcoreOctreeBase< ContainerT, PointT >::OutofcoreNodeType
OutofcoreOctreeBaseNode< ContainerT, PointT > OutofcoreNodeType
Definition
octree_base.h:164
pcl::outofcore::OutofcoreOctreeBase::LeafNode
OutofcoreOctreeBaseNode< ContainerT, PointT > LeafNode
Definition
octree_base.h:167
pcl::outofcore::OutofcoreOctreeBaseNode
OutofcoreOctreeBaseNode Class internally representing nodes of an outofcore octree,...
Definition
octree_base_node.h:96
point_types.h
Defines all the PCL implemented PointT point type structures.
pcl::outofcore
Definition
octree_base.hpp:67
pcl
Definition
convolution.h:46