Visual Servoing Platform  version 3.0.0
vpLine.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 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 
120 class VISP_EXPORT vpLine : public vpForwardProjection
121 {
122 
123 public:
124 
125  void init() ;
126 
127  vpLine() ;
129  virtual ~vpLine() { ; }
130 
140  void setRho(const double rho) { p[0] = rho ; };
141 
150  void setTheta(const double theta) { p[1] = theta ;};
151 
162  double getTheta() const { return p[1] ; }
163 
173  double getRho() const { return p[0] ; }
174 
175 
176 
177  void setWorldCoordinates(const double &A1, const double &B1,
178  const double &C1, const double &D1,
179  const double &A2, const double &B2,
180  const double &C2, const double &D2) ;
181 
182 
183  void setWorldCoordinates(const vpColVector &oP1,
184  const vpColVector &oP2) ;
185 
186 
187  void setWorldCoordinates(const vpColVector &oP) ;
188 
189 
190  void projection() ;
191  void projection(const vpColVector &cP, vpColVector &p) ;
192  void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) ;
193  void changeFrame(const vpHomogeneousMatrix &cMo) ;
194 
195  void display(const vpImage<unsigned char> &I,
196  const vpCameraParameters &cam,
197  const vpColor &color=vpColor::green,
198  const unsigned int thickness=1) ;
199  void display(const vpImage<unsigned char> &I,
200  const vpHomogeneousMatrix &cMo,
201  const vpCameraParameters &cam,
202  const vpColor &color=vpColor::green,
203  const unsigned int thickness=1) ;
204 
205  vpLine *duplicate() const ;
206 } ;
207 
208 
209 #endif
210 
211 /*
212  * Local variables:
213  * c-basic-offset: 2
214  * End:
215  */
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:162
virtual void projection()=0
double getRho() const
Definition: vpLine.h:173
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:120
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:129
void setRho(const double rho)
Definition: vpLine.h:140
void setTheta(const double theta)
Definition: vpLine.h:150
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
virtual vpForwardProjection * duplicate() const =0