ViSP  2.10.0
vpPlane.h
1 /****************************************************************************
2  *
3  * $Id: vpPlane.h 4702 2014-03-27 15:33:52Z 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  * Plane geometrical structure.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 
43 #ifndef vpPlane_hh
44 #define vpPlane_hh
45 
46 
47 
48 
62 #include <visp/vpColVector.h>
63 #include <visp/vpPoint.h>
64 #include <visp/vpHomogeneousMatrix.h>
65 
66 
67 class VISP_EXPORT vpPlane
68 {
69 
70 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
71  // for backward compatibility
72  public:
73 #else
74  private:
75 #endif
76  double A,B,C,D ;
77 
78 public:
79  typedef enum {
81  camera_frame
82  } vpPlaneFrame;
83  vpPlane() ;
84  vpPlane(const vpPlane& P) ;
85  vpPlane(const double A, const double B,const double C,const double D) ;
86  vpPlane(const vpPoint& P, const vpColVector &n, vpPlaneFrame frame=camera_frame) ;
87  vpPlane(const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame=camera_frame) ;
88  void init(const vpPoint& P, const vpPoint& Q, const vpPoint& R, vpPlaneFrame frame=camera_frame) ;
89  void init(const vpColVector& P, const vpColVector &n) ;
90  void init(const vpPlane& P) ;
91 
92  // SET the parameter
94  inline void setA(const double a) { this->A = a ; }
96  inline void setB(const double b) { this->B = b ; }
98  inline void setC(const double c) { this->C = c ; }
100  inline void setD(const double d) { this->D = d ; }
102  inline void setABCD(const double a, const double b,
103  const double c, const double d)
104  {
105  this->A = a;
106  this->B = b;
107  this->C = c;
108  this->D = d;
109  }
110 
111  vpPlane& operator =(const vpPlane& f) ;
112 
113  // GET information
115  double getA() const { return A ; }
117  double getB() const { return B ; }
119  double getC() const { return C ; }
121  double getD() const { return D ; }
122 
129  inline vpColVector getABCD() const {
130  vpColVector n(4);
131  n[0]=A;
132  n[1]=B;
133  n[2]=C;
134  n[3]=D;
135 
136  return n;
137  }
148  inline vpColVector abcd() const {
149  vpColVector n(4);
150  n[0]=A;
151  n[1]=B;
152  n[2]=C;
153  n[3]=D;
154 
155  return n;
156  }
157 
158  vpColVector getNormal() const;
159  void getNormal(vpColVector &n) const;
160 
161  friend VISP_EXPORT std::ostream& operator<< (std::ostream& os, vpPlane& p);
162 
163  // Operation with Plane
164  void projectionPointOnPlan(const vpPoint& P, vpPoint& Pproj) const ;
165 
166  double rayIntersection(const vpPoint &M0,
167  const vpPoint &M1,
168  vpColVector &H )const ;
169 
170  double getIntersection(const vpColVector &M1,vpColVector &H )const ;
171  void changeFrame(const vpHomogeneousMatrix &cMo);
172 
173 } ;
174 
175 
176 
177 #endif
vpColVector abcd() const
Definition: vpPlane.h:148
void setD(const double d)
Definition: vpPlane.h:100
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void setABCD(const double a, const double b, const double c, const double d)
Definition: vpPlane.h:102
Class that defines what is a point.
Definition: vpPoint.h:65
double D
Definition: vpPlane.h:76
vpColVector getABCD() const
Definition: vpPlane.h:129
void setA(const double a)
Definition: vpPlane.h:94
void setC(const double c)
Definition: vpPlane.h:98
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 getB() const
Definition: vpPlane.h:117
void setB(const double b)
Definition: vpPlane.h:96
double getA() const
Definition: vpPlane.h:115
double getC() const
Definition: vpPlane.h:119
This class defines the container for a plane geometrical structure.
Definition: vpPlane.h:67
double getD() const
Definition: vpPlane.h:121