OcTreeDataNode.h
Go to the documentation of this file.
1 /*
2  * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees
3  * http://octomap.github.com/
4  *
5  * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg
6  * All rights reserved.
7  * License: New BSD
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  * * Neither the name of the University of Freiburg nor the names of its
18  * contributors may be used to endorse or promote products derived from
19  * this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef OCTOMAP_OCTREE_DATA_NODE_H
35 #define OCTOMAP_OCTREE_DATA_NODE_H
36 
37 
38 #include "octomap_types.h"
39 #include "assert.h"
40 #include <bitset>
41 
42 namespace octomap {
43 
45 
46 
47  };
48 
61  template<typename T> class OcTreeDataNode: public AbstractOcTreeNode {
62 
63  public:
64 
66  OcTreeDataNode(T initVal);
68  OcTreeDataNode(const OcTreeDataNode& rhs);
69 
70  ~OcTreeDataNode();
71 
73  bool operator==(const OcTreeDataNode& rhs) const;
74 
75 
76  // -- children ----------------------------------
77 
78 
80  bool createChild(unsigned int i);
81 
85  bool childExists(unsigned int i) const;
86 
88  OcTreeDataNode<T>* getChild(unsigned int i);
89 
91  const OcTreeDataNode<T>* getChild(unsigned int i) const;
92 
94  bool hasChildren() const;
95 
98  bool collapsible() const;
99 
101  void deleteChild(unsigned int i);
102 
103  // -- pruning of children -----------------------
104 
105 
110  bool pruneNode();
111 
120  void expandNode();
121 
123  T getValue() const{return value;};
125  void setValue(T v) {value = v;};
126 
127  // file IO:
128 
136  std::istream& readValue(std::istream &s);
137 
146  std::ostream& writeValue(std::ostream &s) const;
147 
148 
150  typedef T DataType;
151 
152 
153  protected:
154  void allocChildren();
155 
159  T value;
160 
161  };
162 
163 
164 } // end namespace
165 
166 #include "octomap/OcTreeDataNode.hxx"
167 
168 #endif
T value
stored data (payload)
void setValue(T v)
sets value to be stored in the node
T DataType
Make the templated data type available from the outside.
OcTreeDataNode< T > ** children
pointer to array of children, may be NULL


octomap
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Mon Jun 10 2019 14:00:13