closing_boundary.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2012-, Open Perception, Inc.
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of the copyright holder(s) nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  *
00034  * 
00035  *
00036  */
00037 
00038 #ifndef CLOSING_BOUNDARY_H
00039 #define CLOSING_BOUNDARY_H
00040 
00041 #include <pcl/surface/on_nurbs/nurbs_data.h>
00042 #include <pcl/surface/on_nurbs/nurbs_tools.h>
00043 #include <pcl/surface/on_nurbs/fitting_surface_pdm.h>
00044 
00045 namespace pcl
00046 {
00047   namespace on_nurbs
00048   {
00049 
00053     class ClosingBoundary
00054     {
00055     public:
00056       enum Type
00057       {
00058         COMMON_BOUNDARY_POINT_MEAN, COMMON_BOUNDARY_POINT_TANGENTS, COMMON_BOUNDARY_POINT_PLANES,
00059         CLOSEST_POINTS_BOUNDARY, CLOSEST_POINTS_INTERIOR,
00060       };
00061 
00062       struct Parameter
00063       {
00064         double max_dist;
00065         double max_error;
00066         unsigned samples;
00067         unsigned com_iter;
00068         unsigned fit_iter;
00069         double accuracy;
00070         double smoothness;
00071         double boundary_weight;
00072         double interior_weight;
00073         Type type;
00074 
00075         Parameter (double _max_dist = 0.02, double _max_error = 0.02, unsigned _samples = 10, unsigned _iter = 10,
00076                    unsigned _fit_iter = 10, double _accuracy = 1e-3, double _smooth = 0.00001,
00077                    double _bnd_weight = 1.0, double _int_weight = 1.0, Type _type = COMMON_BOUNDARY_POINT_MEAN) :
00078           max_dist (_max_dist), max_error (_max_error), samples (_samples), com_iter (_iter), fit_iter (_fit_iter),
00079               accuracy (_accuracy), smoothness (_smooth), boundary_weight (_bnd_weight),
00080               interior_weight (_int_weight), type (_type)
00081         {
00082         }
00083 
00084       };
00085 
00088       static double
00089       getLineDistance (const Eigen::Vector3d &P0, const Eigen::Vector3d &u, const Eigen::Vector3d &Q0,
00090                        const Eigen::Vector3d &v, Eigen::Vector3d &P, Eigen::Vector3d &Q);
00091 
00093       static Eigen::Vector3d
00094       intersectPlanes (const Eigen::Vector3d &N1, double d1, const Eigen::Vector3d &N2, double d2,
00095                        const Eigen::Vector3d &N3, double d3);
00096 
00099       static Eigen::Vector3d
00100       commonBoundaryPoint1 (ON_NurbsSurface &n1, ON_NurbsSurface &n2, Eigen::Vector2d &params1,
00101                             Eigen::Vector2d &params2, const Eigen::Vector3d &start, unsigned nsteps, double &error,
00102                             double accuracy);
00103 
00106       static Eigen::Vector3d
00107       commonBoundaryPoint2 (ON_NurbsSurface &n1, ON_NurbsSurface &n2, Eigen::Vector2d &params1,
00108                             Eigen::Vector2d &params2, const Eigen::Vector3d &start, unsigned nsteps, double &error,
00109                             double accuracy);
00110 
00113       static Eigen::Vector3d
00114       commonBoundaryPoint3 (ON_NurbsSurface &n1, ON_NurbsSurface &n2, Eigen::Vector2d &params1,
00115                             Eigen::Vector2d &params2, const Eigen::Vector3d &start, unsigned nsteps, double &error,
00116                             double accuracy);
00117 
00119       static void
00120       sampleUniform (ON_NurbsSurface *nurbs, vector_vec3d &point_list, unsigned samples);
00121 
00123       static void
00124       sampleRandom (ON_NurbsSurface *nurbs, vector_vec3d &point_list, unsigned samples);
00125 
00127       static void
00128       sampleFromBoundary (ON_NurbsSurface *nurbs, vector_vec3d &point_list, vector_vec2d &param_list, unsigned samples);
00129 
00132       static void
00133       optimizeBoundary (std::vector<ON_NurbsSurface> &nurbs_list, std::vector<NurbsDataSurface> &data_list,
00134                         Parameter param);
00135 
00136 //      static void
00137 //      optimizeControlPoints (std::vector<ON_NurbsSurface> &nurbs_list, std::vector<NurbsDataSurface> &data_list,
00138 //                             Parameter param);
00139 
00140     };
00141 
00142   }
00143 }
00144 
00145 #endif


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:22:36