60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
#pragma once
|
|
#include "GePoly.h"
|
|
#include "EntitySet.h"
|
|
#include "GeTriangle.h"
|
|
#include "SHLoopList.h"
|
|
|
|
// 多边形的三角形化
|
|
class GePolygonEx : public GePoly
|
|
{
|
|
public:
|
|
GePolygonEx();
|
|
GePolygonEx(GePoly &src);
|
|
GePolygonEx(EntitySet &ent);
|
|
GePolygonEx(const GePolygonEx &src);
|
|
virtual ~GePolygonEx();
|
|
|
|
virtual bool IsKindOf(TEntityId entType) const;
|
|
virtual TEntityId Type() const;
|
|
virtual void CopyFrom(const GeEntity* pSrc);
|
|
|
|
ADSGePoint3d * operator [](int nIndex);
|
|
const ADSGePoint3d & operator [](int nIndex) const;
|
|
GePolygonEx & operator = (const GePolygonEx &src);
|
|
|
|
// 求法向量,用来作为坐标变换
|
|
int GetNormal(TVector3D &vtNormal) const;
|
|
|
|
int Make(const TCHAR *szLay);
|
|
|
|
// b2D--TRUE, 已经是二维;否则是三维,需要坐标变换
|
|
int Trianglize(PtrList<GeTriangle> &lstTris, BOOL b2D = FALSE) const;
|
|
int SubTrianglize(PtrList<GeTriangle> &lstTris);
|
|
|
|
int GetInsidePoint(ADSGePoint3d &ptRet, BOOL b2D = FALSE) const;
|
|
int SubGetInsidePoint(ADSGePoint3d &ptRet);
|
|
|
|
//是否为凸多边形,2D
|
|
BOOL IsConvex() const;
|
|
BOOL IsVisible(int idx) const;
|
|
|
|
void Reset();
|
|
void Reverse();
|
|
void Ecs2Wcs(TVector3D vtEcs);
|
|
void Wcs2Ecs(TVector3D vtEcs);
|
|
|
|
void SetVisible(int idx, BOOL bVis);
|
|
|
|
void RemoveNode(int nIndex);
|
|
void AppendNode(const ADSGePoint3d &pt, int nIndex = 1);
|
|
|
|
double GetEdgeLength(int idx) const;
|
|
double GetAngle(int idx) const;
|
|
ADSGePoint3d GetVertex(int idx) const;
|
|
SHLoopList<int>& GetVisibleFlag();
|
|
|
|
public:
|
|
// 1--visible; 0-invisible
|
|
SHLoopList<int> m_lstVisibleFlag;
|
|
};
|