85 lines
2.0 KiB
C++
85 lines
2.0 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TPGePlane Àà
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TPGePlane ÉùÃ÷ ·½³Ì£ºa*x+b*y+c*z+d=0;TGVector3D=(a,b,c)
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#ifndef _TPGEPLANE_H_
|
|
#define _TPGEPLANE_H_
|
|
|
|
#ifndef _TGPOINT_H_
|
|
#include "TGPoint.h"
|
|
#endif
|
|
|
|
#ifndef _TGVECTOR3D_H_
|
|
#include "TGVector3D.h"
|
|
#endif
|
|
|
|
#ifndef _TWFLAG_H_
|
|
#include "TWFlag.h"
|
|
#endif
|
|
|
|
#ifndef _TPGELINE3D_H_
|
|
#include "TPGeLine3D.h"
|
|
#endif
|
|
|
|
class TGMatrix;
|
|
|
|
class GEOAPI TPGePlane : public TGVector3D
|
|
{
|
|
public:
|
|
|
|
TPGePlane();
|
|
|
|
TPGePlane(const TPGePlane& plane);
|
|
|
|
TPGePlane(const TGVector3D& vt,const TGPoint& pt);
|
|
|
|
virtual ~TPGePlane();
|
|
|
|
TPGePlane& operator =(const TPGePlane& plane);
|
|
|
|
bool IsValid() const;
|
|
|
|
bool Normalize();
|
|
|
|
void SetNormal(const TGPoint& vt);
|
|
|
|
void SetBasePoint(const TGPoint& pt);
|
|
|
|
void TransformBy(const TGMatrix* pMat);
|
|
|
|
TGPoint GetSamplePoint() const;
|
|
|
|
GRelation HitTest(const TGPoint& pt,bool bNormalized = false) const;
|
|
|
|
int Intersect(const TPGeLine3D& line,double& pa,bool bNormalized = false) const;
|
|
|
|
int Intersect(const TPGeLine3D& line,TGPoint& pt,bool bNormalized = false) const;
|
|
|
|
int Intersect(const TPGePlane& plane,TPGeLine3D& line,bool bNormalized = false) const;
|
|
|
|
bool IsSamePlane(const TPGePlane& plane,bool bSameDirection,bool bNormalized = false) const;
|
|
|
|
public:
|
|
|
|
double &a,&b,&c,d;
|
|
|
|
private:
|
|
|
|
int LinePlaneInt3DPt(double A,double B,double C,double D,const TGPoint&pt0,const TGVector3D&vt,TGPoint&pt) const;
|
|
|
|
int LinePlaneInt3D(double A,double B,double C,double D,const TGPoint&pt0,const TGVector3D&vt,double&pa) const;
|
|
|
|
int PlaneInt(double A1,double B1,double C1,double D1,double A2,double B2,
|
|
double C2,double D2,TGPoint&pt,TGVector3D&vt) const;
|
|
|
|
};
|
|
|
|
#endif
|
|
|