GLC_Plane : Math plane representation. More...
#include <glc_plane.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_Plane () | |
| Default constructor. | |
| GLC_Plane (double A, double B, double C, double D) | |
| Contruct a plan with specified parameter. | |
| GLC_Plane (const GLC_Vector3d &normal, double minimumDistance) | |
| Construct a plane with normal vector and the minimum distance from this plane to the origin. | |
| GLC_Plane (const GLC_Vector3d &normal, const GLC_Point3d &point) | |
| Construct a plane with normal vector and a 3d point. | |
| GLC_Plane (const GLC_Point3d &, const GLC_Point3d &, const GLC_Point3d &) | |
| Contruct a plane with 3 given 3d points. | |
| GLC_Plane (const GLC_Plane &) | |
| Copy constructor. | |
| GLC_Plane & | operator= (const GLC_Plane &) |
| Assignement operator. | |
| ~GLC_Plane () | |
| Destructor. | |
Get Functions | |
| double | coefA () const |
| Return A coef. | |
| double | coefB () const |
| Return B coef. | |
| double | coefC () const |
| Return C coef. | |
| double | coefD () const |
| Return D coef. | |
| double | distanceToPoint (const GLC_Point3d &p) const |
| Return the signed distance to a point. | |
| bool | operator== (GLC_Plane) const |
| Equality operator. | |
| bool | operator!= (const GLC_Plane &p) const |
| diff operator | |
| GLC_Vector3d | normal () const |
| Return this plane normal. | |
| bool | lieOnThisPlane (const GLC_Point3d &p) |
| Return true if the given point is on this plane. | |
| const double * | data () const |
| Return a pointer to this plane equation data. | |
| QString | toString () const |
| Return the plane data to string. | |
Set Functions | |
| void | setA (double a) |
| Set A coef. | |
| void | setB (double b) |
| Set B coef. | |
| void | setC (double c) |
| Set C coef. | |
| void | setD (double d) |
| Set D coef. | |
| void | normalize () |
| Normalize the plane. | |
| GLC_Plane & | setPlane (const GLC_Vector3d &normal, const GLC_Point3d &point) |
| Set the plane from the given normal and point and return a reference to this plane. | |
Private Attributes | |
| double | m_Eq [4] |
| Plane is define by equation : Ax + By + Cz + D= 0. | |
GLC_Plane : Math plane representation.
GLC_Plane is definined by its equation : Ax + By + CZ + D= 0
Definition at line 39 of file glc_plane.h.
| GLC_Plane::GLC_Plane | ( | ) |
| GLC_Plane::GLC_Plane | ( | double | A, | |
| double | B, | |||
| double | C, | |||
| double | D | |||
| ) |
Contruct a plan with specified parameter.
Plane equation : Ax + By + CZ + D= 0
Definition at line 38 of file glc_plane.cpp.
References m_Eq.
| GLC_Plane::GLC_Plane | ( | const GLC_Vector3d & | normal, | |
| double | minimumDistance | |||
| ) |
Construct a plane with normal vector and the minimum distance from this plane to the origin.
Definition at line 48 of file glc_plane.cpp.
References m_Eq, GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
| GLC_Plane::GLC_Plane | ( | const GLC_Vector3d & | normal, | |
| const GLC_Point3d & | point | |||
| ) |
Construct a plane with normal vector and a 3d point.
Definition at line 57 of file glc_plane.cpp.
References m_Eq, GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
| GLC_Plane::GLC_Plane | ( | const GLC_Point3d & | p1, | |
| const GLC_Point3d & | p2, | |||
| const GLC_Point3d & | p3 | |||
| ) |
Contruct a plane with 3 given 3d points.
first : origine, second x, third y
Definition at line 67 of file glc_plane.cpp.
References m_Eq, normal(), normalize(), GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
| GLC_Plane::GLC_Plane | ( | const GLC_Plane & | plane | ) |
| GLC_Plane::~GLC_Plane | ( | ) |
Destructor.
Definition at line 97 of file glc_plane.cpp.
| double GLC_Plane::coefA | ( | ) | const [inline] |
Return A coef.
Definition at line 80 of file glc_plane.h.
| double GLC_Plane::coefB | ( | ) | const [inline] |
Return B coef.
Definition at line 84 of file glc_plane.h.
| double GLC_Plane::coefC | ( | ) | const [inline] |
Return C coef.
Definition at line 88 of file glc_plane.h.
| double GLC_Plane::coefD | ( | ) | const [inline] |
| const double* GLC_Plane::data | ( | void | ) | const [inline] |
Return a pointer to this plane equation data.
Definition at line 115 of file glc_plane.h.
Referenced by GLC_Viewport::useClipPlane().
| double GLC_Plane::distanceToPoint | ( | const GLC_Point3d & | p | ) | const [inline] |
Return the signed distance to a point.
Definition at line 96 of file glc_plane.h.
References GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
Referenced by GLC_Frustum::localizeSphereToPlane().
| bool GLC_Plane::lieOnThisPlane | ( | const GLC_Point3d & | p | ) | [inline] |
Return true if the given point is on this plane.
Definition at line 111 of file glc_plane.h.
References GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
| GLC_Vector3d GLC_Plane::normal | ( | ) | const [inline] |
Return this plane normal.
Definition at line 107 of file glc_plane.h.
Referenced by GLC_Plane(), and glc::lineIntersectPlane().
| void GLC_Plane::normalize | ( | ) |
Normalize the plane.
Definition at line 129 of file glc_plane.cpp.
References m_Eq.
Referenced by GLC_Plane(), and operator==().
| bool GLC_Plane::operator!= | ( | const GLC_Plane & | p | ) | const [inline] |
| bool GLC_Plane::operator== | ( | GLC_Plane | p2 | ) | const |
| void GLC_Plane::setA | ( | double | a | ) | [inline] |
Set A coef.
Definition at line 128 of file glc_plane.h.
| void GLC_Plane::setB | ( | double | b | ) | [inline] |
Set B coef.
Definition at line 132 of file glc_plane.h.
| void GLC_Plane::setC | ( | double | c | ) | [inline] |
Set C coef.
Definition at line 136 of file glc_plane.h.
| void GLC_Plane::setD | ( | double | d | ) | [inline] |
Set D coef.
Definition at line 140 of file glc_plane.h.
| GLC_Plane & GLC_Plane::setPlane | ( | const GLC_Vector3d & | normal, | |
| const GLC_Point3d & | point | |||
| ) |
Set the plane from the given normal and point and return a reference to this plane.
Definition at line 139 of file glc_plane.cpp.
References m_Eq, GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
| QString GLC_Plane::toString | ( | ) | const |
double GLC_Plane::m_Eq[4] [private] |
Plane is define by equation : Ax + By + Cz + D= 0.
Definition at line 157 of file glc_plane.h.
Referenced by GLC_Plane(), normalize(), operator=(), operator==(), setPlane(), and toString().