Files
envi-code/SourceCode/Code2026/tg_shs/shs_kerncmd/InsertOpeningDlg.h
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

286 lines
9.6 KiB
C++

// InsertOpeningDlg.h: interface for the CInsertOpeningDlg class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_INSERTOPENINGDLG_H__9D483821_3D75_11D3_827A_0000E82EB017__INCLUDED_)
#define AFX_INSERTOPENINGDLG_H__9D483821_3D75_11D3_827A_0000E82EB017__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class XBayWindow;
class TDbWall;
class TDbOpening;
class XOpeningParam {
public:
UINT m_nId;
CString m_csText;
BOOL m_bCheck;
public:
XOpeningParam(UINT id, const TCHAR *pszText, BOOL bCheck=true):
m_nId(id), m_csText(pszText), m_bCheck(bCheck)
{}
};
// 专门用于智能插入门窗,建立墙体和墙体范围内的轴网的关系
// 后续其实可以直接将m_aryAxisIds替换为顺序点的数组,更方便试用
class TWallAxisData
{
public:
AcDbObjectId m_idWall;
AcDbObjectIdArray m_aryAxisIds;
public:
TWallAxisData(AcDbObjectId idWall): m_idWall(idWall) {}
TWallAxisData & operator = (const TWallAxisData &src);
};
// 插入/编辑门窗对话框的基类
// 抽象了: 门/窗/矩形洞/凸窗/弧窗 的插入和编辑界面
class CInsertOpeningDlg : public CModelessDialog {
public:
static bool bRefreshDlg;//add by whl ,Is In Funtion RefreshInsWDHDlg()?
static int curType;//add by whl
static bool bLineWall;//add by whl ,for SequenceInsert()
static CInsertOpeningDlg* g_pCurDlg;//add by whl
public:
DECLARE_DYNAMIC(CInsertOpeningDlg)
CInsertOpeningDlg(UINT id, CWnd* pParent = NULL); // standard constructor
virtual ~CInsertOpeningDlg();
enum {USE_INSERT=0, USE_REPLACE=1, USE_EDIT=2};
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CInsertOpeningDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CInsertOpeningDlg)
virtual BOOL OnInitDialog();
afx_msg void OnFreeInsert();
afx_msg void OnSequenceInsert();
afx_msg void OnFixdistOnPier();
afx_msg void OnFixdistOnAxis();
afx_msg void OnArcWallInsert();
afx_msg void OnColumnInsert();
afx_msg void OnIsolineInsert();
afx_msg void OnIsowall();
afx_msg void OnUplevel();
afx_msg void OnReplace();
virtual void OnSelchangeLabel();
virtual void OnOK();
afx_msg void OnSelchangeParamList();
afx_msg void OnClose();
afx_msg void OnLookup();
afx_msg void OnBtnAptitude();//add by lgy 20120517 智能插入门窗
//add by whl
afx_msg void OnDestroy();
afx_msg void OnWin();
afx_msg void OnDoor();
afx_msg void OnDoorWin();
afx_msg void OnTwoDoor();
afx_msg void OnArcWin();
afx_msg void OnBayWin();
afx_msg void OnRectHole();
afx_msg void OnGJK();
//add by lgy 20120118 为拾取参数按钮添加响应函数
afx_msg void OnInQuite();
afx_msg void OnHasHoleInsert();// add by xly
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);
void createToolBar();
public:
// Dialog Data
//{{AFX_DATA(CInsertOpeningDlg)
CComboBox m_lstHeightBox;
CComboBox m_lstWidthBox;
CComboBox m_lstSillBox;
CComboBox m_lstLabelBox;
CComboBox m_lstDistBox;
CCheckListBox m_lstParamEdit;
//}}AFX_DATA
CToolBarCtrl m_toolbar;
double m_nWidth; //窗宽
double m_nHeight; //窗高
double m_nSill; //窗台高
CString m_csLabel; //编号
DList<XOpeningParam> m_lstParam;
static int g_nInsertMode;
static BOOL g_bChSide;
static CString g_csDist;
//add by lgy 20120119 保存原来的对话框类型
static int g_iOldInsertMode;
// add by xly on 110119 增加门窗个数和类型
CString m_csWinDoorType;
CString m_csWinDoorNumms;
// add by xly on 110216增加类型控件
CComboBox m_lstTypeBox;
public:
BOOL ModifyOpeningWithSameLabel(TDbOpening &op, BOOL bAskUser);
BOOL GetParamCheck(UINT id) const; //判断控件参数是否旋转
int GetUsage() const; //取得对话框的用途: 插入/编辑/替换
void ResizeDialog(BOOL bExpand);
// 创建一新实体并加入到模型空间, pWall以Read方式打开的指针
// 返回: TRUE-成功, FALSE--失败
virtual AcDbObjectId NewEntityToModelSpace(TDbWall *pWall, const XPoint &ptLoc1, BOOL bUplevel=FALSE, double nWidth=0.0, double nSill=0.0);
//用对话框的参数更新对象参数
virtual void UpdateOpening(TDbOpening &op, BOOL bLoadStyle=TRUE);
virtual TDbOpening * NewOpening();
virtual UINT GetInsertMode() const; //取得插入方式的控件ID
//virtual BOOL UpdateData(BOOL bSaveAndValidate=TRUE);
virtual XBayWindow *AllocBayWinData() {
return NULL;
}
virtual double GetOpeningWidth() const { //子类可重载本方法
return m_nWidth;
}
virtual void SetOpeningWidth(double nW) { //子类可重载本方法, 用于柱间插窗
m_nWidth=nW;
}
virtual double GetOpeningHeight() const { //子类可重载本方法
return m_nHeight;
}
virtual void SetOpeningHeight(double nW) { //子类可重载本方法, 用于柱间插窗
m_nHeight=nW;
}
virtual double GetOpeningSill() const { //子类可重载本方法
return m_nSill;
}
virtual void SetOpeningSill(double nW) { //子类可重载本方法, 用于柱间插窗
m_nSill=nW;
}
// sg add 110906,本函数主要是用来更新子类中特有的属性,比如,矩形洞更新洞口深度数据,子类可重载
virtual int ModifySpecialProperty(TDbOpening &op) {
return 1;
}
//add by lgy 20120119 拾取门窗对象的时候信息不一定全是在积累中
virtual int ObjToDlg(TDbOpening* pOpening);
// add by xly on 110214 获得门窗个数和类型
virtual int GetOpeningNums() const { //子类可重载本方法
return _ttoi(m_csWinDoorNumms);
}
virtual CString GetOpeningStyle() const { //子类可重载本方法
return m_csWinDoorType;
}
virtual const TCHAR * GetOpeningLabel() const { //子类可重载本方法
return (const TCHAR *)m_csLabel;
}
virtual void SetOpeningLabel(const TCHAR *pszLabel);
virtual BOOL ReadParamFromRegistry();
virtual BOOL WriteParamToRegistry() const;
virtual BOOL GetTitleKeyString(XString &sKeyStr) const; //获得对话框标题关键字串
virtual BOOL GetRegLocation(XString &sRegLoc) const; //关键注册位置, 子类需要重载本方法
// 门联窗需要重载本方法, 从其中的门获取编号, 如果op与对话框类型不一致, 则返回FALSE
// bGetOther--门联窗用控制是否取另一个门的编号
virtual BOOL GetLabel(const TDbOpening &op, XString &sLabel, BOOL bGetOther) const;
// 门联窗需要重载下列2个方法, 取中心位置
virtual XPoint GetLocation(const TDbOpening &op) const;
virtual double GetTotalWidth(const TDbOpening &op) const;
virtual BOOL InitParamList(DList<XOpeningParam> &lstParam) const;
//子类一般不需要重载的函数
// 如果不需要初始化编号列表, 则返回FALSE
virtual BOOL GetLabelListFromDwg(XStringList &lstLabels) const;
virtual void SetupLabelList();
// 修改门窗, 用于对象编辑
virtual BOOL ModifyOpening(TDbOpening &op);
// 点取了插入方式按钮
virtual void OnChangeInsertMode(UINT id);
virtual BOOL GetStyles(AcDbObjectId &id2d, AcDbObjectId &id3d);
// 用于编辑以及改选编号时
virtual BOOL SetDlgParamFrom(const TDbOpening &op);
// 修改门窗位置及参数, 门联窗对话框必须重载本函数
virtual BOOL ModifyOpeningPos(TDbOpening &op, const XPoint &ptNewLoc);
// 用对话框上的参数更新实体数据, 不重新计算插入点
virtual BOOL ModifyOpeningWithDlgParam(TDbOpening &op);
virtual int GetOpeningKind() const=0;
void SetReplacing();
static CString CalcAutoLabel(TDbOpening *pOpening);
void InvalidateOldLabel() {m_bOldLabel = true;}
void ValidateOldLabel() {m_bOldLabel = false;}
bool GoodLabel() const {return !m_bOldLabel;}
// 该函数用来获取准确的label值。包括普通编号
CString GetAutoLabel(TDbOpening *pOpening);
void AttachOpening(TDbOpening *pOpening) {m_pOpeningAttach = pOpening;}
void DettachOpening() {m_pOpeningAttach = NULL;}
bool IsAutoName() const;
private:
CString m_strAutoLabel; // 注意保持该值的更新:当属性发生变动的时候,重新计算一下该值
TDbOpening *m_pOpeningAttach;
bool m_bOldLabel;
};
class CGroupOpeningDlg:public CInsertOpeningDlg
{
protected:
TDbOpening *m_pOpeningBak;
public:
CStatic m_pic3d;
static CString s_csDoor3DStyle;
CImageDC m_PicSlide;
public:
CGroupOpeningDlg(CWnd* pParent);
~CGroupOpeningDlg();
enum { IDD = IDD_GROUP_OPENING };
virtual void DoDataExchange(CDataExchange*pDX);
virtual TDbOpening * NewOpening();
virtual BOOL GetRegLocation(XString &sRegLoc) const;
virtual int GetOpeningKind()const;
virtual int SetDlgParamFrom(const TDbOpening &op);
// sg add 110803,解决自动编号丢失问题
virtual void UpdateOpening(TDbOpening &op, BOOL bLoadStyle=TRUE);
void ShowSlide();
virtual BOOL OnInitDialog();
// sg add 110804,解决点击构件库后,自动编号无效的问题
afx_msg void OnGroupOpeningGJK();
afx_msg void OnPaint();
afx_msg void OnPictureup();
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
DECLARE_MESSAGE_MAP()
};
// 返回值: FALSE--Exit; TRUE--Change Insert Mode
BOOL FreeInsert(); // 自由插入门窗
BOOL FixInsert(); // 定距插门窗
BOOL IsoInsert(); // 等分插门窗
BOOL IsoWallInsert(); // 墙段等分插门窗
BOOL ColInsert(); // 柱间插门窗
void InsertOpening();
#endif // !defined(AFX_INSERTOPENINGDLG_H__9D483821_3D75_11D3_827A_0000E82EB017__INCLUDED_)