Point Cloud Library (PCL)  1.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
vtk_mesh_smoothing_windowed_sinc.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Point Cloud Library (PCL) - www.pointclouds.org
00005  *  Copyright (c) 2011, Willow Garage, Inc.
00006  *  All rights reserved.
00007  *
00008  *  Redistribution and use in source and binary forms, with or without
00009  *  modification, are permitted provided that the following conditions
00010  *  are met:
00011  *
00012  *   * Redistributions of source code must retain the above copyright
00013  *     notice, this list of conditions and the following disclaimer.
00014  *   * Redistributions in binary form must reproduce the above
00015  *     copyright notice, this list of conditions and the following
00016  *     disclaimer in the documentation and/or other materials provided
00017  *     with the distribution.
00018  *   * Neither the name of Willow Garage, Inc. nor the names of its
00019  *     contributors may be used to endorse or promote products derived
00020  *     from this software without specific prior written permission.
00021  *
00022  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00026  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00029  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00032  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00033  *  POSSIBILITY OF SUCH DAMAGE.
00034  *
00035  * $Id: vtk_mesh_smoothing_windowed_sinc.h 3739 2011-12-31 09:52:02Z aichim $
00036  *
00037  */
00038 
00039 #ifndef VTK_MESH_SMOOTHING_WINDOWED_SINC_H_
00040 #define VTK_MESH_SMOOTHING_WINDOWED_SINC_H_
00041 
00042 #include <pcl/surface/processing.h>
00043 #include <vtkPolyData.h>
00044 #include <vtkSmartPointer.h>
00045 
00046 
00047 namespace pcl
00048 {
00054   class PCL_EXPORTS MeshSmoothingWindowedSincVTK : public MeshProcessing
00055   {
00056     public:
00058       MeshSmoothingWindowedSincVTK ()
00059         : MeshProcessing (),
00060           num_iter_ (20),
00061           pass_band_ (0.1f),
00062           feature_edge_smoothing_ (false),
00063           feature_angle_ (45.f),
00064           edge_angle_ (15.f),
00065           boundary_smoothing_ (true),
00066           normalize_coordinates_ (false)
00067       {};
00068 
00069 
00070 
00074       inline void
00075       setNumIter (int num_iter)
00076       {
00077         num_iter_ = num_iter;
00078       };
00079 
00081       inline int
00082       getNumIter ()
00083       {
00084         return num_iter_;
00085       };
00086 
00090       inline void
00091       setPassBand (float pass_band)
00092       {
00093         pass_band_ = pass_band;
00094       };
00095 
00097       inline float
00098       getPassBand ()
00099       {
00100         return pass_band_;
00101       };
00102 
00109       inline void
00110       setNormalizeCoordinates (bool normalize_coordinates)
00111       {
00112         normalize_coordinates_ = normalize_coordinates;
00113       }
00114 
00116       inline bool
00117       getNormalizeCoordinates ()
00118       {
00119         return normalize_coordinates_;
00120       }
00121 
00125       inline void
00126       setFeatureEdgeSmoothing (bool feature_edge_smoothing)
00127       {
00128         feature_edge_smoothing_ = feature_edge_smoothing;
00129       };
00130 
00132       inline bool
00133       getFeatureEdgeSmoothing ()
00134       {
00135         return feature_edge_smoothing_;
00136       };
00137 
00141       inline void
00142       setFeatureAngle (float feature_angle)
00143       {
00144         feature_angle_ = feature_angle;
00145       };
00146 
00148       inline float
00149       getFeatureAngle ()
00150       {
00151         return feature_angle_;
00152       };
00153 
00157       inline void
00158       setEdgeAngle (float edge_angle)
00159       {
00160         edge_angle_ = edge_angle;
00161       };
00162 
00164       inline float
00165       getEdgeAngle ()
00166       {
00167         return edge_angle_;
00168       };
00169 
00170 
00174       inline void
00175       setBoundarySmoothing (bool boundary_smoothing)
00176       {
00177         boundary_smoothing_ = boundary_smoothing;
00178       };
00179 
00181       inline bool
00182       getBoundarySmoothing ()
00183       {
00184         return boundary_smoothing_;
00185       }
00186 
00187 
00188     protected:
00189       void
00190       performProcessing (pcl::PolygonMesh &output);
00191 
00192     private:
00193       vtkSmartPointer<vtkPolyData> vtk_polygons_;
00194       int num_iter_;
00195       float pass_band_;
00196       bool feature_edge_smoothing_;
00197       float feature_angle_;
00198       float edge_angle_;
00199       bool boundary_smoothing_;
00200       bool normalize_coordinates_;
00201   };
00202 }
00203 #endif /* VTK_MESH_SMOOTHING_WINDOWED_SINC_H_ */