Visual Servoing Platform  version 3.0.0
vpPlane.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  * Plane geometrical structure.
32  *
33  * Authors:
34  * Eric Marchand
35  *
36  *****************************************************************************/
37 
38 
39 #ifndef vpPlane_hh
40 #define vpPlane_hh
41 
42 #include <visp3/core/vpColVector.h>
43 #include <visp3/core/vpPoint.h>
44 #include <visp3/core/vpHomogeneousMatrix.h>
45 
58 class VISP_EXPORT vpPlane
59 {
60 
61 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
62  // for backward compatibility
63  public:
64 #else
65  private:
66 #endif
67  double A,B,C,D ;
68 
69 public:
70  typedef enum {
72  camera_frame
73  } vpPlaneFrame;
74  vpPlane() ;
75  vpPlane(const vpPlane& P) ;
76  vpPlane(const double A, const double B,const double C,const double D) ;
77  vpPlane(const vpPoint& P, const vpColVector &n, vpPlaneFrame frame=camera_frame) ;
78  vpPlane(const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame=camera_frame) ;
79  void init(const vpPoint& P, const vpPoint& Q, const vpPoint& R, vpPlaneFrame frame=camera_frame) ;
80  void init(const vpColVector& P, const vpColVector &n) ;
81  void init(const vpPlane& P) ;
82 
83  // SET the parameter
85  inline void setA(const double a) { this->A = a ; }
87  inline void setB(const double b) { this->B = b ; }
89  inline void setC(const double c) { this->C = c ; }
91  inline void setD(const double d) { this->D = d ; }
93  inline void setABCD(const double a, const double b,
94  const double c, const double d)
95  {
96  this->A = a;
97  this->B = b;
98  this->C = c;
99  this->D = d;
100  }
101 
102  vpPlane& operator =(const vpPlane& f) ;
103 
104  // GET information
106  double getA() const { return A ; }
108  double getB() const { return B ; }
110  double getC() const { return C ; }
112  double getD() const { return D ; }
113 
120  inline vpColVector getABCD() const {
121  vpColVector n(4);
122  n[0]=A;
123  n[1]=B;
124  n[2]=C;
125  n[3]=D;
126 
127  return n;
128  }
139  inline vpColVector abcd() const {
140  vpColVector n(4);
141  n[0]=A;
142  n[1]=B;
143  n[2]=C;
144  n[3]=D;
145 
146  return n;
147  }
148 
149  vpColVector getNormal() const;
150  void getNormal(vpColVector &n) const;
151 
152  friend VISP_EXPORT std::ostream& operator<< (std::ostream& os, vpPlane& p);
153 
154  // Operation with Plane
155  void projectionPointOnPlan(const vpPoint& P, vpPoint& Pproj) const ;
156 
157  double rayIntersection(const vpPoint &M0,
158  const vpPoint &M1,
159  vpColVector &H )const ;
160 
161  double getIntersection(const vpColVector &M1,vpColVector &H )const ;
162  void changeFrame(const vpHomogeneousMatrix &cMo);
163 
164 } ;
165 
166 
167 
168 #endif
vpColVector abcd() const
Definition: vpPlane.h:139
void setD(const double d)
Definition: vpPlane.h:91
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setABCD(const double a, const double b, const double c, const double d)
Definition: vpPlane.h:93
Class that defines what is a point.
Definition: vpPoint.h:59
double D
Definition: vpPlane.h:67
vpColVector getABCD() const
Definition: vpPlane.h:120
void setA(const double a)
Definition: vpPlane.h:85
void setC(const double c)
Definition: vpPlane.h:89
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
double getB() const
Definition: vpPlane.h:108
void setB(const double b)
Definition: vpPlane.h:87
double getA() const
Definition: vpPlane.h:106
double getC() const
Definition: vpPlane.h:110
This class defines the container for a plane geometrical structure.
Definition: vpPlane.h:58
double getD() const
Definition: vpPlane.h:112