Point Cloud Library (PCL)  1.14.1-dev
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 #pragma once
40 
41 #include <boost/filesystem.hpp>
42 
43 #include <mutex>
44 #include <vector>
45 
46 namespace pcl
47 {
48  namespace outofcore
49  {
50  template<typename PointT>
52  {
53 
54  public:
55  using AlignedPointTVector = std::vector<PointT, Eigen::aligned_allocator<PointT> >;
56 
58  : container_ ()
59  {}
60 
61  OutofcoreAbstractNodeContainer (const boost::filesystem::path&) {}
62 
63  virtual
65 
66  virtual void
67  insertRange (const PointT* start, const std::uint64_t count)=0;
68 
69  virtual void
70  insertRange (const PointT* const* start, const std::uint64_t count)=0;
71 
72  virtual void
73  readRange (const std::uint64_t start, const std::uint64_t count, AlignedPointTVector& v)=0;
74 
75  virtual void
76  readRangeSubSample (const std::uint64_t start, const std::uint64_t count, const double percent, AlignedPointTVector& v) =0;
77 
78  virtual bool
79  empty () const=0;
80 
81  virtual std::uint64_t
82  size () const =0;
83 
84  virtual void
85  clear ()=0;
86 
87  virtual void
88  convertToXYZ (const boost::filesystem::path& path)=0;
89 
90  virtual PointT
91  operator[] (std::uint64_t idx) const=0;
92 
93  protected:
95 
97 
98  static std::mutex rng_mutex_;
99  };
100  }//namespace outofcore
101 }//namespace pcl
virtual void insertRange(const PointT *start, const std::uint64_t count)=0
virtual void convertToXYZ(const boost::filesystem::path &path)=0
virtual void readRange(const std::uint64_t start, const std::uint64_t count, AlignedPointTVector &v)=0
virtual void readRangeSubSample(const std::uint64_t start, const std::uint64_t count, const double percent, AlignedPointTVector &v)=0
OutofcoreAbstractNodeContainer(const OutofcoreAbstractNodeContainer &rval)
virtual std::uint64_t size() const =0
virtual void insertRange(const PointT *const *start, const std::uint64_t count)=0
std::vector< PointT, Eigen::aligned_allocator< PointT > > AlignedPointTVector
virtual PointT operator[](std::uint64_t idx) const =0
A point structure representing Euclidean xyz coordinates, and the RGB color.