Point Cloud Library (PCL)  1.12.0-dev
processing.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, 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$
37  *
38  */
39 
40 #pragma once
41 
42 #include <pcl/pcl_base.h>
43 #include <pcl/PolygonMesh.h>
44 
45 namespace pcl
46 {
47  template <typename PointT> class PointCloud;
48 
49  /** \brief @b CloudSurfaceProcessing represents the base class for algorithms that takes a point cloud as input and
50  * produces a new output cloud that has been modified towards a better surface representation. These types of
51  * algorithms include surface smoothing, hole filling, cloud upsampling etc.
52  *
53  * \author Alexandru E. Ichim
54  * \ingroup surface
55  */
56  template <typename PointInT, typename PointOutT>
57  class CloudSurfaceProcessing : public PCLBase<PointInT>
58  {
59  public:
60  typedef shared_ptr<CloudSurfaceProcessing<PointInT, PointOutT> > Ptr;
61  typedef shared_ptr<const CloudSurfaceProcessing<PointInT, PointOutT> > ConstPtr;
62 
67 
68  public:
69  /** \brief Constructor. */
70  CloudSurfaceProcessing () : PCLBase<PointInT> ()
71  {};
72 
73  /** \brief Empty destructor */
75 
76  /** \brief Process the input cloud and store the results
77  * \param[out] output the cloud where the results will be stored
78  */
79  virtual void
81 
82  protected:
83  /** \brief Abstract cloud processing method */
84  virtual void
86 
87  };
88 
89 
90  /** \brief @b MeshProcessing represents the base class for mesh processing algorithms.
91  * \author Alexandru E. Ichim
92  * \ingroup surface
93  */
95  {
96  public:
97  using Ptr = shared_ptr<MeshProcessing>;
98  using ConstPtr = shared_ptr<const MeshProcessing>;
99 
101 
102  /** \brief Constructor. */
104 
105  /** \brief Destructor. */
106  virtual ~MeshProcessing () {}
107 
108  /** \brief Set the input mesh that we want to process
109  * \param[in] input the input polygonal mesh
110  */
111  inline void
113  { input_mesh_ = input; }
114 
115  /** \brief Get the input mesh to be processed
116  * \returns the mesh
117  */
119  getInputMesh () const
120  { return input_mesh_; }
121 
122  /** \brief Process the input surface mesh and store the results
123  * \param[out] output the resultant processed surface model
124  */
125  void
126  process (pcl::PolygonMesh &output);
127 
128  protected:
129  /** \brief Initialize computation. Must be called before processing starts. */
130  virtual bool
131  initCompute ();
132 
133  /** \brief UnInitialize computation. Must be called after processing ends. */
134  virtual void
135  deinitCompute ();
136 
137  /** \brief Abstract surface processing method. */
138  virtual void
139  performProcessing (pcl::PolygonMesh &output) = 0;
140 
141  /** \brief Abstract class get name method. */
142  virtual std::string
143  getClassName () const
144  { return (""); }
145 
146  /** \brief Input polygonal mesh. */
148  };
149 }
150 
151 #include "pcl/surface/impl/processing.hpp"
pcl
Definition: convolution.h:46
pcl::CloudSurfaceProcessing::Ptr
shared_ptr< CloudSurfaceProcessing< PointInT, PointOutT > > Ptr
Definition: processing.h:60
pcl::MeshProcessing::MeshProcessing
MeshProcessing()
Constructor.
Definition: processing.h:103
pcl::MeshProcessing::ConstPtr
shared_ptr< const MeshProcessing > ConstPtr
Definition: processing.h:98
pcl::PolygonMesh::ConstPtr
shared_ptr< const ::pcl::PolygonMesh > ConstPtr
Definition: PolygonMesh.h:98
pcl::CloudSurfaceProcessing::CloudSurfaceProcessing
CloudSurfaceProcessing()
Constructor.
Definition: processing.h:70
pcl::CloudSurfaceProcessing::process
virtual void process(pcl::PointCloud< PointOutT > &output)
Process the input cloud and store the results.
Definition: processing.hpp:47
pcl::MeshProcessing::setInputMesh
void setInputMesh(const pcl::PolygonMeshConstPtr &input)
Set the input mesh that we want to process.
Definition: processing.h:112
pcl::PCLBase
PCL base class.
Definition: pcl_base.h:69
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: distances.h:55
pcl::MeshProcessing::PolygonMeshConstPtr
PolygonMesh::ConstPtr PolygonMeshConstPtr
Definition: processing.h:100
pcl::MeshProcessing::getInputMesh
pcl::PolygonMeshConstPtr getInputMesh() const
Get the input mesh to be processed.
Definition: processing.h:119
pcl::MeshProcessing::getClassName
virtual std::string getClassName() const
Abstract class get name method.
Definition: processing.h:143
pcl::CloudSurfaceProcessing::performProcessing
virtual void performProcessing(pcl::PointCloud< PointOutT > &output)=0
Abstract cloud processing method.
pcl::PolygonMeshConstPtr
PolygonMesh::ConstPtr PolygonMeshConstPtr
Definition: PolygonMesh.h:102
pcl::PolygonMesh
Definition: PolygonMesh.h:14
pcl::CloudSurfaceProcessing::ConstPtr
shared_ptr< const CloudSurfaceProcessing< PointInT, PointOutT > > ConstPtr
Definition: processing.h:61
pcl::CloudSurfaceProcessing
CloudSurfaceProcessing represents the base class for algorithms that takes a point cloud as input and...
Definition: processing.h:57
pcl::MeshProcessing::input_mesh_
pcl::PolygonMeshConstPtr input_mesh_
Input polygonal mesh.
Definition: processing.h:147
pcl::MeshProcessing::Ptr
shared_ptr< MeshProcessing > Ptr
Definition: processing.h:97
pcl::MeshProcessing::~MeshProcessing
virtual ~MeshProcessing()
Destructor.
Definition: processing.h:106
pcl::MeshProcessing
MeshProcessing represents the base class for mesh processing algorithms.
Definition: processing.h:94
PCL_EXPORTS
#define PCL_EXPORTS
Definition: pcl_macros.h:323
pcl::CloudSurfaceProcessing::~CloudSurfaceProcessing
~CloudSurfaceProcessing()
Empty destructor.
Definition: processing.h:74