//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TGGePolygonEx类 // = Version : ver2.0 // = Author : wlw // = CreateDate : 2002-09-09 // = Description: TGGePolygonEx类声明 // = Maintainers: // //-----------------------------------------------------------------------------+ #ifndef _TGGEPOLYGONEX_H_ #define _TGGEPOLYGONEX_H_ #ifndef _TGGEPOLY_H_ #include "TGGePoly.h" #endif #ifndef _TENTITYSET_H_ #include "TEntitySet.h" #endif #ifndef _TGGETRIANGLE_H_ #include "TGGeTriangle.h" #endif #ifndef _TLOOPLIST_H_ #include "TLoopList.h" #endif // 多边形的三角形化 class GEOAPI TGGePolygonEx : public TGGePoly { public: TGGePolygonEx(); TGGePolygonEx(TGGePoly &src); TGGePolygonEx(TEntitySet &ent); TGGePolygonEx(const TGGePolygonEx &src); virtual ~TGGePolygonEx(); virtual bool IsKindOf(TEntityId entType) const; virtual TEntityId Type() const; virtual void CopyFrom(const TGGeEntity* pSrc); TADSGePoint3d * operator [](int nIndex); const TADSGePoint3d & operator [](int nIndex) const; TGGePolygonEx & operator = (const TGGePolygonEx &src); // 求法向量,用来作为坐标变换 int GetNormal(TVector3D &vtNormal) const; int Make(const TCHAR *szLay); // b2D--TRUE, 已经是二维;否则是三维,需要坐标变换 int Trianglize(TDPtrList &lstTris, BOOL b2D = FALSE) const; int SubTrianglize(TDPtrList &lstTris); int GetInsidePoint(TADSGePoint3d &ptRet, BOOL b2D = FALSE) const; int SubGetInsidePoint(TADSGePoint3d &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 TADSGePoint3d &pt, int nIndex = 1); double GetEdgeLength(int idx) const; double GetAngle(int idx) const; TADSGePoint3d GetVertex(int idx) const; TLoopList& GetVisibleFlag(); public: // 1--visible; 0-invisible TLoopList m_lstVisibleFlag; }; #endif