|
Point Cloud Library (PCL)
1.4.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 3739 2011-12-31 09:52:02Z aichim $ 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 <vtkPolyData.h> 00044 #include <vtkSmartPointer.h> 00045 00046 00047 namespace pcl 00048 { 00054 class PCL_EXPORTS MeshSmoothingLaplacianVTK : public MeshProcessing 00055 { 00056 public: 00058 MeshSmoothingLaplacianVTK () 00059 : MeshProcessing (), 00060 num_iter_ (20), 00061 convergence_ (0.0f), 00062 relaxation_factor_ (0.01f), 00063 feature_edge_smoothing_ (false), 00064 feature_angle_ (45.f), 00065 edge_angle_ (15.f), 00066 boundary_smoothing_ (true) 00067 {}; 00068 00072 inline void 00073 setNumIter (int num_iter) 00074 { 00075 num_iter_ = num_iter; 00076 }; 00077 00079 inline int 00080 getNumIter () 00081 { 00082 return num_iter_; 00083 }; 00084 00088 inline void 00089 setConvergence (float convergence) 00090 { 00091 convergence_ = convergence; 00092 }; 00093 00095 inline float 00096 getConvergence () 00097 { 00098 return convergence_; 00099 }; 00100 00107 inline void 00108 setRelaxationFactor (float relaxation_factor) 00109 { 00110 relaxation_factor_ = relaxation_factor; 00111 }; 00112 00114 inline float 00115 getRelaxationFactor () 00116 { 00117 return relaxation_factor_; 00118 }; 00119 00123 inline void 00124 setFeatureEdgeSmoothing (bool feature_edge_smoothing) 00125 { 00126 feature_edge_smoothing_ = feature_edge_smoothing; 00127 }; 00128 00130 inline bool 00131 getFeatureEdgeSmoothing () 00132 { 00133 return feature_edge_smoothing_; 00134 }; 00135 00139 inline void 00140 setFeatureAngle (float feature_angle) 00141 { 00142 feature_angle_ = feature_angle; 00143 }; 00144 00146 inline float 00147 getFeatureAngle () 00148 { 00149 return feature_angle_; 00150 }; 00151 00155 inline void 00156 setEdgeAngle (float edge_angle) 00157 { 00158 edge_angle_ = edge_angle; 00159 }; 00160 00162 inline float 00163 getEdgeAngle () 00164 { 00165 return edge_angle_; 00166 }; 00167 00171 inline void 00172 setBoundarySmoothing (bool boundary_smoothing) 00173 { 00174 boundary_smoothing_ = boundary_smoothing; 00175 }; 00176 00178 inline bool 00179 getBoundarySmoothing () 00180 { 00181 return boundary_smoothing_; 00182 } 00183 00184 protected: 00185 void 00186 performProcessing (pcl::PolygonMesh &output); 00187 00188 private: 00189 vtkSmartPointer<vtkPolyData> vtk_polygons_; 00190 00192 int num_iter_; 00193 float convergence_; 00194 float relaxation_factor_; 00195 bool feature_edge_smoothing_; 00196 float feature_angle_; 00197 float edge_angle_; 00198 bool boundary_smoothing_; 00199 }; 00200 } 00201 #endif /* VTK_MESH_SMOOTHING_LAPLACIAN_H_ */
1.7.6.1