Point Cloud Library (PCL)  1.14.1-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  using Ptr = shared_ptr<CloudSurfaceProcessing<PointInT, PointOutT> >;
61  using ConstPtr = shared_ptr<const CloudSurfaceProcessing<PointInT, PointOutT> >;
62 
67 
68  public:
69  /** \brief Constructor. */
70  CloudSurfaceProcessing () : PCLBase<PointInT> ()
71  {};
72 
73  /** \brief Empty destructor */
74  ~CloudSurfaceProcessing () override = default;
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. */
103  MeshProcessing () = default;
104 
105  /** \brief Destructor. */
106  virtual ~MeshProcessing () = default;
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
127 
128  protected:
129  /** \brief Initialize computation. Must be called before processing starts. */
130  virtual bool
132 
133  /** \brief UnInitialize computation. Must be called after processing ends. */
134  virtual void
136 
137  /** \brief Abstract surface processing method. */
138  virtual void
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"
CloudSurfaceProcessing represents the base class for algorithms that takes a point cloud as input and...
Definition: processing.h:58
~CloudSurfaceProcessing() override=default
Empty destructor.
virtual void performProcessing(pcl::PointCloud< PointOutT > &output)=0
Abstract cloud processing method.
shared_ptr< const CloudSurfaceProcessing< PointInT, PointOutT > > ConstPtr
Definition: processing.h:61
shared_ptr< CloudSurfaceProcessing< PointInT, PointOutT > > Ptr
Definition: processing.h:60
virtual void process(pcl::PointCloud< PointOutT > &output)
Process the input cloud and store the results.
Definition: processing.hpp:47
CloudSurfaceProcessing()
Constructor.
Definition: processing.h:70
MeshProcessing represents the base class for mesh processing algorithms.
Definition: processing.h:95
virtual bool initCompute()
Initialize computation.
virtual void performProcessing(pcl::PolygonMesh &output)=0
Abstract surface processing method.
virtual ~MeshProcessing()=default
Destructor.
MeshProcessing()=default
Constructor.
virtual std::string getClassName() const
Abstract class get name method.
Definition: processing.h:143
void setInputMesh(const pcl::PolygonMeshConstPtr &input)
Set the input mesh that we want to process.
Definition: processing.h:112
void process(pcl::PolygonMesh &output)
Process the input surface mesh and store the results.
pcl::PolygonMeshConstPtr input_mesh_
Input polygonal mesh.
Definition: processing.h:147
shared_ptr< const MeshProcessing > ConstPtr
Definition: processing.h:98
PolygonMesh::ConstPtr PolygonMeshConstPtr
Definition: processing.h:100
shared_ptr< MeshProcessing > Ptr
Definition: processing.h:97
virtual void deinitCompute()
UnInitialize computation.
pcl::PolygonMeshConstPtr getInputMesh() const
Get the input mesh to be processed.
Definition: processing.h:119
PCL base class.
Definition: pcl_base.h:70
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173
PolygonMesh::ConstPtr PolygonMeshConstPtr
Definition: PolygonMesh.h:101
#define PCL_EXPORTS
Definition: pcl_macros.h:323
shared_ptr< const ::pcl::PolygonMesh > ConstPtr
Definition: PolygonMesh.h:97