//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TPGeGraph.h // = Version : ver2.0 // = Author : xlc // = CreateDate : 2002-09-09 // = Description: 类的声明 有向图,支持仅一端有限曲线 // = Maintainers: // //-----------------------------------------------------------------------------+ #ifndef _TPGEGRAPH_H_ #define _TPGEGRAPH_H_ #ifndef _TGPOINT_H_ #include "TGPoint.h" #endif #ifndef _TPGELINE3D_H_ #include "TPGeLine3D.h" #endif #ifndef _TGVECTOR2D_H_ #include "TGVector2D.h" #endif #ifndef _TGNODE_H_ #include "TGNode.h" #endif #ifndef _TPGEEDGE_H_ #include "TPGeEdge.h" #endif #ifndef _TPDLIST_H_ #include "TPDList.h" #endif #ifndef _TGOBJECTLIST_H_ #include "TGObjectList.h" #endif #ifndef _TPGEEDGEPATH_H_ #include "TPGeEdgePath.h" #endif class TPGeCurve2D; class GEOAPI TPGeGraph { public: virtual ~TPGeGraph(); //找已有结点,否则新建结点并返回之 TGNode* FindOrAddNode(const TGPoint&pt); //加入一边,不能自交但可封闭,pSeg内部释放 virtual void AppendEdge(TPGeCurve2D*pSeg); //加入一组边,curves将被置空 void AppendEdge(TGObjectList&curves); //现只用于面布尔运算//找所有有效环路,所有路径之间都无相同边,同一路径上的一个点最多属于两条边 void FindLoop(TPDList&res); //找所有有效环路曲线和完全无限曲线,结果中所有曲线之间无相同边,都不自交 void FindCurve(TGObjectList&closed,TGObjectList&infinite); protected: //节点表 TPDList nodeTable; //边表 TPDList edgeTable; }; #endif