Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpCylinder.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  * 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  double computeZ(const double x, const double y) const;
115 
116  void display(const vpImage<unsigned char> &I,
117  const vpCameraParameters &cam,
118  const vpColor &color=vpColor::green,
119  const unsigned int thickness=1) ;
120  void display(const vpImage<unsigned char> &I,
121  const vpHomogeneousMatrix &cMo,
122  const vpCameraParameters &cam,
123  const vpColor &color=vpColor::green,
124  const unsigned int thickness=1) ;
125 
126  vpCylinder *duplicate() const ;
127 
133  double getRho1() const { return p[0] ; }
139  double getTheta1() const { return p[1] ; }
140 
146  double getRho2() const { return p[2] ; }
152  double getTheta2() const { return p[3] ; }
153 
157  double getA() const { return cP[0] ; }
161  double getB() const { return cP[1] ; }
165  double getC() const { return cP[2] ; }
169  double getX() const { return cP[3] ; }
173  double getY() const { return cP[4] ; }
177  double getZ() const { return cP[5] ; }
181  double getR() const { return cP[6] ; }
182 
183  void init() ;
184 
185  void projection() ;
186  void projection(const vpColVector &cP, vpColVector &p) ;
187 
188  void setWorldCoordinates(const vpColVector& oP) ;
189  void setWorldCoordinates(const double A, const double B,
190  const double C,
191  const double X0, const double Y0,
192  const double Z0,
193  const double R) ;
194 } ;
195 
196 
197 #endif
virtual void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)=0
double getY() const
Definition: vpCylinder.h:173
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:177
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:146
virtual void init()=0
static const vpColor green
Definition: vpColor.h:166
virtual void projection()=0
double getTheta1() const
Definition: vpCylinder.h:139
Class that defines what is a generic geometric feature.
double getC() const
Definition: vpCylinder.h:165
double getB() const
Definition: vpCylinder.h:161
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:157
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
double getRho1() const
Definition: vpCylinder.h:133
double getTheta2() const
Definition: vpCylinder.h:152
virtual vpForwardProjection * duplicate() const =0
double getX() const
Definition: vpCylinder.h:169
double getR() const
Definition: vpCylinder.h:181