2026-10-04 00:04:20 +08:00
|
|
|
|
#pragma once
|
2026-09-28 15:28:50 +08:00
|
|
|
|
#include "AecDbSymbWithText.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AecXDbSymbDrawingIndex : public AecXDbSymbWithText
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
ACRX_DECLARE_MEMBERS(AecXDbSymbDrawingIndex);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
const static Adesk::UInt8 g_nVersion;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
2026-10-04 00:04:20 +08:00
|
|
|
|
ADSGePoint3d m_ptCenter; // 圆心
|
|
|
|
|
|
double m_nRadius; // 图纸单位
|
|
|
|
|
|
double m_nLineWidth; // 线粗(图纸单位)
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 文字参数
|
|
|
|
|
|
TCString m_sIndexLabel; // 索引编号
|
|
|
|
|
|
TCString m_sDrawingLabel; // 图号
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 081210、081217、090108,110209
|
|
|
|
|
|
// 是否保留旧的样式:2——随TDbConfig,1——保留,0——不保留,3——出圈样式
|
2026-09-28 15:28:50 +08:00
|
|
|
|
Adesk::UInt8 m_bOldStyle;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
Adesk::UInt8 m_bDrawScale; // 是否绘制比例
|
|
|
|
|
|
AcDbHardPointerId m_idScaleStyle; // 比例样式
|
|
|
|
|
|
TCString m_szScaleText; // 比例文字
|
|
|
|
|
|
double m_dScaleTextHeight; // 比例文字字高
|
|
|
|
|
|
double m_dScaleXDist; // 比例文字距圆心的X方向距离
|
|
|
|
|
|
double m_dTextRatio; // 文字控制大小的比例,0为随TDbConfig
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 090720,8.0正式版增加的临时变量,不保存,处理轴网标注的轴号绘制问题
|
2026-09-28 15:28:50 +08:00
|
|
|
|
BOOL m_bSymbText;
|
|
|
|
|
|
|
|
|
|
|
|
// TArch9 Data
|
2026-10-04 00:04:20 +08:00
|
|
|
|
double m_dScaleYDist; // sg add 120110,比例文字距圆心的Y方向距离
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
AecXDbSymbDrawingIndex();
|
|
|
|
|
|
~AecXDbSymbDrawingIndex();
|
|
|
|
|
|
virtual BOOL IsValid() const;
|
|
|
|
|
|
//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 subGetGripPoints(AcDbGripDataPtrArray& grips,
|
|
|
|
|
|
const double curViewUnitSize,
|
|
|
|
|
|
const int gripSize,
|
|
|
|
|
|
const AcGeVector3d& curViewDir,
|
|
|
|
|
|
const int bitflags) const;
|
|
|
|
|
|
virtual Acad::ErrorStatus subGetStretchPoints(AcGePoint3dArray & stretchPoints) const;
|
|
|
|
|
|
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 120110,根据9.0需求,增加了一个夹点,需要重载这2个函数
|
2026-09-28 15:28:50 +08:00
|
|
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
|
|
|
|
|
const AcGeVector3d& offset);
|
|
|
|
|
|
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
|
|
|
|
|
const AcGeVector3d& offset);
|
|
|
|
|
|
|
|
|
|
|
|
public: // drived from TDbEntity
|
2026-10-04 00:04:20 +08:00
|
|
|
|
virtual void GetTips(PtrList<ObjInfoUnit> &) const; // 取动态属性显示数据
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual Acad::ErrorStatus Draw2d(AcGiDraw &dc) const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual int ConvertText(TConvertTextPtr ptr, void *pData = NULL);
|
|
|
|
|
|
|
|
|
|
|
|
virtual long GetSubTextNum()const { return (!!m_sDrawingLabel) ? 2 : 1; }//ok
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg modify 081218,将该函数的实现放到了CPP中
|
2026-09-28 15:28:50 +08:00
|
|
|
|
// virtual void SetSubText(long i, CString sText) {if(i==0)SetIndexLabel(sText);else SetDrawingLabel(sText);}//ok
|
|
|
|
|
|
virtual void SetSubText(long i, CString sText);
|
|
|
|
|
|
virtual SubText* HitTestText(ADSGePoint3d pt)const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual const TCHAR *GetDefaultLayer() const;
|
|
|
|
|
|
|
|
|
|
|
|
//virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// BOOL *bErase); // sg add 081223,导出低版本
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 090203,查找替换
|
2026-09-28 15:28:50 +08:00
|
|
|
|
BOOL GetText(Adesk::UInt32 cookies, AecXDbText &text) const;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 返回发现的位置,同时posStart往前移动(以便继续找下一个使用)
|
2026-09-28 15:28:50 +08:00
|
|
|
|
virtual TextPosition FindSubText(const TCHAR *sSubText, TextPosition &posStart,
|
|
|
|
|
|
TextRange *pRange = NULL) const;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 返回下一次查找的开始位置
|
2026-09-28 15:28:50 +08:00
|
|
|
|
virtual TextPosition ReplaceSubText(const TextPosition &posRep,
|
|
|
|
|
|
const TCHAR *sRepText, TextRange *pRange = NULL);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 110211,支持统一标高
|
2026-09-28 15:28:50 +08:00
|
|
|
|
virtual bool UnifyElevation(double dElevation = 0.0);
|
|
|
|
|
|
|
|
|
|
|
|
public: // Properties
|
|
|
|
|
|
const TCHAR *GetIndexLabel() const;
|
|
|
|
|
|
void SetIndexLabel(const TCHAR *pszText);
|
|
|
|
|
|
const TCHAR *GetDrawingLabel() const;
|
|
|
|
|
|
void SetDrawingLabel(const TCHAR *pszText);
|
|
|
|
|
|
|
|
|
|
|
|
ADSGePoint3d GetCenter() const;
|
|
|
|
|
|
void SetCenter(ADSGePoint3d pt);
|
|
|
|
|
|
double GetRadius(BOOL bAsPaperUnit = TRUE) const;
|
|
|
|
|
|
void SetRadius(double val, BOOL bAsPaperUnit = TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
double GetLineWidth() const;
|
|
|
|
|
|
void SetLineWidth(double val);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 将文字位置点提供给国际分轴号使用
|
2026-09-28 15:28:50 +08:00
|
|
|
|
double GetTextParam1(ADSGePoint3d &pt1, ADSGePoint3d &pt2) const;
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 081210,sg add 081217
|
2026-09-28 15:28:50 +08:00
|
|
|
|
BOOL IsDrawScale() const;
|
|
|
|
|
|
void SetDrawScale(BOOL bDraw);
|
|
|
|
|
|
TCString GetScaleText() const;
|
|
|
|
|
|
void SetScaleText(const TCString &szScaleText);
|
|
|
|
|
|
AcDbObjectId GetScaleStyleId() const;
|
|
|
|
|
|
void SetScaleStyleId(const AcDbObjectId &idScaleStyle);
|
|
|
|
|
|
double GetScaleTextHeight() const;
|
|
|
|
|
|
void SetScaleTextHeight(double dVal);
|
|
|
|
|
|
|
|
|
|
|
|
double GetScaleXDist(BOOL bAsPaperUnit = TRUE) const;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg modify 120110,修改接口,增加出图比例的设置
|
2026-09-28 15:28:50 +08:00
|
|
|
|
// void SetScaleXDist(double dVal, BOOL bAsPaperUnit = TRUE);
|
|
|
|
|
|
void SetScaleXDist(double dVal, BOOL bAsPaperUnit = TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
// sg add 090108
|
|
|
|
|
|
void SetOldStyle(int nDraw);
|
|
|
|
|
|
int GetOldStyle() const;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 是否保留旧的样式,考虑基本设定
|
2026-09-28 15:28:50 +08:00
|
|
|
|
BOOL IsOldStyle() const;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 110209,获得圆圈文字样式,考虑了随基本设定的情况
|
2026-09-28 15:28:50 +08:00
|
|
|
|
int GetTrueTextStyle() const;
|
|
|
|
|
|
|
|
|
|
|
|
// sg add 090115
|
2026-10-04 00:04:20 +08:00
|
|
|
|
double GetTextRatio() const; // 文字控制大小的比例
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void SetTextRatio(double dVal);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 090720,8.0正式版增加的临时变量,不保存,处理轴网标注的轴号绘制问题
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void SetSymbText(BOOL bSymbText);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 120110,比例文字距圆心的Y方向距离
|
2026-09-28 15:28:50 +08:00
|
|
|
|
double GetScaleYDist(BOOL bAsPaperUnit = TRUE) const;
|
|
|
|
|
|
void SetScaleYDist(double dVal, BOOL bAsPaperUnit = TRUE);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 120110,直接提供接口,设置比例文字位置,但是内部保存的还是m_dScaleXDist和m_dScaleYDist
|
2026-09-28 15:28:50 +08:00
|
|
|
|
ADSGePoint3d GetScaleTextPt() const;
|
|
|
|
|
|
void SetScaleTextPt(ADSGePoint3d pt);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// sg add 120110,获得比例文字默认的文字位置
|
2026-09-28 15:28:50 +08:00
|
|
|
|
ADSGePoint3d GetDefaultScaleTextLocation() const;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
void GetTextExtends(const TCHAR *sText, double &dX, double &dY,
|
|
|
|
|
|
BOOL bDrawingLabel = FALSE) const;
|
|
|
|
|
|
};
|
|
|
|
|
|
|