GLC_Plane Class Reference

GLC_Plane : Math plane representation. More...

#include <glc_plane.h>

List of all members.

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_Planeoperator= (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_PlanesetPlane (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.

Detailed Description

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.


Constructor & Destructor Documentation

GLC_Plane::GLC_Plane (  ) 

Default constructor.

Definition at line 27 of file glc_plane.cpp.

References m_Eq.

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 35 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 44 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 52 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 61 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  ) 

Copy constructor.

Definition at line 73 of file glc_plane.cpp.

References m_Eq.

GLC_Plane::~GLC_Plane (  ) 

Destructor.

Definition at line 89 of file glc_plane.cpp.


Member Function Documentation

double GLC_Plane::coefA (  )  const [inline]

Return A coef.

Definition at line 78 of file glc_plane.h.

double GLC_Plane::coefB (  )  const [inline]

Return B coef.

Definition at line 82 of file glc_plane.h.

double GLC_Plane::coefC (  )  const [inline]

Return C coef.

Definition at line 86 of file glc_plane.h.

double GLC_Plane::coefD (  )  const [inline]

Return D coef.

Definition at line 90 of file glc_plane.h.

Referenced by glc::lineIntersectPlane().

const double* GLC_Plane::data (  )  const [inline]

Return a pointer to this plane equation data.

Definition at line 113 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 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  )  [inline]

Return true if the given point is on this plane.

Definition at line 109 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 105 of file glc_plane.h.

Referenced by GLC_Plane(), and glc::lineIntersectPlane().

void GLC_Plane::normalize (  ) 

Normalize the plane.

Definition at line 121 of file glc_plane.cpp.

References m_Eq.

Referenced by GLC_Plane(), and operator==().

bool GLC_Plane::operator!= ( const GLC_Plane p  )  const [inline]

diff operator

Definition at line 101 of file glc_plane.h.

References operator==().

GLC_Plane & GLC_Plane::operator= ( const GLC_Plane p  ) 

Assignement operator.

Definition at line 79 of file glc_plane.cpp.

References m_Eq.

bool GLC_Plane::operator== ( GLC_Plane  p2  )  const

Equality operator.

Definition at line 99 of file glc_plane.cpp.

References m_Eq, and normalize().

void GLC_Plane::setA ( double  a  )  [inline]

Set A coef.

Definition at line 126 of file glc_plane.h.

void GLC_Plane::setB ( double  b  )  [inline]

Set B coef.

Definition at line 130 of file glc_plane.h.

void GLC_Plane::setC ( double  c  )  [inline]

Set C coef.

Definition at line 134 of file glc_plane.h.

void GLC_Plane::setD ( double  d  )  [inline]

Set D coef.

Definition at line 138 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 131 of file glc_plane.cpp.

References m_Eq, GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().

QString GLC_Plane::toString (  )  const

Return the plane data to string.

Definition at line 112 of file glc_plane.cpp.

References m_Eq.


Member Data Documentation

double GLC_Plane::m_Eq[4] [private]

Plane is define by equation : Ax + By + Cz + D= 0.

Definition at line 155 of file glc_plane.h.

Referenced by GLC_Plane(), normalize(), operator=(), operator==(), setPlane(), and toString().


The documentation for this class was generated from the following files:

SourceForge.net Logo

©2005-2011 Laurent Ribon