65 lines
1.6 KiB
C++
65 lines
1.6 KiB
C++
#pragma once
|
|
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, bj Software Co. Ltd.
|
|
// = FileName : Aec3dFaceplan.h
|
|
// = Version : ver2.0
|
|
// = Author :
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: 描述法向量是 z 的 常见面
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
|
|
typedef struct Face3Pt
|
|
{
|
|
AcGePoint3d pt[3];
|
|
}FACE3PT;
|
|
|
|
class Aec3dFaceplan
|
|
{
|
|
public:
|
|
Aec3dFaceplan(void);
|
|
virtual ~Aec3dFaceplan(void);
|
|
|
|
enum Faceplan
|
|
{
|
|
kRect = 1, //矩形面
|
|
kCircle = 2, //圆形面
|
|
kElbow = 3, //弯头形面
|
|
kTrape = 4, //梯形面
|
|
kFaces = 5, //其他三角面组成
|
|
};
|
|
|
|
public:
|
|
|
|
void AddFace(AcGePoint3d& pt1,AcGePoint3d& pt2,AcGePoint3d& pt3);
|
|
|
|
void AddFace(AcGePoint3d* pt,Aec3dFaceplan::Faceplan ePlan);
|
|
|
|
BOOL IsInside(const AcGePoint3d& ptGe);
|
|
|
|
double Elevation();
|
|
|
|
void ExtractFaces(AcDbVoidPtrArray& arFaces);
|
|
|
|
void Test2Db();
|
|
|
|
int NumberFaces(){return m_arFaces.length();}
|
|
|
|
static BOOL PointOutsideTriangle(const AcGePoint3d& ptGe1,const AcGePoint3d& ptGe2,
|
|
const AcGePoint3d& ptGe3,const AcGePoint3d& ptGeT);
|
|
|
|
static BOOL PointOutsideRect(const AcGePoint3d& ptGe1,const AcGePoint3d& ptGe2,
|
|
const AcGePoint3d& ptGe3,const AcGePoint3d& ptGe4,
|
|
const AcGePoint3d& ptGeT);
|
|
protected:
|
|
|
|
AcArray<Face3Pt> m_arFaces; //其他三角面
|
|
AcGePoint3d m_ptGe[5]; //共用数据[enum 1-4]
|
|
Aec3dFaceplan::Faceplan m_eType; //面类型
|
|
|
|
public:
|
|
BOOL m_bValid;
|
|
};
|