2026-10-04 00:04:20 +08:00
|
|
|
|
#pragma once
|
2026-09-28 15:28:50 +08:00
|
|
|
|
#include "ADSGePoint3d.h"
|
|
|
|
|
|
#include "Ge3DFace.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define SIDE1_INVISIBLE 0x01
|
|
|
|
|
|
#define SIDE2_INVISIBLE 0x02
|
|
|
|
|
|
#define SIDE3_INVISIBLE 0x04
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 用三角形拼多边形
|
2026-09-28 15:28:50 +08:00
|
|
|
|
class GeTriangle
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
GeTriangle(const ADSGePoint3d &pt1, const ADSGePoint3d &pt2, const ADSGePoint3d &pt3, int nFlag=0);
|
|
|
|
|
|
virtual ~GeTriangle();
|
|
|
|
|
|
|
|
|
|
|
|
void Ecs2Wcs(TVector3D vtEcs);
|
|
|
|
|
|
void Wcs2Ecs(TVector3D vtEcs);
|
|
|
|
|
|
|
|
|
|
|
|
void AsFace(Ge3DFace &face) const;
|
|
|
|
|
|
|
|
|
|
|
|
int IsLinear();
|
|
|
|
|
|
int IsInvisible();
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 1~3-命中1~3点;-1~-3 -命中1~3边;0-外部;4-内部
|
2026-09-28 15:28:50 +08:00
|
|
|
|
int HitTest2d(const ADSGePoint3d &ptTest) const;
|
|
|
|
|
|
|
|
|
|
|
|
enum HitType
|
|
|
|
|
|
{
|
2026-10-04 00:04:20 +08:00
|
|
|
|
HIT_SIDE1 = -1, //边1
|
|
|
|
|
|
HIT_SIDE2 = -2, //边2
|
|
|
|
|
|
HIT_SIDE3 = -3, //边3
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
HIT_OUTSIDE = 0, //外部
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
HIT_VERTEX1 = 1, //顶点1
|
|
|
|
|
|
HIT_VERTEX2 = 2, //顶点2
|
|
|
|
|
|
HIT_VERTEX3 = 3, //顶点3
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
HIT_INSIDE = 4 //内部
|
2026-09-28 15:28:50 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
int m_nFlag;
|
|
|
|
|
|
|
|
|
|
|
|
ADSGePoint3d vertex1, vertex2, vertex3;
|
|
|
|
|
|
};
|
|
|
|
|
|
|