161 lines
4.7 KiB
C++
161 lines
4.7 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TArchPerDocData 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TArchPerDocData 声明
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#ifndef _TARCHPERDOCDATA_H_
|
|
#define _TARCHPERDOCDATA_H_
|
|
|
|
#ifndef _TPDLIST_H_
|
|
#include "TPDList.h"
|
|
#endif
|
|
|
|
#ifndef _TDPTRLIST_H_
|
|
#include "TDPtrList.h"
|
|
#endif
|
|
|
|
#ifndef _TDUALPTRLIST_H_
|
|
#include "TDualPtrList.h"
|
|
#endif
|
|
|
|
#ifndef _TENTITYSET_H_
|
|
#include "TEntitySet.h"
|
|
#endif
|
|
|
|
#ifndef _TPICKENTSET_H_
|
|
#include "TPickEntSet.h"
|
|
#endif
|
|
|
|
#ifndef _TARCHPERBLOCKDATA_H_
|
|
#include "TArchPerBlockData.h"
|
|
#endif
|
|
|
|
#ifndef _TACSTRING_H_
|
|
#include "TACString.h"
|
|
#endif
|
|
|
|
#ifndef _TWCSTRING_H_
|
|
#include "TWCString.h"
|
|
#endif
|
|
|
|
#ifndef _TSENDCOMMANDEDIT_H_
|
|
#include "TSendCommandEdit.h"
|
|
#endif
|
|
|
|
#include <set>
|
|
|
|
class TDbWall;
|
|
class TDbColumn;
|
|
class TArchDbReactor;
|
|
|
|
class TARCH_EXP TArchPerDocData
|
|
{
|
|
friend class TArchAppDocGlobals;
|
|
public:
|
|
TArchPerDocData(AcApDocument* pDoc);
|
|
~TArchPerDocData();
|
|
static int CompareForFind(const TArchPerDocData *pDoc1, const void *pDoc2);
|
|
|
|
void Initialize(AcDbDatabase *pDb);
|
|
|
|
BOOL IsDocLocked()const;
|
|
TArchPerBlockData* FindOrAddBlockData(AcDbObjectId idBlock);
|
|
void FindAndDelBlockData(AcDbObjectId idBlock);
|
|
TArchPerBlockData* GetBlockData(const AcDbEntity*pEnt);
|
|
void ResetDocCmdGlobals();
|
|
|
|
void AddWallCorners(const TDbWall *pWall);
|
|
void AddChangedColumn(const TDbColumn *pColumn);
|
|
void AddModifiedOpening(const AcDbObjectId &id);
|
|
void AddModifiedWall(const AcDbObjectId &id);
|
|
void AddModifiedClip(const AcDbObjectId& id);
|
|
void AddModifiedClipped(const AcDbObjectId&id);
|
|
void AddModifiedRegion(const AcDbObjectId&id);
|
|
|
|
void OnOpenedForModify(const AcDbObject *dbObj);
|
|
void OnModified(const AcDbObject *dbObj);
|
|
|
|
bool IsTooManyChanged()const;
|
|
|
|
AcDbObjectId GetTransactionId()const;
|
|
|
|
void UpdateCorners(bool bFormatCor = false);
|
|
void UpdateExtend(bool bRefresh);
|
|
void UpdateOpenings();
|
|
void UpdateWalls();
|
|
void UpdateClip();
|
|
void UpdateRegion();
|
|
|
|
void AttachReactor();
|
|
void DetachReactor();
|
|
|
|
BOOL OnAcadChar(UINT nChar, UINT nRepCnt, UINT nFlags);
|
|
|
|
//判断id 是否在已经修改的集合中 lfy 2010-6-9
|
|
bool ObjModifiedIn(AcDbObjectId& id)
|
|
{
|
|
if ( m_setModifiedOpeningId.find(id) != m_setModifiedOpeningId.end() ||
|
|
m_setModifiedWallId.find(id) != m_setModifiedWallId.end())
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public:
|
|
// 不驻留在DWG, 但是与当前DWG相关的变量
|
|
BOOL m_bModelNumber; //模数开关
|
|
int m_nOsnapType; //控制墙线捕捉形式的变量, 0--墙心; 1--墙边
|
|
double m_nMinLenWall; //允许的最短墙体
|
|
double m_lWallWidth, m_rWallWidth;
|
|
BOOL m_bDwgBegin; //是否DWG可以访问
|
|
BOOL m_bAcadIdle; //指示AutoCAD是否处于空闲状态, 即有没有命令/LISP等在执行
|
|
TEntitySet m_entMouseOn; //鼠标感应对象
|
|
TPickEntSet m_ssPickFirst; //当前选择集(如果选择集为空则使用m_entMouseOn
|
|
TPickEntSet m_ssPickGrip; //上次夹点的加亮的选择集
|
|
int m_nDrawWall; //0--设计模式(基线);1--测量模式(边线)
|
|
|
|
TCHAR m_szLastCommand[256]; //Last Command
|
|
BOOL m_bUpdateDisp;
|
|
|
|
TCHAR m_szCommandStr[1024];
|
|
UINT m_nPos;
|
|
|
|
BOOL m_bLispCommand;
|
|
TCString m_sCurCommand;
|
|
|
|
TPDList<TArchPerBlockData> m_lstBlock;
|
|
|
|
//modify by xlc on 100609 替换为集合,加快查找速度
|
|
//TDualPtrList<AcDbObjectId> m_lstBlockIdModified;
|
|
//
|
|
//TDPtrList<AcDbObjectId> m_lstModifiedOpeningId;
|
|
//TDPtrList<AcDbObjectId> m_lstModifiedWallId;
|
|
//TDPtrList<AcDbObjectId> m_lstClipChanged; //变化的裁剪对象,如柱子
|
|
//TDPtrList<AcDbObjectId> m_lstClippedChanged; //变化的被裁剪对象,如楼梯
|
|
//TDPtrList<AcDbObjectId> m_lstRegionChanged; //变化的TDbRegion
|
|
std::set<AcDbObjectId> m_setModifiedOpeningId; //修改的门窗
|
|
std::set<AcDbObjectId> m_setModifiedWallId; //修改的墙
|
|
std::set<AcDbObjectId> m_setClipChanged; //变化的裁剪对象,如柱子
|
|
std::set<AcDbObjectId> m_setClippedChanged; //变化的被裁剪对象,如楼梯
|
|
std::set<AcDbObjectId> m_setRegionChanged; //变化的TDbRegion
|
|
|
|
typedef std::set<AcDbObjectId>::iterator IT;
|
|
|
|
|
|
bool m_bUpdating; //是否正在更新
|
|
|
|
private:
|
|
AcApDocument* m_pDoc;
|
|
TArchDbReactor *m_pDbReactor;
|
|
TSendCommandEdit* m_pCommandSender;
|
|
public:
|
|
CMap<LONG_PTR,LONG_PTR,AcDbExtents,AcDbExtents> m_mapIdToCorner; //add by xlc on 100531 提速优化,记录墙角信息
|
|
};
|
|
|
|
#endif |