ViSP  2.9.0
vpSphere.h
1 /****************************************************************************
2  *
3  * $Id: vpSphere.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  * Sphere feature.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
47 #ifndef vpSphere_hh
48 #define vpSphere_hh
49 
50 
51 #include <visp/vpMath.h>
52 #include <visp/vpDebug.h>
53 #include <visp/vpHomogeneousMatrix.h>
54 
55 #include <visp/vpForwardProjection.h>
56 #include <math.h>
64 class VISP_EXPORT vpSphere : public vpForwardProjection
65 {
66 public:
67  void init() ;
68  vpSphere() ;
69  virtual ~vpSphere() ;
70 
71 public:
72  vpSphere(const vpColVector& oP) ;
73  vpSphere(const double X0, const double Y0,
74  const double Z0,
75  const double R) ;
76 
77 
78  void setWorldCoordinates(const vpColVector& oP) ;
79  void setWorldCoordinates(const double X0, const double Y0,
80  const double Z0,
81  const double R) ;
82 
83  double get_x() const { return p[0] ; }
84  double get_y() const { return p[1] ; }
85  double get_mu20() const { return p[2] ; }
86  double get_mu11() const { return p[3] ; }
87  double get_mu02() const { return p[4] ; }
88 
89  double getX() const { return cP[0] ; }
90  double getY() const { return cP[1] ; }
91  double getZ() const { return cP[2] ; }
92 
93  double getR() const { return cP[3] ; }
94 
95  void projection() ;
96  void projection(const vpColVector &cP, vpColVector &p) ;
97  void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) ;
98  void changeFrame(const vpHomogeneousMatrix &cMo) ;
99 
100  void display(const vpImage<unsigned char> &I,
101  const vpCameraParameters &cam,
102  const vpColor &color=vpColor::green,
103  const unsigned int thickness=1) ;
104  void display(const vpImage<unsigned char> &I,
105  const vpHomogeneousMatrix &cMo,
106  const vpCameraParameters &cam,
107  const vpColor &color=vpColor::green,
108  const unsigned int thickness=1) ;
109 
110  vpSphere *duplicate() const ;
111 } ;
112 
113 
114 #endif
double get_mu02() const
Definition: vpSphere.h:87
virtual void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)=0
double getR() const
Definition: vpSphere.h:93
double get_x() const
Definition: vpSphere.h:83
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: vpSphere.h:91
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:86
virtual void init()=0
Class that defines what is a sphere.
Definition: vpSphere.h:64
static const vpColor green
Definition: vpColor.h:170
double get_mu20() const
Definition: vpSphere.h:85
virtual void projection()=0
Class that defines what is a generic geometric feature.
double get_y() const
Definition: vpSphere.h:84
virtual void setWorldCoordinates(const vpColVector &oP)=0
Generic class defining intrinsic camera parameters.
double getY() const
Definition: vpSphere.h:90
double getX() const
Definition: vpSphere.h:89
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
virtual vpForwardProjection * duplicate() const =0