Main MRPT website > C++ reference for MRPT 1.4.0
OcTree.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef OCTOMAP_OCTREE_H
10 #define OCTOMAP_OCTREE_H
11 
12 // $Id: OcTree.h 391 2012-06-21 10:07:53Z ahornung $
13 
14 /**
15 * OctoMap:
16 * A probabilistic, flexible, and compact 3D mapping library for robotic systems.
17 * @author K. M. Wurm, A. Hornung, University of Freiburg, Copyright (C) 2009.
18 * @see http://octomap.sourceforge.net/
19 * License: New BSD License
20 */
21 
22 /*
23  * Copyright (c) 2009, K. M. Wurm, A. Hornung, University of Freiburg
24  * All rights reserved.
25  *
26  * Redistribution and use in source and binary forms, with or without
27  * modification, are permitted provided that the following conditions are met:
28  *
29  * * Redistributions of source code must retain the above copyright
30  * notice, this list of conditions and the following disclaimer.
31  * * Redistributions in binary form must reproduce the above copyright
32  * notice, this list of conditions and the following disclaimer in the
33  * documentation and/or other materials provided with the distribution.
34  * * Neither the name of the University of Freiburg nor the names of its
35  * contributors may be used to endorse or promote products derived from
36  * this software without specific prior written permission.
37  *
38  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
39  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
41  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
42  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
43  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
44  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
45  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
46  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
47  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
48  * POSSIBILITY OF SUCH DAMAGE.
49  */
50 
51 #include "OccupancyOcTreeBase.h"
52 #include "OcTreeNode.h"
53 #include "ScanGraph.h"
54 #include <mrpt/maps/link_pragmas.h> // For DLL export within mrpt-maps via the MAPS_IMPEXP macro
55 
56 namespace octomap {
57 
58  /**
59  * octomap main map data structure, stores 3D occupancy grid map in an OcTree.
60  * Basic functionality is implemented in OcTreeBase.
61  *
62  */
63  class OcTree : public OccupancyOcTreeBase <OcTreeNode> {
64 
65  public:
66  /// Default constructor, sets resolution of leafs
67  OcTree(double resolution) : OccupancyOcTreeBase<OcTreeNode>(resolution) {};
68 
69  /**
70  * Reads an OcTree from a binary file
71  * @param _filename
72  *
73  */
74  OcTree(std::string _filename);
75 
76  virtual ~OcTree(){};
77 
78  /// virtual constructor: creates a new object of same type
79  /// (Covariant return type requires an up-to-date compiler)
80  OcTree* create() const {return new OcTree(resolution); }
81 
82  std::string getTreeType() const {return "OcTree";}
83 
84 
85  protected:
86  /**
87  * Static member object which ensures that this OcTree's prototype
88  * ends up in the classIDMapping only once
89  */
91  public:
93  OcTree* tree = new OcTree(0.1);
95  }
96  };
97  /// to ensure static initialization (only once)
99  };
100 
101 } // end namespace
102 
103 #endif
Base implementation for Occupancy Octrees (e.g.
OctoMap: A probabilistic, flexible, and compact 3D mapping library for robotic systems.
std::string getTreeType() const
returns actual class name as string for identification
Definition: OcTree.h:82
Static member object which ensures that this OcTree&#39;s prototype ends up in the classIDMapping only on...
Definition: OcTree.h:90
virtual ~OcTree()
Definition: OcTree.h:76
OcTree(double resolution)
Default constructor, sets resolution of leafs.
Definition: OcTree.h:67
OcTree * create() const
virtual constructor: creates a new object of same type (Covariant return type requires an up-to-date ...
Definition: OcTree.h:80
octomap main map data structure, stores 3D occupancy grid map in an OcTree.
Definition: OcTree.h:63
static void registerTreeType(AbstractOcTree *tree)
Nodes to be used in OcTree.
Definition: OcTreeNode.h:67
static StaticMemberInitializer ocTreeMemberInit
to ensure static initialization (only once)
Definition: OcTree.h:98



Page generated by Doxygen 1.8.11 for MRPT 1.4.0 SVN: at Sun Aug 14 23:58:29 UTC 2016