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

223 lines
7.3 KiB
C++

#ifndef AFX_DBVPIPEDIM_H__
#define AFX_DBVPIPEDIM_H__
#if _MSC_VER > 1000
#pragma once
#endif
/*============================================================================*
* Copyright(c), 1994-2008, Beijing Tangent Engineering Software Co.Ltd.
* 作 者: 谢真
* 创建时间: 2008-01-09
* 描 述: 导线标注
* 归属项目: 给排水
=============================================================================*/
namespace TVPipeDim
{
enum VPipeDimType
{
eDimType1 = 0,
eDimType2 = 1,//圆,
eDimType3 = 2,
eDimType4 = 3, //上下文字
eDimType5 = 4, //楼号_管径 zxl 2013.08.22 add
eDimType6 = 5, //DN100 cet 2014.6.17 add
};
enum VPipeFloor
{
eType1 = 0, //A-JL-1
eType2 = 1, //JL-A-1
eType3 = 2, //JL-A1
eType4 = 3, //AJL-1 cet 2010.5.21 add
eType5 = 4, //JLA-1 cet 2010.11.18 add
};
}
#include "dbSymbolAnnotate.h"
class PS_EXP TDbVPipeDim : public TDbSymbWithText
{
DECLARE_TENTBASE();
ACRX_DECLARE_MEMBERS(TDbVPipeDim);
public:
TDbVPipeDim();
virtual ~TDbVPipeDim();
public:
//设置起点
void SetStartPt(const AcGePoint3d& pt);
//设置拐点
void SetTurnPt(const AcGePoint3d& pt);
//设置立管ID
void SetVPipeId(const AcDbObjectId &id);
//设置方向向量
void SetVtDir(const AcGeVector3d& vtDir);
//设置样式3的半径
void SetDimRadius(double dR);
//设置立管标注类型文字
void SetDimTypeText(LPCTSTR lpText);
//设置标注样式
void SetDimType(int nType);
//更新标注长度
void RenewDimLen();
//设置标注序号
void SetDimVPipeNum(LPCTSTR lpNum);
//设置立管楼号类型
void SetVPipeFloorType(int nNum);
//设置立管楼号
void SetVPipeFloorNum(LPCTSTR lpFloor);
//设置立管文字距引线距离
void SetText2BaseRatio(double dDis);
//得到起点位置
AcGePoint3d GetStartPt();
//得到拐点位置
AcGePoint3d GetTurnPt();
//得到方向向量
AcGeVector3d GetVtDir(); // add by zh 2013-1-6 获得方向向量
//得到立管楼号
void GetVPipeFloorNum(CString &sFloor);
//得到立管楼号类型
int GetVPipeFloorType();
//得到标注的立管的ID
AcDbObjectId GetVPipeId();
//得到立管半径
double GetDimRadius();
//得到立管标注类型文字
void GetDimTypeText(CString &sText);
//得到标注样式
int GetDimType();
//得到标注序号
void GetDimVPipeNum(CString &sNum);
//得到标注文字
void GetDimText(CString &sText);
//得到文字距引线距离
double GetText2BaseRatio();
void GetSheetRowHeight(CString &sData,LPCTSTR lpLable) const;
void SetSheetRowHeight(const TCHAR* szSheetRowHeight,LPCTSTR lpLable);
//存储文字
void SaveCurText();
//得到没有绑定ID的立管编号
void GetNullIdNum(CString &sNum);
//得到没有绑定ID的立管楼号
void GetNullIdFloorNum(CString &sFloor);
//设置标注序号
void SetDimVPipeNum(LPCTSTR lpNum,const AcDbObjectId &id);
//设置立管楼号
void SetVPipeFloorNum(LPCTSTR lpFloor,const AcDbObjectId &id);
//设置标注样式eDimType4管径文字是否显示 cet 2012.4.19 add
void SetShowDnForDimType4(bool bShow);
//标注样式eDimType4管径文字是否显示 cet 2012.4.19 add
bool GetShowDnForDimType4() const;
//设置标注样式eDimType4管径文字的对齐方式 0 左对齐 1 居中 2 右对齐 cet 2012.4.19 add
void SetAlignTypeForDimType4(int nType);
//标注样式eDimType4管径文字的对齐方式 0 左对齐 1 居中 2 右对齐 cet 2012.4.19 add
int GetAlignTypeForDimType4() const;
// zxl 2013.08.22 add 增加第五种标注形式管径标注距离拐点距离, dLen为标注长度(大于原标注长度时起作用)
void SetDnDistance2LabelLoc(double dDist)
{
assertWriteEnabled();
TEntityFields &fd = Fields();
fd.SFD(_T("DIST_DN2LAB"), dDist);
}
double GetDnDistance2LabelLoc() const
{
const TEntityFields &fd = GetFields();
double dDist = 0;
fd.GFD(_T("DIST_DN2LAB"), dDist);
return dDist;
}
// zxl 2013.08.22 add 增加第五种标注形式管径标注与编号之间的距离
void SetDnDistBetweenLabel(double dDist)
{
assertWriteEnabled();
TEntityFields &fd = Fields();
fd.SFD(_T("DIST_DNBETWEENLAB"), dDist);
}
double GetDnDistBetweenLabel() const
{
const TEntityFields &fd = GetFields();
double dDist = 0;
fd.GFD(_T("DIST_DNBETWEENLAB"), dDist);
return dDist;
}
// zxl 2013.08.22 add 增加标注基线长度接口
void SetTextBaseLineLen(double dLen, bool bNeedCompare = true)
{
assertWriteEnabled();
// cet 2014.6.17 modify 增加bNeedCompare参数,用于判断是否需要和原有值比较
if (!bNeedCompare)
{
m_dDimLen = dLen;
}
else if (dLen > m_dDimLen)
{
m_dDimLen = dLen;
}
}
double GetTextBaseLineLen()
{
return m_dDimLen;
}
//得到文字长度
double GetTextLen() const;
public:
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);
//tangent 派生
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
virtual int GetFirstVersion()const{return 8;}
virtual void CopyPropertiesFrom(AcDbEntity *pSrc, unsigned gMatchFlag);
// cet 2016.12.9 add 知道双击文字编辑井编号
virtual TSubText* HitTestText(XPoint pt)const;
virtual void SetSubText(long i, CString sText);
virtual Acad::ErrorStatus subOpen(AcDb::OpenMode mode);
virtual Acad::ErrorStatus subClose();
private:
Acad::ErrorStatus ExplodeOrDraw2dLine(XExplodeDraw &dc) const;
Acad::ErrorStatus ExplodeOrDraw2dText(XExplodeDraw &dc) const;
//得到需要标注的文字
void GetDimText(const AcDbObjectId &id, CString& sText) const;
//得到没有绑定ID的立管标注文字
void GetNullIdText(CString& sText);
private:
//以下两个变量只作临时变量,不写入DWG
CString m_sPipeIndex;
CString m_sFloorNum;
////////////////////////////////////////////////////////////////////////
AcGePoint3d m_ptS; //标注起点
AcGePoint3d m_ptTurn; //标注拐点
AcGeVector3d m_vtDir; //标注方向向量
int m_nDimType; //标注样式
int m_nFloorType; //标注楼号的方式
double m_dDimLen; //标注长度
double m_dRadius; // 1. 标注样式TVPipeDim::eDimType2 圆的半径 2.如何其他样式,本数据存放文字距线距离,默认0.1
AcDbSoftPointerId m_id; //立管ID
CString m_sDimTypeText; //立管类型符号
const static Adesk::UInt8 g_nVersion; //版本控制
double m_dCurScale; //当前比例(临时变量不需要保存)
};
#endif // !defined(AFX_DBVPIPEDIM_H__A4371BF1_B0E2_44A4_BF94_BACB629C7E3A__INCLUDED_)