143 lines
3.7 KiB
C++
143 lines
3.7 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TSearchSpaceFromWall 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TSearchSpaceFromWall 声明
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#ifndef _TSEARCHSPACEFROMWALL_H_
|
|
#define _TSEARCHSPACEFROMWALL_H_
|
|
|
|
#ifndef _TDPTRLIST_H_
|
|
#include "TDPtrList.h"
|
|
#endif
|
|
|
|
#ifndef _TPICKENTSET_H_
|
|
#include "TPickEntSet.h"
|
|
#endif
|
|
|
|
#ifndef _TPOINTLIST_H_
|
|
#include "TPointList.h"
|
|
#endif
|
|
|
|
#ifndef _TAECSPACEWALL_H_
|
|
#include "TAecSpaceWall.h"
|
|
#endif
|
|
|
|
#ifndef _TDPTRSTACK_H_
|
|
#include "TDPtrStack.h"
|
|
#endif
|
|
|
|
#ifndef _TAECSPACECELL_H_
|
|
#include "TAecSpaceCell.h"
|
|
#endif
|
|
|
|
#ifndef _TGGEPOLY2D_H_
|
|
#include "TGGePoly2D.h"
|
|
#endif
|
|
|
|
#ifndef _TENTITYSET_H_
|
|
#include "TEntitySet.h"
|
|
#endif
|
|
|
|
#ifndef _TSORTWALLONPT_H_
|
|
#include "TSortWallOnPt.h"
|
|
#endif
|
|
|
|
// 由墙找房间的辅助类,用来初始化全局变量和清除全局变量
|
|
// 状态: 考虑了墙体底标高不同时候的处理
|
|
class TARCH_EXP TSearchSpaceFromWall
|
|
{
|
|
public:
|
|
|
|
TSearchSpaceFromWall();
|
|
|
|
~TSearchSpaceFromWall();
|
|
|
|
void _SearchSpaceFromWall();
|
|
|
|
void InitStart(TPickEntSet &ss, const TDPtrList<AcDbObjectId> &idColus);
|
|
|
|
void InitStart(const TDPtrList<AcDbObjectId> &idWalls, const TDPtrList<AcDbObjectId> &idColus);
|
|
|
|
//更新柱子对墙体的连接
|
|
void UpdateColuLinkage(const TGGeRectAngle *pBox = NULL);
|
|
|
|
//更新墙体标志(内外墙)
|
|
void UpdateWallFlags();
|
|
|
|
// 合并所有墙段
|
|
void MergeWalls(TADSGePointList &lstCorners, TPickEntSet &ssDel);
|
|
|
|
//在断点处,或裁剪区域中心打断墙体
|
|
void BreakWalls(TADSGePointList &lstCorners, TPickEntSet &ssAdd);
|
|
|
|
// 新添SortWallOnPt 到全局变量GlobalSortWalls
|
|
void NewAppend(TAecSpaceWall *pWall);
|
|
|
|
TAecSpaceCell * SearchSpaces();
|
|
|
|
// 通过给定的点搜索房间
|
|
// 返回: 0--没有找到; 1--室内; 2--室外
|
|
int SearchSpace(const TADSGePoint3d &ptAt, TAecSpaceCell &space);
|
|
|
|
// 找由fromWall到toWall的一条路径, 应当没有找出区域的情况下使用
|
|
int SearchPath(TAecSpaceWall &fromWall, TAecSpaceWall &toWall, TDPtrStack<TAecSpaceWall> &lstWallPath);
|
|
|
|
// 找由fromWall到toWall的一条路径, 应当没有找出区域的情况下使用 ;nType:0,基线;1,中线;2,Left;3;right;
|
|
int SearchPath(TAecSpaceWall &fromWall, TAecSpaceWall &toWall, TGGePoly2D &polyPath, int nType = 0);
|
|
|
|
void SetDefaultWidth();
|
|
|
|
// bCreateAlone是否创建孤独的墙, 在轴线变墙时用到
|
|
void CreateWalls(BOOL bCreateStandAlone=TRUE);
|
|
|
|
//取得在墙角的所有实体
|
|
void GetEntitiesAtCorners(TADSGePointList &lstCorners, TPickEntSet &ss);
|
|
|
|
void GetAllCorners(TADSGePointList &lstCorners);
|
|
|
|
TAecSpaceWall *FindWall(const TEntitySet &objName);
|
|
|
|
// 找aWall的左右房间
|
|
int SearchTwoSpace(TAecSpaceWall &aWall, TAecSpaceCell &lSpace, TAecSpaceCell &rSpace);
|
|
|
|
int SearchOneSpace(TAecSpaceWall &aWall, int nSide, TAecSpaceCell &space);
|
|
|
|
int FindLinkNode(const TAecSpaceWall *pWall, int *pIndex1, int *pIndex2);
|
|
|
|
|
|
public:
|
|
|
|
static TDPtrList<TSortWallOnPt> g_lstAllSortWalls;
|
|
|
|
TDPtrList<TAecSpaceWall> walls;
|
|
|
|
TDPtrList<TAecSpaceCell> spaces;
|
|
CMap<long,long,PVOID,PVOID> m_mapWallId2OutlinePl;
|
|
|
|
protected:
|
|
|
|
//在第nPos个墙角合并墙段
|
|
Adesk::Boolean MergeWallAt(int nPos, TADSGePointList &lstCorners, TPickEntSet &ssDel);
|
|
|
|
//在第nPos个墙角合并墙段
|
|
Adesk::Boolean BreakWallAt(int nPos, TADSGePointList &lstCorners, TPickEntSet &ssAdd);
|
|
|
|
private:
|
|
|
|
// add by gjm 2013/10/21
|
|
// 从g_lstAllSortWalls中取出符合要求的TSortWallOnPt
|
|
TSortWallOnPt* GetSortWallByPt(const TAecSpaceWall *pWall, BOOL bStartPt) const;
|
|
|
|
TAecSpaceCell *SearchExtSpace(TDPtrList<TAecSpaceWall> &walls, TDPtrList<TAecSpaceCell> &spaces);
|
|
|
|
private:
|
|
|
|
static char s_chConstructed;
|
|
};
|
|
|
|
#endif |