www.pudn.com > cad3d.zip > 3DPlane.h


#ifndef __3DPlane_h__ 
#define __3DPlane_h__ 
 
#include "3DMath/3DPoint.h" 
#include "3DMath/3DSegment.h" 
 
class MATH3D_API C3DPlane : public C3DPoint 
{ 
public: 
    C3DPlane(const C3DPoint& rPt) : C3DPoint(rPt) {};  
    C3DPlane(math_real x = 0, math_real y = 0, math_real z = 0, math_real w = 1) : C3DPoint(x, y, z, w) {};  
 
    C3DVector	GetNormal() const 
    { 
		return C3DVector(m_dPt[0],m_dPt[1],m_dPt[2]); 
    } 
 
    bool	IsIncident(const C3DPoint& rPt) const 
    { 
		return IsZero( (*this)*rPt ); 
    } 
     
    math_real	GetDistance(const C3DPoint& rPt) const 
    { 
		return (*this)*rPt; 
    } 
 
    math_real	GetDistanceAbs(const C3DPoint& rPt) const 
    { 
		return (math_real)fabs( (*this)*rPt ); 
    } 
}; 
 
#endif//__3DPlane_h__