Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpLine.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Line feature.
32  *
33  * Authors:
34  * Eric Marchand
35  *
36  *****************************************************************************/
37 
38 
39 #ifndef vpLine_H
40 #define vpLine_H
41 
47 #include <visp3/core/vpMatrix.h>
48 #include <visp3/core/vpHomogeneousMatrix.h>
49 
50 #include <visp3/core/vpForwardProjection.h>
51 
105 class VISP_EXPORT vpLine : public vpForwardProjection
106 {
107 
108 public:
109 
110  void init() ;
111 
112  vpLine() ;
114  virtual ~vpLine() { ; }
115 
125  void setRho(const double rho) { p[0] = rho ; };
126 
135  void setTheta(const double theta) { p[1] = theta ;};
136 
147  double getTheta() const { return p[1] ; }
148 
158  double getRho() const { return p[0] ; }
159 
160 
161 
162  void setWorldCoordinates(const double &A1, const double &B1,
163  const double &C1, const double &D1,
164  const double &A2, const double &B2,
165  const double &C2, const double &D2) ;
166 
167 
168  void setWorldCoordinates(const vpColVector &oP1,
169  const vpColVector &oP2) ;
170 
171 
172  void setWorldCoordinates(const vpColVector &oP) ;
173 
174 
175  void projection() ;
176  void projection(const vpColVector &cP, vpColVector &p) ;
177  void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) ;
178  void changeFrame(const vpHomogeneousMatrix &cMo) ;
179 
180  void display(const vpImage<unsigned char> &I,
181  const vpCameraParameters &cam,
182  const vpColor &color=vpColor::green,
183  const unsigned int thickness=1) ;
184  void display(const vpImage<unsigned char> &I,
185  const vpHomogeneousMatrix &cMo,
186  const vpCameraParameters &cam,
187  const vpColor &color=vpColor::green,
188  const unsigned int thickness=1) ;
189 
190  vpLine *duplicate() const ;
191 } ;
192 
193 
194 #endif
195 
196 /*
197  * Local variables:
198  * c-basic-offset: 2
199  * End:
200  */
virtual void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)=0
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
virtual void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)=0
virtual void init()=0
static const vpColor green
Definition: vpColor.h:166
double getTheta() const
Definition: vpLine.h:147
virtual void projection()=0
double getRho() const
Definition: vpLine.h:158
Class that defines a line in the object frame, the camera frame and the image plane. All the parameters must be set in meter.
Definition: vpLine.h:105
Class that defines what is a generic geometric feature.
virtual void setWorldCoordinates(const vpColVector &oP)=0
Generic class defining intrinsic camera parameters.
virtual ~vpLine()
Destructor.
Definition: vpLine.h:114
void setRho(const double rho)
Definition: vpLine.h:125
void setTheta(const double theta)
Definition: vpLine.h:135
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
virtual vpForwardProjection * duplicate() const =0