229 lines
7.5 KiB
C++
229 lines
7.5 KiB
C++
// TDbPipeMultDim.h: interface for the TDbPipeMultDim class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_TDBPIPEMULTDIM_H__9D972C09_B771_4AAD_B4B8_BE13C320830D__INCLUDED_)
|
|
#define AFX_TDBPIPEMULTDIM_H__9D972C09_B771_4AAD_B4B8_BE13C320830D__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
/*============================================================================*
|
|
* Copyright(c), 1994-2007, Beijing Tangent Engineering Software Co.Ltd.
|
|
* 作 者: 沈睿
|
|
* 创建时间: 大约在冬季
|
|
* 描 述: 多管管径标注
|
|
* 归属项目: 给排水 暖通
|
|
* 历史记录: 2008-6-26 补头文件注释
|
|
=============================================================================*/
|
|
|
|
#include <dbSymbolAnnotate.h>
|
|
|
|
////////////////////////////////////////////////////////////
|
|
// 多管标注
|
|
class PS_EXP TDbPipeMultDim: public TDbSymbWithText {
|
|
DECLARE_TENTBASE();
|
|
ACRX_DECLARE_MEMBERS(TDbPipeMultDim);
|
|
|
|
private:
|
|
const static Adesk::UInt8 g_nVersion;
|
|
protected:
|
|
Adesk::UInt16 m_iDimType; //0:管径 1:编号 2:室外 3:标高 4: 管径标高 5:管代号-管径
|
|
|
|
XPoint m_ptStart, m_ptTurn;
|
|
double m_nTextBaseLen; //左右由正负控制
|
|
DList<AcDbSoftPointerId> m_lstPipe; //所有管线
|
|
XString m_sSpare; //备用
|
|
//Adesk::UInt16 m_iDimStyle; // 标注样式, 0: 不标识, 1: 点, 2: 斜线 ywb 2009-5-21
|
|
|
|
public:
|
|
TDbPipeMultDim();
|
|
~TDbPipeMultDim();
|
|
virtual BOOL IsValid() const;
|
|
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
|
|
|
virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
|
|
virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
|
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
|
virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*);
|
|
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
|
|
virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints,
|
|
AcDbIntArray& osnapModes,
|
|
AcDbIntArray& geomIds) const;
|
|
virtual Acad::ErrorStatus subGetStretchPoints(AcGePoint3dArray & stretchPoints) const;
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
|
const AcGeVector3d& offset);
|
|
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
|
const AcGeVector3d& offset);
|
|
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
|
|
|
// drived from TDbEntity
|
|
virtual void GetTips(DList<TObjInfoUnit> &) const; //取动态属性显示数据
|
|
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
|
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
|
virtual TSubText* HitTestText(XPoint pt)const {return NULL;};
|
|
//Helper Method
|
|
double GetDefaultTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
|
double GetMinTextBaseLen(BOOL bAsPaperUnit) const;
|
|
void SetLabelType(int iType); //add by yxx 2015-6-10
|
|
int GetLabelType() const;
|
|
void SetBulge(double dBulge); //add by yxx 2015-6-12
|
|
double GetBulge() const;
|
|
void Update();
|
|
XPoint GetStartPoint() const;
|
|
XPoint GetTurnPoint() const;
|
|
XPoint GetEndPoint() const;
|
|
double GetTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
|
void GetPipes(DList<AcDbObjectId>& lstPipe) const;
|
|
void SetPipes(DList<AcDbObjectId>& lstPipe);
|
|
virtual int GetFirstVersion()const{return 6;}
|
|
void AddPipe(AcDbObjectId id);
|
|
|
|
void GetTexts(XStringList &lstTexts) const;
|
|
void SetStartPoint(XPoint pt);
|
|
void SetTurnPoint(XPoint pt);
|
|
void SetTextBaseLen(double nVal, BOOL bAsPaperUnit=TRUE);
|
|
const TCHAR* GetSpareStr() const {
|
|
return (const TCHAR*)m_sSpare;
|
|
}
|
|
void SetSpareStr(const TCHAR* sText) {
|
|
assertWriteEnabled();
|
|
m_sSpare = sText;
|
|
}
|
|
int GetDimType() const {
|
|
return (int)m_iDimType;
|
|
}
|
|
void SetDimType(int nDimType) {
|
|
assertWriteEnabled();
|
|
m_iDimType=(Adesk::UInt16)nDimType;
|
|
}
|
|
|
|
int GetDimStyle() const
|
|
{
|
|
const TEntityFields &fd = GetFields();
|
|
Adesk::Int16 iDimStyle = 2;
|
|
fd.GFD(_T("多管标注样式"), iDimStyle);
|
|
|
|
return iDimStyle;
|
|
}
|
|
|
|
void SetDimStyle(int iDimStyle)
|
|
{
|
|
assertWriteEnabled();
|
|
|
|
const Adesk::Int16 iDimStyleTmp = iDimStyle;
|
|
TEntityFields &fd = Fields();
|
|
fd.SFD(_T("多管标注样式"), iDimStyleTmp);
|
|
}
|
|
|
|
// zxl 2012.01.18 add
|
|
int GetDimAlignType() const
|
|
{
|
|
const TEntityFields &fd = GetFields();
|
|
Adesk::Int16 iDimStyle = 0;
|
|
fd.GFD(_T("多管标注对齐方式"), iDimStyle);
|
|
|
|
return iDimStyle;
|
|
}
|
|
|
|
void SetDimAlignType(int iStyle)
|
|
{
|
|
assertWriteEnabled();
|
|
|
|
const Adesk::Int16 iDimStyleTmp = iStyle;
|
|
TEntityFields &fd = Fields();
|
|
fd.SFD(_T("多管标注对齐方式"), iDimStyleTmp);
|
|
}
|
|
|
|
// zxl 2012.01.18 add
|
|
double GetDimDist2Line() const
|
|
{
|
|
const TEntityFields &fd = GetFields();
|
|
double dDist = 2.0;
|
|
fd.GFD(_T("多管标注基线距离"), dDist);
|
|
return dDist;
|
|
}
|
|
|
|
void SetDimDist2Line(double dDist)
|
|
{
|
|
assertWriteEnabled();
|
|
TEntityFields &fd = Fields();
|
|
fd.SFD(_T("多管标注基线距离"), dDist);
|
|
}
|
|
|
|
// zxl 2012.01.18 add
|
|
CString GetPipeLabel() const
|
|
{
|
|
const TEntityFields &fd = GetFields();
|
|
CString sLabel;
|
|
fd.GFD(_T("多管标注管代号"), sLabel);
|
|
return sLabel;
|
|
}
|
|
|
|
CString GetOnePipeLabel(const int i) const;
|
|
|
|
void SetPipeLabel(CString sLabel)
|
|
{
|
|
assertWriteEnabled();
|
|
TEntityFields &fd = Fields();
|
|
fd.SFD(_T("多管标注管代号"), sLabel);
|
|
}
|
|
|
|
// zxl 2012.01.18 add
|
|
CString GetPipePrefix() const
|
|
{
|
|
const TEntityFields &fd = GetFields();
|
|
CString sPrefix;
|
|
fd.GFD(_T("多管标注管线前缀"), sPrefix);
|
|
return sPrefix;
|
|
}
|
|
|
|
void SetPipePrefix(CString sPrefix)
|
|
{
|
|
assertWriteEnabled();
|
|
TEntityFields &fd = Fields();
|
|
fd.SFD(_T("多管标注管线前缀"), sPrefix);
|
|
}
|
|
|
|
// zxl 2013.11.12 add
|
|
int GetDimFloorNumType() const
|
|
{
|
|
const TEntityFields &fd = GetFields();
|
|
Adesk::Int16 iDimStyle = 0;
|
|
fd.GFD(_T("多管标注楼号样式"), iDimStyle);
|
|
|
|
return iDimStyle;
|
|
}
|
|
|
|
void SetDimFloorNumType(int iStyle)
|
|
{
|
|
assertWriteEnabled();
|
|
const Adesk::Int16 iDimStyleTmp = iStyle;
|
|
TEntityFields &fd = Fields();
|
|
fd.SFD(_T("多管标注楼号样式"), iDimStyleTmp);
|
|
}
|
|
|
|
// cet 2014.6.12 add 编号标注样式 0:A-JL-1, 1:JL-A-1, 2:JL-A1, 3:AJL-1, 4:JLA-1
|
|
void SetSerialNumberDimType(int nType);
|
|
int GetSerialNumberDimType() const;
|
|
// cet 2014.6.12 add 判断是否使用了新的编号标注样式(老的编号样式单一)
|
|
bool IsUseNewSerialNumberDimType() const;
|
|
|
|
private:
|
|
// cet 2013.5.13 add 是否包含特殊字符
|
|
bool IsIncludeSpeicalChar(const CString &sText) const;
|
|
// cet 2014.5.13 add 将特殊字符替换为其他字符
|
|
void ReplaceSpecialChar(CString &sText) const;
|
|
// cet 2014.5.13 add 获得特殊字符位置
|
|
void GetSpecialCharIndexs( const CString &sText, std::map<int, CString> &mapIndex) const;
|
|
// cet 2014.5.13.add 当“管径和标高”样式含有特殊字符时,使用此函数绘制文字
|
|
void DrawSpecialCharForDnElevationType(XExplodeDraw &dc, const CString &sText, XPoint ptTempBeg, XPoint ptTempEnd, XPoint ptLoc, double dLineSpace = 0.0) const;
|
|
// cet 2014.5.13 add 获得替换特殊字符的字符串
|
|
CString GetReplaceSpecialCharString(const CString &sSpeicalChar) const;
|
|
// cet 2014.5.13 add 绘制“标高”样式中的特殊字符
|
|
void DrawSpecialCharForElevationType(XExplodeDraw &dc, TDbSymbElevation &text) const;
|
|
};
|
|
|
|
#endif // !defined(AFX_TDBPIPEMULTDIM_H__9D972C09_B771_4AAD_B4B8_BE13C320830D__INCLUDED_)
|