00001 /* 00002 <one line to give the library's name and an idea of what it does.> 00003 Copyright (C) <year> <name of author> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 */ 00020 00021 #ifndef V4R_LINE_H 00022 #define V4R_LINE_H 00023 00024 #include "v4r/geometry/linebase.h" 00025 00026 namespace V4R { 00027 class Line2DHdl 00028 { 00029 public: 00030 Line2DHdl(); 00031 Line2DHdl(Line2D<double> &r); 00032 Line2DHdl(double *p); 00033 void set(Line2D<double> &r); 00034 void set(double *p); 00035 static void normalize(cv::Mat &rLines); 00036 Line2D<double> &operator ()(); 00037 Line2D<double> &operator ()(unsigned int idx); 00038 cv::Vec<double,2> &normal(); 00039 cv::Vec<double,2> &computeNormal(); 00040 cv::Vec<double,2> &unit(); 00041 cv::Vec<double,2> &computeUnit(); 00042 private: 00043 cv::Ptr<Line2D<double> > mpLine; 00044 cv::Vec<double,2> mNormal; 00045 cv::Vec<double,2> mUnit; 00046 }; 00047 }; 00048 #endif // V4R_LINE_H