ViSP  2.10.0
vpCylinder.h
1 /****************************************************************************
2  *
3  * $Id: vpCylinder.h 4574 2014-01-09 08:48:51Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Cylinder feature.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 
48 #ifndef vpCylinder_hh
49 #define vpCylinder_hh
50 
51 #include <visp/vpHomogeneousMatrix.h>
52 #include <math.h>
53 #include <visp/vpMath.h>
54 
55 #include <visp/vpForwardProjection.h>
56 
97 class VISP_EXPORT vpCylinder : public vpForwardProjection
98 {
99 public:
100  typedef enum
101  {
103  line2
104  } vpLineCylinderType;
105 
106  vpCylinder() ;
107  vpCylinder(const vpColVector& oP) ;
108  vpCylinder(const double A, const double B,
109  const double C,
110  const double X0, const double Y0,
111  const double Z0,
112  const double R) ;
113  virtual ~vpCylinder() ;
114 
115  void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) ;
116  void changeFrame(const vpHomogeneousMatrix &cMo) ;
117 
118  void display(const vpImage<unsigned char> &I,
119  const vpCameraParameters &cam,
120  const vpColor &color=vpColor::green,
121  const unsigned int thickness=1) ;
122  void display(const vpImage<unsigned char> &I,
123  const vpHomogeneousMatrix &cMo,
124  const vpCameraParameters &cam,
125  const vpColor &color=vpColor::green,
126  const unsigned int thickness=1) ;
127 
128  vpCylinder *duplicate() const ;
129 
135  double getRho1() const { return p[0] ; }
141  double getTheta1() const { return p[1] ; }
142 
148  double getRho2() const { return p[2] ; }
154  double getTheta2() const { return p[3] ; }
155 
159  double getA() const { return cP[0] ; }
163  double getB() const { return cP[1] ; }
167  double getC() const { return cP[2] ; }
171  double getX() const { return cP[3] ; }
175  double getY() const { return cP[4] ; }
179  double getZ() const { return cP[5] ; }
183  double getR() const { return cP[6] ; }
184 
185  void init() ;
186 
187  void projection() ;
188  void projection(const vpColVector &cP, vpColVector &p) ;
189 
190  void setWorldCoordinates(const vpColVector& oP) ;
191  void setWorldCoordinates(const double A, const double B,
192  const double C,
193  const double X0, const double Y0,
194  const double Z0,
195  const double R) ;
196 } ;
197 
198 
199 #endif
virtual void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)=0
double getY() const
Definition: vpCylinder.h:175
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
Class to define colors available for display functionnalities.
Definition: vpColor.h:125
double getZ() const
Definition: vpCylinder.h:179
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:148
virtual void init()=0
static const vpColor green
Definition: vpColor.h:170
virtual void projection()=0
double getTheta1() const
Definition: vpCylinder.h:141
Class that defines what is a generic geometric feature.
double getC() const
Definition: vpCylinder.h:167
double getB() const
Definition: vpCylinder.h:163
virtual void setWorldCoordinates(const vpColVector &oP)=0
Generic class defining intrinsic camera parameters.
Class that defines what is a cylinder.
Definition: vpCylinder.h:97
double getA() const
Definition: vpCylinder.h:159
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
double getRho1() const
Definition: vpCylinder.h:135
double getTheta2() const
Definition: vpCylinder.h:154
virtual vpForwardProjection * duplicate() const =0
double getX() const
Definition: vpCylinder.h:171
double getR() const
Definition: vpCylinder.h:183