GLC_lib
2.5.0
|
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. | |
GLC_Plane & | setNormal (const GLC_Vector3d &normal) |
Set this plane normal to the given normal 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 37 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 36 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 45 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 53 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 62 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 90 of file glc_plane.cpp.
|
inline |
Return A coef.
Definition at line 78 of file glc_plane.h.
|
inline |
Return B coef.
Definition at line 82 of file glc_plane.h.
|
inline |
Return C coef.
Definition at line 86 of file glc_plane.h.
|
inline |
|
inline |
Return a pointer to this plane equation data.
Definition at line 112 of file glc_plane.h.
Referenced by GLC_Viewport::useClipPlane().
|
inline |
Return the signed distance to a point.
Definition at line 94 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 | ) |
Return true if the given point is on this plane.
Definition at line 114 of file glc_plane.cpp.
References glc::compare(), glc::EPSILON, m_Eq, GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
Referenced by GLC_ExtrudedMesh::pointsLieOnAPlane().
|
inline |
Return this plane normal.
Definition at line 105 of file glc_plane.h.
Referenced by GLC_Plane(), and glc::lineIntersectPlane().
void GLC_Plane::normalize | ( | ) |
Normalize the plane.
Definition at line 131 of file glc_plane.cpp.
References m_Eq.
Referenced by GLC_Plane(), and operator==().
|
inline |
bool GLC_Plane::operator== | ( | GLC_Plane | p2 | ) | const |
Equality operator.
Definition at line 100 of file glc_plane.cpp.
References glc::compare(), glc::EPSILON, m_Eq, and normalize().
|
inline |
Set A coef.
Definition at line 125 of file glc_plane.h.
|
inline |
Set B coef.
Definition at line 129 of file glc_plane.h.
|
inline |
Set C coef.
Definition at line 133 of file glc_plane.h.
|
inline |
Set D coef.
Definition at line 137 of file glc_plane.h.
GLC_Plane & GLC_Plane::setNormal | ( | const GLC_Vector3d & | normal | ) |
Set this plane normal to the given normal and return a reference to this plane.
Definition at line 151 of file glc_plane.cpp.
References m_Eq, GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
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 141 of file glc_plane.cpp.
References m_Eq, GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
QString GLC_Plane::toString | ( | ) | const |
|
private |
Plane is define by equation : Ax + By + Cz + D= 0.
Definition at line 157 of file glc_plane.h.
Referenced by GLC_Plane(), lieOnThisPlane(), normalize(), operator=(), operator==(), setNormal(), setPlane(), and toString().