219 lines
5.3 KiB
C++
219 lines
5.3 KiB
C++
#if !defined(AFX_DBPUMP_H__B50AFD27_FC38_4A9B_8485_175E0B471478__INCLUDED_)
|
|
#define AFX_DBPUMP_H__B50AFD27_FC38_4A9B_8485_175E0B471478__INCLUDED_
|
|
|
|
#include "DbEquipment.h"
|
|
class CDbFireExtinguisher: public AecXDbEntityBaseEx
|
|
{
|
|
public:
|
|
ACRX_DECLARE_MEMBERS(CDbFireExtinguisher);
|
|
public:
|
|
CDbFireExtinguisher();
|
|
|
|
private:
|
|
|
|
bool m_bUp; // 文字是否在上方(按数量布置时使用)
|
|
double m_dTextHeight; // 字高
|
|
AcDbHardPointerId m_idTextStyle; // 文字样式
|
|
Adesk::Int32 m_nLayType; // 布置方式
|
|
double m_dProtectRadius; // 保护半径
|
|
Adesk::Int32 m_nNum; // 灭火器数量
|
|
bool m_bDim; // 是否标注
|
|
XString m_sSpec; // 规格
|
|
AcGePoint3d m_ptLabel;
|
|
XString m_sGrade; // 等级
|
|
Adesk::Int32 m_nScaleType; // 比例缩放类型:0随当前比例缩放,1固定比例
|
|
AcDbHardPointerId m_idTextLayer;
|
|
double m_dTextAngle;
|
|
AcGiViewDraw::TextAlignment m_align;
|
|
XPoint m_ptLocation; // 位置点
|
|
double m_dScale; // 图块显示比例
|
|
AcDbHardPointerId m_idBlock2d; // 二维图块
|
|
XVector3D m_vtDirection; // 图块方向
|
|
Adesk::UInt8 m_nMirror; // 图块镜像
|
|
public:
|
|
void SetTextLayer(AcDbObjectId id);
|
|
AcDbObjectId GetTextLayer()
|
|
{
|
|
return m_idTextLayer;
|
|
}
|
|
|
|
void SetLabelLoc(AcGePoint3d pt);
|
|
AcGePoint3d GetLabelLoc()
|
|
{
|
|
return m_ptLabel;
|
|
}
|
|
// 按数量布置灭火器时,文字在灭火器上方或下方
|
|
void SetDimTextPos(bool bUp = true);
|
|
bool GetDimTextPos()
|
|
{
|
|
assertReadEnabled();
|
|
return m_bUp;
|
|
}
|
|
// 字高
|
|
void SetTextHeight(double dHeight);
|
|
double GetTextHeight()
|
|
{
|
|
assertReadEnabled();
|
|
return m_dTextHeight;
|
|
}
|
|
// 布置方式 0 按数量布置 1 单布
|
|
void SetLayType(int nLayType);
|
|
int GetLayType()
|
|
{
|
|
assertReadEnabled();
|
|
return m_nLayType;
|
|
}
|
|
// 保护半径
|
|
void SetProtectRadius(double dRadius);
|
|
double GetProtectRadius()
|
|
{
|
|
assertReadEnabled();
|
|
return m_dProtectRadius;
|
|
}
|
|
// 文字样式
|
|
void SetTextStyleId(AcDbObjectId id);
|
|
AcDbObjectId GetTextStyleId()
|
|
{
|
|
assertReadEnabled();
|
|
return m_idTextStyle;
|
|
}
|
|
// 灭火器数量
|
|
void SetNum(int nNum);
|
|
int GetNum()
|
|
{
|
|
assertReadEnabled();
|
|
return m_nNum;
|
|
}
|
|
// 是否标注
|
|
void SetIsDim(bool bDim);
|
|
bool GetIsDim()
|
|
{
|
|
assertReadEnabled();
|
|
return m_bDim;
|
|
}
|
|
// 规格
|
|
void SetSpec(CString sSpec);
|
|
CString GetSpec()
|
|
{
|
|
assertReadEnabled();
|
|
return CString(m_sSpec);
|
|
}
|
|
// 等级
|
|
void SetGrade(CString sGrade);
|
|
CString GetGrade()
|
|
{
|
|
assertReadEnabled();
|
|
return CString(m_sGrade);
|
|
}
|
|
void SetScaleType(int nType);
|
|
int GetScaleType()
|
|
{
|
|
assertReadEnabled();
|
|
return m_nScaleType;
|
|
}
|
|
|
|
void SetTextRotation(double dAngle);
|
|
double GetTextRotation()
|
|
{
|
|
assertReadEnabled();
|
|
return m_dTextAngle;
|
|
}
|
|
void SetTextAlignment(AcGiDraw::TextAlignment align);
|
|
AcGiDraw::TextAlignment GetTextAlignment()
|
|
{
|
|
assertReadEnabled();
|
|
return m_align;
|
|
}
|
|
|
|
int GetSpecificationType()
|
|
{
|
|
assertReadEnabled();
|
|
const EntityFields &fd = GetFields();
|
|
Adesk::Int8 nType;
|
|
fd.GFD(_T("FIRE_SPECIFICATIONTYPE"), nType);
|
|
return nType;
|
|
}
|
|
void SetSpecificationType(Adesk::Int8 nType)
|
|
{
|
|
assertWriteEnabled();
|
|
EntityFields &fd = Fields();
|
|
fd.SFD(_T("FIRE_SPECIFICATIONTYPE"), nType);
|
|
}
|
|
double GetAngle() const
|
|
{
|
|
return ads_angle(XPoint(),m_vtDirection);
|
|
}
|
|
void SetDirection(const XVector3D &vt)
|
|
{
|
|
assertWriteEnabled();
|
|
m_vtDirection=vt;
|
|
}
|
|
void SetAngle(double dAngle)
|
|
{
|
|
SetDirection(XVector3D(cos(dAngle),sin(dAngle),0));
|
|
}
|
|
double GetScale() const
|
|
{
|
|
return m_dScale;
|
|
}
|
|
void SetScale(double dScale=1.0)
|
|
{
|
|
assertWriteEnabled();
|
|
m_dScale=dScale;
|
|
}
|
|
AcDbObjectId GetBlock2d() const
|
|
{
|
|
return m_idBlock2d;
|
|
}
|
|
void SetBlock2d(const AcDbObjectId &id)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idBlock2d=id;
|
|
}
|
|
XPoint GetLocation() const
|
|
{
|
|
return m_ptLocation;
|
|
}
|
|
void SetLocation(const XPoint &pt)
|
|
{
|
|
assertWriteEnabled();
|
|
m_ptLocation=pt;
|
|
}
|
|
// 设备(图块)X、Y轴的镜像,X轴方向为m_vtDirection方向
|
|
void MirrorByX(BOOL bFlag=TRUE);
|
|
void MirrorByY(BOOL bFlag=TRUE);
|
|
BOOL IsMirrorByX() const
|
|
{
|
|
return (m_nMirror&MIRROR_XAXIS)!=0;
|
|
}
|
|
BOOL IsMirrorByY() const
|
|
{
|
|
return (m_nMirror&MIRROR_YAXIS)!=0;
|
|
}
|
|
// cet 2014.7.23 add 单布标注时文字格式类型(0:数量-型号规格 1:型号规格×数量)
|
|
int GetTextFormatType() const;
|
|
void SetTextFormatType(int nType);
|
|
public: // Override TDbEquipment
|
|
|
|
virtual void CopyPropertiesFrom(AcDbEntity *pSrc, unsigned gMatchFlag);
|
|
virtual Acad::ErrorStatus Draw2d(AcGiDraw &dc) const;
|
|
virtual Acad::ErrorStatus GetGripText(int idx, CString &cs) const;
|
|
virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints,
|
|
AcDbIntArray& osnapModes,
|
|
AcDbIntArray& geomIds) const;
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
|
const AcGeVector3d& offset);
|
|
Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
|
virtual SubText* HitTestText(XPoint pt)const {return NULL;};
|
|
|
|
public: // Override AcDbEntity
|
|
virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
|
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
|
virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*);
|
|
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
|
|
private:
|
|
// cet 2014.7.23 add 单布标注时标注文字
|
|
CString GetDimText() const;
|
|
};
|
|
|
|
#endif |