Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpSphere.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  * Sphere feature.
32  *
33  * Authors:
34  * Eric Marchand
35  *
36  *****************************************************************************/
37 
43 #ifndef vpSphere_hh
44 #define vpSphere_hh
45 
46 
47 #include <visp3/core/vpMath.h>
48 #include <visp3/core/vpDebug.h>
49 #include <visp3/core/vpHomogeneousMatrix.h>
50 
51 #include <visp3/core/vpForwardProjection.h>
52 #include <math.h>
60 class VISP_EXPORT vpSphere : public vpForwardProjection
61 {
62 public:
63  void init() ;
64  vpSphere() ;
65  virtual ~vpSphere() ;
66 
67 public:
68  vpSphere(const vpColVector& oP) ;
69  vpSphere(const double X0, const double Y0,
70  const double Z0,
71  const double R) ;
72 
73 
74  void setWorldCoordinates(const vpColVector& oP) ;
75  void setWorldCoordinates(const double X0, const double Y0,
76  const double Z0,
77  const double R) ;
78 
79  double get_x() const { return p[0] ; }
80  double get_y() const { return p[1] ; }
81  double get_mu20() const { return p[2] ; }
82  double get_mu11() const { return p[3] ; }
83  double get_mu02() const { return p[4] ; }
84 
85  double getX() const { return cP[0] ; }
86  double getY() const { return cP[1] ; }
87  double getZ() const { return cP[2] ; }
88 
89  double getR() const { return cP[3] ; }
90 
91  void projection() ;
92  void projection(const vpColVector &cP, vpColVector &p) ;
93  void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) ;
94  void changeFrame(const vpHomogeneousMatrix &cMo) ;
95 
96  void display(const vpImage<unsigned char> &I,
97  const vpCameraParameters &cam,
98  const vpColor &color=vpColor::green,
99  const unsigned int thickness=1) ;
100  void display(const vpImage<unsigned char> &I,
101  const vpHomogeneousMatrix &cMo,
102  const vpCameraParameters &cam,
103  const vpColor &color=vpColor::green,
104  const unsigned int thickness=1) ;
105 
106  vpSphere *duplicate() const ;
107 } ;
108 
109 
110 #endif
double get_mu02() const
Definition: vpSphere.h:83
virtual void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)=0
double getR() const
Definition: vpSphere.h:89
double get_x() const
Definition: vpSphere.h:79
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: vpSphere.h:87
virtual void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)=0
double get_mu11() const
Definition: vpSphere.h:82
virtual void init()=0
Class that defines what is a sphere.
Definition: vpSphere.h:60
static const vpColor green
Definition: vpColor.h:166
double get_mu20() const
Definition: vpSphere.h:81
virtual void projection()=0
Class that defines what is a generic geometric feature.
double get_y() const
Definition: vpSphere.h:80
virtual void setWorldCoordinates(const vpColVector &oP)=0
Generic class defining intrinsic camera parameters.
double getY() const
Definition: vpSphere.h:86
double getX() const
Definition: vpSphere.h:85
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
virtual vpForwardProjection * duplicate() const =0