210 lines
5.9 KiB
C++
210 lines
5.9 KiB
C++
|
|
// = FileName: LayPinDlg.h
|
|
// = Version: 1.0
|
|
// = Author:
|
|
// = Date: 2008/06/06
|
|
// = Description: 插入,编辑单针
|
|
// = Maintainers:
|
|
|
|
#if !defined(AFX_LAYPINDLG_H__3CABE034_8F60_43D4_8D49_933503B820DC__INCLUDED_)
|
|
#define AFX_LAYPINDLG_H__3CABE034_8F60_43D4_8D49_933503B820DC__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif
|
|
|
|
#include "resource.h"
|
|
#include "ThunderXData.h"
|
|
#include "DrawThunder2D.h"
|
|
#include "ThunderXData.h"
|
|
#include "UIIListCtrl.h"
|
|
|
|
#define GRADENUM 4
|
|
#define COLWIDTH 60
|
|
#define SPNMIN 1
|
|
#define SPNMAX 1000
|
|
|
|
class CThunderDbReactor;
|
|
class CLayPinDlg : public CDialog
|
|
{
|
|
|
|
public:
|
|
|
|
CLayPinDlg(const AcDbObjectId& entId = AcDbObjectId::kNull,BOOL bIsModel = FALSE,CWnd* pParent = NULL);
|
|
~CLayPinDlg();
|
|
|
|
enum UpdateStyle
|
|
{
|
|
UpdateNone = 0, // 不做更新
|
|
UpdateAllTH = 1, //更新所有字高
|
|
UpdateCurTH = 2, // 更新当前字高
|
|
UpdateAllSc = 3, // 更新所有图块系数
|
|
UpdateCurSc = 4, //更新当前图块系数
|
|
UpdateAllTHAndSc = 5,//更新所有 字高 和 图块系数
|
|
UpdateCurTHAndSc = 6,//更新当前字高 和 图块系数
|
|
};
|
|
|
|
//{{AFX_DATA(CLayPinDlg)
|
|
enum { IDD = IDD_LAYPINDLG };
|
|
CButton m_btnGroupExplain;
|
|
CString m_strTextHigh;
|
|
CString m_strBlockScale;
|
|
CString m_strRadius;
|
|
CString m_strPinHeight;
|
|
CButton m_btnTip;
|
|
CStatic m_stcNumCue;
|
|
CEdit m_edtSafeHt;
|
|
CButton m_radiShowType;
|
|
CButton m_btnCancel;
|
|
CButton m_btnUpdate;
|
|
CEdit m_edtNumber;
|
|
CEdit m_edtHeight;
|
|
CComboBox m_cmbRadius;
|
|
UpdateStyle m_Us;
|
|
CUIIListCtrl m_wndGrid;
|
|
CSpinButtonCtrl m_wndModulate;
|
|
CSpinButtonCtrl m_wndSpinGroupNo;
|
|
CSpinButtonCtrl m_wndHT;
|
|
CString m_sGroupNo;
|
|
CString m_sProvider;
|
|
//}}AFX_DATA
|
|
|
|
//{{AFX_VIRTUAL(CLayPinDlg)
|
|
protected:
|
|
virtual void DoDataExchange(CDataExchange* pDX);
|
|
virtual void PostNcDestroy();
|
|
//}}AFX_VIRTUAL
|
|
|
|
public:
|
|
|
|
// 对话框的非模式形式
|
|
BOOL DoModeless();
|
|
// 添加扩展数据
|
|
BOOL SetCurrentExData(const AcDbObjectId& idEnt);
|
|
// 读取扩展数据
|
|
BOOL GetCurrentExData(const AcDbObjectId& idEnt);
|
|
// 插入避雷针
|
|
BOOL InsertThunderBlock(AcDbObjectId& idEnt);
|
|
// 设置绘画指针
|
|
void SetThunderDraw2d(CDrawThunderTools* pThundDraw);
|
|
//更新字体高度 和 图块系数
|
|
void UpdateTHAndBkSc(UpdateStyle us);
|
|
//得到所有避雷针图块
|
|
void GetAllInsert(AcDbObjectIdArray& arcId);
|
|
//得到指定块参照的属性字的内容
|
|
void GetBlkAttrText(AcDbObjectId oid,LPCTSTR pszTag,CString& strBlkTest);
|
|
////得到指定块参照的属性字的插入点
|
|
void GetBlkAttrPos(AcDbObjectId oid,LPCTSTR pszTag,AcGePoint3d& ptPos);
|
|
//更新指定避雷器的字体高度 如果 IsUpdataAll 为 TRUE 更新全部,为 FALSE 更新当前
|
|
void UpdateTextHeight(BOOL IsUpdataAll = TRUE);
|
|
//修改扩展数据-字体高度
|
|
void ModifyTHChanged(const AcDbObjectIdArray& arcId);
|
|
//修改扩展数据- 图块系数
|
|
void ModifyBlkScaleChanged(const AcDbObjectIdArray& arcId);
|
|
//更新指定避雷器缩放比例 如果 IsUpdataAll 为 TRUE 更新全部,为 FALSE 更新当前
|
|
void UpdateBlkScale(BOOL IsUpdataAll = TRUE);
|
|
//设置指定块参照,指定Tag 的属性字 位置
|
|
Acad::ErrorStatus SetAttrPos(AcDbBlockReference* pRef,LPCTSTR pszTag,const AcGePoint3d& pt);
|
|
|
|
void UpdateThunderByProtectHeight();
|
|
|
|
double GetThunderHeight() const;
|
|
// 是否响应动态更新
|
|
BOOL IsDynamicUpdate() const;
|
|
//读写设置
|
|
void UpdateDlgData(BOOL ReadOrWrite);
|
|
//高亮保护圆
|
|
void HighlightSubEnt(double dProheight);
|
|
|
|
void UnHighlightSubEnt();
|
|
|
|
void SetDbReactorPtr(CThunderDbReactor* pRector);
|
|
|
|
void GetThunderProHeight(AcGeDoubleArray& arPro);
|
|
|
|
double GetThunderRadius() const;
|
|
|
|
void GetCurrentData(CStringArray& arData);
|
|
|
|
protected:
|
|
|
|
//{{AFX_MSG(CLayPinDlg)
|
|
virtual BOOL OnInitDialog();
|
|
afx_msg void OnClose();
|
|
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
|
afx_msg void OnButtonUpdate();
|
|
afx_msg void OnButtonCancel();
|
|
afx_msg void OnChangeEditNum();
|
|
afx_msg void OnLayer2d();
|
|
afx_msg void OnLayer3d();
|
|
afx_msg void OnThunderHeightTip();
|
|
afx_msg void OnDestroy();
|
|
afx_msg void OnChangeGroupNo();
|
|
afx_msg void OnGroupExplain();
|
|
afx_msg void OnAddHeight();
|
|
afx_msg void OnRemoveHeight();
|
|
//}}AFX_MSG
|
|
LONG_PTR OnAcadKeepFocus(UINT_PTR, LONG_PTR);
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
private:
|
|
|
|
// 初始化模式对话框
|
|
void InitModalDlg();
|
|
// 初始化非模式对话框
|
|
void InitModalessDlg();
|
|
// 显示或隐藏控件
|
|
void DisplayOrHideBtn(BOOL bIsHide = FALSE);
|
|
// 编号错误提示
|
|
void PostErrorToCue(CString& strError);
|
|
// 获取数据
|
|
BOOL GetDlgData(BOOL bIsUpdate = FALSE);
|
|
// 将圆和避雷针生成组并添加到有名对象字典的组字典中
|
|
AcDbObjectId AddCurGroup(const AcDbObjectIdArray& arIds, LPCTSTR pszGroupName);
|
|
// 避雷针保护高度
|
|
BOOL GetProtectHeightFromReg(CStringArray& arProHeight);
|
|
|
|
BOOL SetProtectHeightToReg(const CStringArray& arProHeight);
|
|
|
|
BOOL GetProtectHeightFromObj(const AcDbObjectId& idThunder, CStringArray& arProHeight);
|
|
|
|
BOOL SetProtectHeightToObj(LPCTSTR pszGNo, const CStringArray& arProHeight);
|
|
|
|
BOOL SplitValue(LPCTSTR pszSrc, LPCTSTR pszSplitCh, CStringArray& arValue);
|
|
|
|
BOOL SplitString(CString& sSrc, LPCTSTR pszSplitCh, CString& sValue);
|
|
|
|
CString ConvertToCString(const CStringArray& arValue, LPCTSTR pszSplitCh);
|
|
|
|
CString TrimDoubleString(LPCTSTR pszSrc);
|
|
|
|
BOOL AssertProtectHeight(BOOL bBoxTip = TRUE);
|
|
|
|
AcGePoint3d GetThunderInsertPosition(const AcDbObjectId& id);
|
|
|
|
void SaveDlgData();
|
|
|
|
void ReadDlgData();
|
|
|
|
private:
|
|
|
|
// 避雷针ID
|
|
AcDbObjectId m_idThunder;
|
|
// 模式显示或者非模式显示
|
|
BOOL m_bIsModel;
|
|
// 提示内容是否改变,用于更改字体颜色
|
|
BOOL m_bTipChange;
|
|
BOOL m_bValid;
|
|
CDrawThunderTools *m_pDrawThunder;
|
|
CThunderDbReactor *m_pReactor;
|
|
// 扩展数据
|
|
CStringArray m_arsXData;
|
|
// 保护高度
|
|
AcGeDoubleArray m_arProHeight;
|
|
CBitmap m_bitTip;
|
|
// 用于高亮显示实体
|
|
AcDbObjectIdArray m_arHlEnt;
|
|
};
|
|
|
|
#endif // !defined(AFX_LAYPINDLG_H__3CABE034_8F60_43D4_8D49_933503B820DC__INCLUDED_)
|