87 lines
2.0 KiB
C++
87 lines
2.0 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, SH Software Co. Ltd.
|
|
// = FileName : XPlane类
|
|
// = Version : ver2.0
|
|
// = Author : zjq
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: XPlane类声明
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#ifndef _XPLANE_H_
|
|
#define _XPLANE_H_
|
|
|
|
#ifndef _XENTITY_H_
|
|
#include "XEntity.h"
|
|
#endif
|
|
|
|
#ifndef _XPOINT_H_
|
|
#include "XPoint.h"
|
|
#endif
|
|
|
|
#ifndef _XLINE_H_
|
|
#include "XLine.h"
|
|
#endif
|
|
|
|
class GEOAPI XPlane : public XEntity
|
|
{
|
|
public:
|
|
|
|
XPlane();
|
|
|
|
XPlane(double aa, double bb, double cc, double dd);
|
|
|
|
XPlane(const XPoint &ptOrg, const XVector3D &vtNorm);
|
|
|
|
XPlane(const XPlane &src);
|
|
|
|
virtual ~XPlane();
|
|
|
|
virtual bool IsKindOf(TEntityId entType) const;
|
|
virtual TEntityId Type() const;
|
|
virtual void CopyFrom(const XEntity* pImpSrc);
|
|
|
|
virtual BOOL IsValid() const;
|
|
|
|
// 3点确定一平面方程
|
|
virtual BOOL SetFrom3p(const XPoint &pt1, const XPoint &pt2, const XPoint &pt3);
|
|
|
|
// 平面与线求交,考虑了线是否为无限长
|
|
virtual BOOL Intersect(const XLine &ln, XPoint &ptInt) const;
|
|
|
|
// 平面与平面求交,求交线(无限长)
|
|
virtual BOOL Intersect(const XPlane &plan, XLine &ln) const;
|
|
|
|
virtual XVector3D GetNormal() const;
|
|
|
|
virtual double GetAngle(XVector3D vtLight)const;
|
|
|
|
virtual bool IsReflect(XVector3D vtLight)const;
|
|
|
|
virtual bool Reflect(XVector3D vtLight,XVector3D& vtRes)const;
|
|
|
|
virtual double GetParaA()const;
|
|
virtual void SetParaA(const double dVal);
|
|
|
|
virtual double GetParaB()const;
|
|
virtual void SetParaB(const double dVal);
|
|
|
|
virtual double GetParaC()const;
|
|
virtual void SetParaC(const double dVal);
|
|
|
|
virtual double GetParaD()const;
|
|
virtual void SetParaD(const double dVal);
|
|
|
|
XPlane & operator = (const XPlane &src);
|
|
|
|
BOOL operator !() const;
|
|
|
|
public:
|
|
|
|
double m_dParaA, m_dParaB, m_dParaC, m_dParaD;
|
|
};
|
|
|
|
extern GEOAPI BOOL GetShadowMatrix(const XPlane&plane, const XVector3D &vtLight, AcGeMatrix3d &mShadowMatrix);
|
|
|
|
#endif
|