fw4spl
PlaneFunctions.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWMATH_PLANEFUNCTIONS_HPP__
8 #define __FWMATH_PLANEFUNCTIONS_HPP__
9 
10 
11 #include "fwMath/IntrasecTypes.hpp"
12 #include "fwMath/VectorFunctions.hpp"
13 #include "fwMath/LineFunctions.hpp"
14 #include "fwMath/config.hpp"
15 #include "fwMath/MatrixFunctions.hpp"
16 
17 #include <fwCore/base.hpp>
18 
19 namespace fwMath
20 {
21 
22 static const double EPSILON = 0.001;
23 
27 FWMATH_API fwPlane getPlane(const fwVec3d & _point1, const fwVec3d & _point2, const fwVec3d & _point3);
34 FWMATH_API fwPlane getPlane(const fwVec3d& _normal,const fwVec3d& _point);
35 
44 FWMATH_API void setValues(fwPlane& _plane, const fwVec3d & _point1, const fwVec3d & _point2, const fwVec3d & _point3);
45 
51 FWMATH_API fwVec3d getNormal(const fwPlane& _plane);
57 FWMATH_API void setNormal(fwPlane& _plane, const fwVec3d& _normal);
63 FWMATH_API double getDistance(const fwPlane& _plane);
70 FWMATH_API void setDistance(fwPlane& _plane, const double _distance);
78 FWMATH_API bool intersect( const fwPlane& _fwPlane, const fwLine & _line, fwVec3d& _point);
79 
86 FWMATH_API bool isInHalfSpace(const fwPlane& _plane, const fwVec3d& _point);
87 
94 FWMATH_API void transform(fwPlane& _plane, const fwMatrix4x4& _matrix);
95 
102 FWMATH_API void offset(fwPlane& _plane, double _offset);
103 
104 } // namespace fwMath
105 
112 FWMATH_API bool operator==(fwPlane& plane1, fwPlane& plane2);
113 
114 #endif /* __FWMATH_PLANEFUNCTIONS_HPP__ */
FWMATH_API bool isInHalfSpace(const fwPlane &_plane, const fwVec3d &_point)
Compute if a point is in a half plane.
FWMATH_API double getDistance(const fwPlane &_plane)
Get the distance from origin for the given plan (_plane).
FWMATH_API void offset(fwPlane &_plane, double _offset)
Add an offset at the distance of origin which define the plane (_plane).
FWMATH_API void setValues(fwPlane &_plane, const fwVec3d &_point1, const fwVec3d &_point2, const fwVec3d &_point3)
Initialize a plane _plane with three points (_point1, _point2, _point3). It computes the plane&#39;s norm...
FWMATH_API void setDistance(fwPlane &_plane, const double _distance)
Set the distance from origin (_distance) for the given plan (_plane).
FWMATH_API void setNormal(fwPlane &_plane, const fwVec3d &_normal)
Set the normal of the given plane _plane.
The namespace fwMath contains classes which provide the implementation of several mathematic function...
Definition: Compare.hpp:12
FWMATH_API fwVec3d getNormal(const fwPlane &_plane)
Return the normal of the given plane _plane.
FWMATH_API void transform(fwPlane &_plane, const fwMatrix4x4 &_matrix)
Apply a transformation to a plane. The transformation is defined by a matrix 4x4. ...
FWMATH_API bool intersect(const fwLine &_ray, double _radius, const fwVec3d &_point)
Compute the projection of a point in a given direction and test if this intersection is inside a give...