|
Point Cloud Library (PCL)
1.6.0
|
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_laplacian.h 5245 2012-03-22 17:14:26Z rusu $ 00036 * 00037 */ 00038 00039 #ifndef VTK_MESH_SMOOTHING_LAPLACIAN_H_ 00040 #define VTK_MESH_SMOOTHING_LAPLACIAN_H_ 00041 00042 #include <pcl/surface/processing.h> 00043 #include <pcl/surface/vtk_smoothing/vtk.h> 00044 00045 namespace pcl 00046 { 00052 class PCL_EXPORTS MeshSmoothingLaplacianVTK : public MeshProcessing 00053 { 00054 public: 00056 MeshSmoothingLaplacianVTK () 00057 : MeshProcessing () 00058 , vtk_polygons_ () 00059 , num_iter_ (20) 00060 , convergence_ (0.0f) 00061 , relaxation_factor_ (0.01f) 00062 , feature_edge_smoothing_ (false) 00063 , feature_angle_ (45.f) 00064 , edge_angle_ (15.f) 00065 , boundary_smoothing_ (true) 00066 {}; 00067 00071 inline void 00072 setNumIter (int num_iter) 00073 { 00074 num_iter_ = num_iter; 00075 }; 00076 00078 inline int 00079 getNumIter () 00080 { 00081 return num_iter_; 00082 }; 00083 00087 inline void 00088 setConvergence (float convergence) 00089 { 00090 convergence_ = convergence; 00091 }; 00092 00094 inline float 00095 getConvergence () 00096 { 00097 return convergence_; 00098 }; 00099 00106 inline void 00107 setRelaxationFactor (float relaxation_factor) 00108 { 00109 relaxation_factor_ = relaxation_factor; 00110 }; 00111 00113 inline float 00114 getRelaxationFactor () 00115 { 00116 return relaxation_factor_; 00117 }; 00118 00122 inline void 00123 setFeatureEdgeSmoothing (bool feature_edge_smoothing) 00124 { 00125 feature_edge_smoothing_ = feature_edge_smoothing; 00126 }; 00127 00129 inline bool 00130 getFeatureEdgeSmoothing () 00131 { 00132 return feature_edge_smoothing_; 00133 }; 00134 00138 inline void 00139 setFeatureAngle (float feature_angle) 00140 { 00141 feature_angle_ = feature_angle; 00142 }; 00143 00145 inline float 00146 getFeatureAngle () 00147 { 00148 return feature_angle_; 00149 }; 00150 00154 inline void 00155 setEdgeAngle (float edge_angle) 00156 { 00157 edge_angle_ = edge_angle; 00158 }; 00159 00161 inline float 00162 getEdgeAngle () 00163 { 00164 return edge_angle_; 00165 }; 00166 00170 inline void 00171 setBoundarySmoothing (bool boundary_smoothing) 00172 { 00173 boundary_smoothing_ = boundary_smoothing; 00174 }; 00175 00177 inline bool 00178 getBoundarySmoothing () 00179 { 00180 return boundary_smoothing_; 00181 } 00182 00183 protected: 00184 void 00185 performProcessing (pcl::PolygonMesh &output); 00186 00187 private: 00188 vtkSmartPointer<vtkPolyData> vtk_polygons_; 00189 00191 int num_iter_; 00192 float convergence_; 00193 float relaxation_factor_; 00194 bool feature_edge_smoothing_; 00195 float feature_angle_; 00196 float edge_angle_; 00197 bool boundary_smoothing_; 00198 }; 00199 } 00200 #endif /* VTK_MESH_SMOOTHING_LAPLACIAN_H_ */
1.7.6.1