Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
poisson.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $Id: poisson.h 5036 2012-03-12 08:54:15Z rusu $
35  *
36  */
37 
38 #ifndef PCL_SURFACE_POISSON_H_
39 #define PCL_SURFACE_POISSON_H_
40 
42 #include <pcl/surface/poisson/geometry.h>
43 
44 namespace pcl
45 {
54  template<typename PointNT>
55  class Poisson : public SurfaceReconstruction<PointNT>
56  {
57  public:
60 
62 
63  typedef typename pcl::KdTree<PointNT> KdTree;
65 
67  Poisson ();
68 
70  ~Poisson ();
71 
75  void
77 
82  void
84  std::vector<pcl::Vertices> &polygons);
85 
91  inline void
92  setConfidence (bool confidence) { confidence_ = confidence; }
93 
95  inline bool
96  getConfidence () { return confidence_; }
97 
103  inline void
104  setManifold (bool manifold) { manifold_ = manifold; }
105 
107  inline bool
108  getManifold () { return manifold_; }
109 
114  inline void
115  setOutputPolygons (bool output_polygons) { output_polygons_ = output_polygons; }
116 
118  inline bool
119  getOutputPolygons () { return output_polygons_; }
120 
121 
128  inline void
129  setDepth (int depth) { depth_ = depth; }
130 
132  inline int
133  getDepth () { return depth_; }
134 
141  inline void
142  setSolverDivide (int solver_divide) { solver_divide_ = solver_divide; }
143 
145  inline int
146  getSolverDivide () { return solver_divide_; }
147 
154  inline void
155  setIsoDivide (int iso_divide) { iso_divide_ = iso_divide; }
156 
158  inline int
159  getIsoDivide () { return iso_divide_; }
160 
167  inline void
168  setSamplesPerNode (float samples_per_node) { samples_per_node_ = samples_per_node; }
169 
173  inline float
174  getSamplesPerNode () { return samples_per_node_; }
175 
180  inline void
181  setScale (float scale) { scale_ = scale; }
182 
186  inline float
187  getScale () { return scale_; }
188 
192  inline void
193  setDegree (int degree) { degree_ = degree; }
194 
196  inline int
197  getDegree () { return degree_; }
198 
199 
200  protected:
202  PointCloudPtr data_;
203 
205  std::string
206  getClassName () const { return ("Poisson"); }
207 
208  private:
209  bool no_reset_samples_;
210  bool no_clip_tree_;
211  bool confidence_;
212  bool manifold_;
213  bool output_polygons_;
214 
215  int depth_;
216  int solver_divide_;
217  int iso_divide_;
218  int refine_;
219  int kernel_depth_;
220  int degree_;
221 
222  float samples_per_node_;
223  float scale_;
224 
225  template<int Degree> void
226  execute (poisson::CoredMeshData &mesh,
227  poisson::Point3D<float> &translate,
228  float &scale);
229 
230  public:
231  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
232  };
233 }
234 
235 #endif // PCL_SURFACE_POISSON_H_