88 lines
1.8 KiB
C++
88 lines
1.8 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, SH Software Co. Ltd.
|
|
// = FileName : XSearchRegionFromCurve 类
|
|
// = Version : ver2.0
|
|
// = Author : zjq
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: XSearchRegionFromCurve 声明
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#ifndef _XSearchRegionFromCurve_H_
|
|
#define _XSearchRegionFromCurve_H_
|
|
|
|
#ifndef _DLIST_H_
|
|
#include "DList.h"
|
|
#endif
|
|
|
|
#ifndef _XCURVESEGMENT_H_
|
|
#include "XCurveSegment.h"
|
|
#endif
|
|
|
|
#ifndef _XREGION_H_
|
|
#include "XRegion.h"
|
|
#endif
|
|
|
|
#ifndef _XREGIONSIDE_H_
|
|
#include "XRegionSide.h"
|
|
#endif
|
|
|
|
#ifndef _XSortSideOnVertex_H_
|
|
#include "XSortSideOnVertex.h"
|
|
#endif
|
|
|
|
class GEOAPI XSearchRegionFromCurve
|
|
{
|
|
public:
|
|
|
|
XSearchRegionFromCurve();
|
|
|
|
virtual ~XSearchRegionFromCurve();
|
|
|
|
void _XSearchRegionFromCurve();
|
|
|
|
void InitStart(const DList<XCurveSegment> &lstSegs);
|
|
|
|
//返回最大外区域
|
|
XRegion * SearchRegions();
|
|
|
|
XRegionSide * HitTest(XPoint ptMid);
|
|
|
|
//移除重合的区域,返回移除的数目
|
|
int RemoveDupRegions();
|
|
|
|
//求最外区域,返回数目
|
|
int GetOutsideRegions(DList<int> &lstOutIndex) const;
|
|
|
|
//求最外区域,返回数目
|
|
int GetOutsideRegions1(DList<int> &lstOutIndex) const;
|
|
|
|
// 找墙的左右房间
|
|
int SerachTwoRegion(XRegionSide &aSide, XRegion &lRegion, XRegion &rRegion);
|
|
|
|
public:
|
|
|
|
static DList<XSortSideOnVertex> g_lstAllSortSides;
|
|
|
|
DList<XRegionSide> m_sides;
|
|
|
|
DList<XRegion> m_regions;
|
|
|
|
private:
|
|
|
|
// 新添SortWallOnPt 到全局变量GlobalSortWalls
|
|
void NewAppend(XRegionSide *pWall);
|
|
|
|
// 从初始组中移邻接的区域到当前组, 返回移动的数目
|
|
BOOL AddAdjacentRegion(DList<int> &curGroup, DList<int> &initGroup) const;
|
|
|
|
int ComparePointBySortXY(const XPoint *p1, const XPoint *p2);
|
|
|
|
private:
|
|
|
|
static TCHAR s_chConstructed;
|
|
};
|
|
|
|
#endif
|
|
|