68 lines
1.4 KiB
C++
68 lines
1.4 KiB
C++
//-----------------------------------------------------------------------------+
|
||
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
||
// = FileName : TGGeTriangle类
|
||
// = Version : ver2.0
|
||
// = Author : wlw
|
||
// = CreateDate : 2002-09-09
|
||
// = Description: TGGeTriangle类声明
|
||
// = Maintainers:
|
||
//
|
||
//-----------------------------------------------------------------------------+
|
||
#ifndef _TGGETRIANGLE_H_
|
||
#define _TGGETRIANGLE_H_
|
||
|
||
#ifndef _TADSGEPOINT3D_H_
|
||
#include "TADSGePoint3d.h"
|
||
#endif
|
||
|
||
#ifndef _TGGE3DFACE_H_
|
||
#include "TGGe3DFace.h"
|
||
#endif
|
||
|
||
#define SIDE1_INVISIBLE 0x01
|
||
#define SIDE2_INVISIBLE 0x02
|
||
#define SIDE3_INVISIBLE 0x04
|
||
|
||
// 用三角形拼多边形
|
||
class GEOAPI TGGeTriangle
|
||
{
|
||
public:
|
||
|
||
TGGeTriangle(const TADSGePoint3d &pt1, const TADSGePoint3d &pt2, const TADSGePoint3d &pt3, int nFlag=0);
|
||
virtual ~TGGeTriangle();
|
||
|
||
void Ecs2Wcs(TVector3D vtEcs);
|
||
void Wcs2Ecs(TVector3D vtEcs);
|
||
|
||
void AsFace(TGGe3DFace &face) const;
|
||
|
||
int IsLinear();
|
||
int IsInvisible();
|
||
|
||
// 1~3-命中1~3点;-1~-3 -命中1~3边;0-外部;4-内部
|
||
int HitTest2d(const TADSGePoint3d &ptTest) const;
|
||
|
||
enum HitType
|
||
{
|
||
HIT_SIDE1 = -1, //边1
|
||
HIT_SIDE2 = -2, //边2
|
||
HIT_SIDE3 = -3, //边3
|
||
|
||
HIT_OUTSIDE = 0, //外部
|
||
|
||
HIT_VERTEX1 = 1, //顶点1
|
||
HIT_VERTEX2 = 2, //顶点2
|
||
HIT_VERTEX3 = 3, //顶点3
|
||
|
||
HIT_INSIDE = 4 //内部
|
||
};
|
||
|
||
public:
|
||
|
||
int m_nFlag;
|
||
|
||
TADSGePoint3d vertex1, vertex2, vertex3;
|
||
};
|
||
#endif
|
||
|