ViSP  2.8.0
vpPlane.h
1 /****************************************************************************
2  *
3  * $Id: vpPlane.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 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 
79 public:
80  vpPlane() ;
81  vpPlane(const vpPlane& P) ;
82  vpPlane(const double A, const double B,const double C,const double D) ;
83  vpPlane(const vpPoint& P, const vpColVector &n) ;
84  vpPlane(const vpPoint &P, const vpPoint &Q, const vpPoint &R) ;
85  void init(const vpPoint& P, const vpPoint& Q, const vpPoint& R) ;
86  void init(const vpColVector& P, const vpColVector &n) ;
87  void init(const vpPlane& P) ;
88 
89  // SET the parameter
91  inline void setA(const double A) { this->A = A ; }
93  inline void setB(const double B) { this->B = B ; }
95  inline void setC(const double C) { this->C = C ; }
97  inline void setD(const double D) { this->D = D ; }
99  inline void setABCD(const double A, const double B,
100  const double C, const double D)
101  {
102  this->A = A;
103  this->B = B;
104  this->C = C;
105  this->D = D;
106  }
107 
108  vpPlane& operator =(const vpPlane& f) ;
109 
110  // GET information
112  double getA() const { return A ; }
114  double getB() const { return B ; }
116  double getC() const { return C ; }
118  double getD() const { return D ; }
119 
126  inline vpColVector getABCD() const {
127  vpColVector n(4);
128  n[0]=A;
129  n[1]=B;
130  n[2]=C;
131  n[3]=D;
132 
133  return n;
134  }
145  inline vpColVector abcd() const {
146  vpColVector n(4);
147  n[0]=A;
148  n[1]=B;
149  n[2]=C;
150  n[3]=D;
151 
152  return n;
153  }
154 
155  vpColVector getNormal() const;
156  void getNormal(vpColVector &n) const;
157 
158 
165  friend VISP_EXPORT std::ostream& operator<< (std::ostream& os, vpPlane& p)
166  {
167  return (os << "("<<p.getA() << ","<<p.getB()
168  << ","<<p.getC()<< ","<<p.getD() <<") ") ;
169  } ;
170 
171 
172  // Operation with Plane
173  void projectionPointOnPlan(const vpPoint& P, vpPoint& Pproj) const ;
174 
175  double rayIntersection(const vpPoint &M0,
176  const vpPoint &M1,
177  vpColVector &H )const ;
178 
179  double getIntersection(const vpColVector &M1,vpColVector &H )const ;
180  void changeFrame(const vpHomogeneousMatrix &cMo);
181 
182 } ;
183 
184 
185 
186 #endif
vpColVector abcd() const
Definition: vpPlane.h:145
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:99
Class that defines what is a point.
Definition: vpPoint.h:65
double D
Definition: vpPlane.h:76
vpColVector getABCD() const
Definition: vpPlane.h:126
void setA(const double A)
Definition: vpPlane.h:91
void setC(const double C)
Definition: vpPlane.h:95
void setD(const double D)
Definition: vpPlane.h:97
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:114
double getA() const
Definition: vpPlane.h:112
double getC() const
Definition: vpPlane.h:116
This class defines the container for a plane geometrical structure.
Definition: vpPlane.h:67
void setB(const double B)
Definition: vpPlane.h:93
double getD() const
Definition: vpPlane.h:118