Visual Servoing Platform  version 3.0.0
vpCylinder.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  * Cylinder feature.
32  *
33  * Authors:
34  * Eric Marchand
35  *
36  *****************************************************************************/
37 
38 
44 #ifndef vpCylinder_hh
45 #define vpCylinder_hh
46 
47 #include <visp3/core/vpHomogeneousMatrix.h>
48 #include <math.h>
49 #include <visp3/core/vpMath.h>
50 
51 #include <visp3/core/vpForwardProjection.h>
52 
93 class VISP_EXPORT vpCylinder : public vpForwardProjection
94 {
95 public:
96  typedef enum
97  {
99  line2
100  } vpLineCylinderType;
101 
102  vpCylinder() ;
103  vpCylinder(const vpColVector& oP) ;
104  vpCylinder(const double A, const double B,
105  const double C,
106  const double X0, const double Y0,
107  const double Z0,
108  const double R) ;
109  virtual ~vpCylinder() ;
110 
111  void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) ;
112  void changeFrame(const vpHomogeneousMatrix &cMo) ;
113 
114  void display(const vpImage<unsigned char> &I,
115  const vpCameraParameters &cam,
116  const vpColor &color=vpColor::green,
117  const unsigned int thickness=1) ;
118  void display(const vpImage<unsigned char> &I,
119  const vpHomogeneousMatrix &cMo,
120  const vpCameraParameters &cam,
121  const vpColor &color=vpColor::green,
122  const unsigned int thickness=1) ;
123 
124  vpCylinder *duplicate() const ;
125 
131  double getRho1() const { return p[0] ; }
137  double getTheta1() const { return p[1] ; }
138 
144  double getRho2() const { return p[2] ; }
150  double getTheta2() const { return p[3] ; }
151 
155  double getA() const { return cP[0] ; }
159  double getB() const { return cP[1] ; }
163  double getC() const { return cP[2] ; }
167  double getX() const { return cP[3] ; }
171  double getY() const { return cP[4] ; }
175  double getZ() const { return cP[5] ; }
179  double getR() const { return cP[6] ; }
180 
181  void init() ;
182 
183  void projection() ;
184  void projection(const vpColVector &cP, vpColVector &p) ;
185 
186  void setWorldCoordinates(const vpColVector& oP) ;
187  void setWorldCoordinates(const double A, const double B,
188  const double C,
189  const double X0, const double Y0,
190  const double Z0,
191  const double R) ;
192 } ;
193 
194 
195 #endif
virtual void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)=0
double getY() const
Definition: vpCylinder.h:171
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
double getZ() const
Definition: vpCylinder.h:175
virtual void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)=0
double getRho2() const
Definition: vpCylinder.h:144
virtual void init()=0
static const vpColor green
Definition: vpColor.h:166
virtual void projection()=0
double getTheta1() const
Definition: vpCylinder.h:137
Class that defines what is a generic geometric feature.
double getC() const
Definition: vpCylinder.h:163
double getB() const
Definition: vpCylinder.h:159
virtual void setWorldCoordinates(const vpColVector &oP)=0
Generic class defining intrinsic camera parameters.
Class that defines what is a cylinder.
Definition: vpCylinder.h:93
double getA() const
Definition: vpCylinder.h:155
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
double getRho1() const
Definition: vpCylinder.h:131
double getTheta2() const
Definition: vpCylinder.h:150
virtual vpForwardProjection * duplicate() const =0
double getX() const
Definition: vpCylinder.h:167
double getR() const
Definition: vpCylinder.h:179