ViSP  2.9.0
vpPlane.h
1 /****************************************************************************
2  *
3  * $Id: vpPlane.h 4649 2014-02-07 14:57:11Z 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  vpPlane() ;
80  vpPlane(const vpPlane& P) ;
81  vpPlane(const double A, const double B,const double C,const double D) ;
82  vpPlane(const vpPoint& P, const vpColVector &n) ;
83  vpPlane(const vpPoint &P, const vpPoint &Q, const vpPoint &R) ;
84  void init(const vpPoint& P, const vpPoint& Q, const vpPoint& R) ;
85  void init(const vpColVector& P, const vpColVector &n) ;
86  void init(const vpPlane& P) ;
87 
88  // SET the parameter
90  inline void setA(const double a) { this->A = a ; }
92  inline void setB(const double b) { this->B = b ; }
94  inline void setC(const double c) { this->C = c ; }
96  inline void setD(const double d) { this->D = d ; }
98  inline void setABCD(const double a, const double b,
99  const double c, const double d)
100  {
101  this->A = a;
102  this->B = b;
103  this->C = c;
104  this->D = d;
105  }
106 
107  vpPlane& operator =(const vpPlane& f) ;
108 
109  // GET information
111  double getA() const { return A ; }
113  double getB() const { return B ; }
115  double getC() const { return C ; }
117  double getD() const { return D ; }
118 
125  inline vpColVector getABCD() const {
126  vpColVector n(4);
127  n[0]=A;
128  n[1]=B;
129  n[2]=C;
130  n[3]=D;
131 
132  return n;
133  }
144  inline vpColVector abcd() const {
145  vpColVector n(4);
146  n[0]=A;
147  n[1]=B;
148  n[2]=C;
149  n[3]=D;
150 
151  return n;
152  }
153 
154  vpColVector getNormal() const;
155  void getNormal(vpColVector &n) const;
156 
157  friend VISP_EXPORT std::ostream& operator<< (std::ostream& os, vpPlane& p);
158 
159  // Operation with Plane
160  void projectionPointOnPlan(const vpPoint& P, vpPoint& Pproj) const ;
161 
162  double rayIntersection(const vpPoint &M0,
163  const vpPoint &M1,
164  vpColVector &H )const ;
165 
166  double getIntersection(const vpColVector &M1,vpColVector &H )const ;
167  void changeFrame(const vpHomogeneousMatrix &cMo);
168 
169 } ;
170 
171 
172 
173 #endif
vpColVector abcd() const
Definition: vpPlane.h:144
void setD(const double d)
Definition: vpPlane.h:96
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:98
Class that defines what is a point.
Definition: vpPoint.h:65
double D
Definition: vpPlane.h:76
vpColVector getABCD() const
Definition: vpPlane.h:125
void setA(const double a)
Definition: vpPlane.h:90
void setC(const double c)
Definition: vpPlane.h:94
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:113
void setB(const double b)
Definition: vpPlane.h:92
double getA() const
Definition: vpPlane.h:111
double getC() const
Definition: vpPlane.h:115
This class defines the container for a plane geometrical structure.
Definition: vpPlane.h:67
double getD() const
Definition: vpPlane.h:117