Point Cloud Library (PCL)  1.7.1
octree_abstract_node_container.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: octree_abstract_node_container.h 6802M 2012-08-25 00:11:05Z (local) $
37  */
38 
39 #ifndef PCL_OUTOFCORE_OCTREE_ABSTRACT_NODE_CONTAINER_H_
40 #define PCL_OUTOFCORE_OCTREE_ABSTRACT_NODE_CONTAINER_H_
41 
42 #include <vector>
43 #include <string>
44 
45 #include <pcl/outofcore/boost.h>
46 
47 namespace pcl
48 {
49  namespace outofcore
50  {
51  template<typename PointT>
53  {
54 
55  public:
56  typedef std::vector<PointT, Eigen::aligned_allocator<PointT> > AlignedPointTVector;
57 
59  : container_ ()
60  {}
61 
62  OutofcoreAbstractNodeContainer (const boost::filesystem::path&) {}
63 
64  virtual
66 
67  virtual void
68  insertRange (const PointT* start, const uint64_t count)=0;
69 
70  virtual void
71  insertRange (const PointT* const* start, const uint64_t count)=0;
72 
73  virtual void
74  readRange (const uint64_t start, const uint64_t count, AlignedPointTVector& v)=0;
75 
76  virtual void
77  readRangeSubSample (const uint64_t start, const uint64_t count, const double percent, AlignedPointTVector& v) =0;
78 
79  virtual bool
80  empty () const=0;
81 
82  virtual uint64_t
83  size () const =0;
84 
85  virtual void
86  clear ()=0;
87 
88  virtual void
89  convertToXYZ (const boost::filesystem::path& path)=0;
90 
91  virtual PointT
92  operator[] (uint64_t idx) const=0;
93 
94  protected:
96 
98 
99  static boost::mutex rng_mutex_;
100  static boost::mt19937 rand_gen_;
101  };
102  }//namespace outofcore
103 }//namespace pcl
104 
105 #endif //PCL_OUTOFCORE_OCTREE_ABSTRACT_CONTAINER_H_