1944 lines
74 KiB
C++
1944 lines
74 KiB
C++
#ifndef __DBSYMBOLANNOTATE_H
|
||
#define __DBSYMBOLANNOTATE_H
|
||
//#include "DbEntity.h"
|
||
|
||
class TDbText;
|
||
// 文字样式应当有全局的设定, 其中包括默认的文字高度
|
||
|
||
// 符号标注基类
|
||
class TARCH_EXP TDbSymbWithText: public TDbEntity
|
||
{
|
||
private:
|
||
void *operator new[](size_t nSize) { return 0; }
|
||
void operator delete[](void *p) {};
|
||
void *operator new[](size_t nSize, const TCHAR *file, int line) { return 0; }
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
// 文字参数
|
||
AcDbHardPointerId m_idTextStyle; // 文字样式
|
||
double m_nTextHeight;
|
||
// TArch6 member
|
||
double m_nTextRotation; // 旋转角度,目前只有标高用到
|
||
AcDbHardPointerId m_idTextLayer;
|
||
|
||
// TArch7
|
||
Adesk::UInt16 m_colorText; // 文字颜色
|
||
|
||
public:
|
||
ACRX_DECLARE_MEMBERS(TDbSymbWithText);
|
||
TDbSymbWithText();
|
||
~TDbSymbWithText();
|
||
virtual BOOL IsValid() const;
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet, BOOL *bErase);
|
||
|
||
// virtual Acad::ErrorStatus getClassID(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 subTransformBy(const AcGeMatrix3d& xform);
|
||
|
||
// drived from TDbEntity
|
||
virtual DrawType GetDrawType() const;
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
|
||
// Properties
|
||
double GetTextHeight() const;
|
||
AcDbObjectId GetTextStyleId() const;
|
||
AcDbObjectId GetTextLayerId() const;
|
||
void SetTextHeight(double nHeight);
|
||
void SetTextStyleId(AcDbObjectId id);
|
||
void SetTextLayerId(AcDbObjectId id);
|
||
void SetTextRotation(double nRot);
|
||
double GetTextRotation() const;
|
||
BOOL IsTextRotated() const {
|
||
return (fabs(m_nTextRotation)>_angSnap);
|
||
}
|
||
|
||
// sg add 090608,增加颜色设置接口
|
||
void SetTextColor(Adesk::UInt16 color)
|
||
{
|
||
assertWriteEnabled();
|
||
m_colorText = color;
|
||
}
|
||
Adesk::UInt16 GetTextColor() const
|
||
{
|
||
return m_colorText;
|
||
}
|
||
};
|
||
|
||
|
||
////////////////////////////////////////////////////////////
|
||
// 做法标注
|
||
class TARCH_EXP TDbSymbComposing: public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbComposing);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
public:
|
||
//axc add 2015-07-20 add arrow style for telec
|
||
enum TArrowStyle { eNone = 0,eDot = 1, eSortLine = 2 };
|
||
protected:
|
||
Adesk::UInt8 m_bSideText; // 文字在基线边上, 还是在基线上方
|
||
XPoint m_ptStart, m_ptTurn;
|
||
XString m_sText; // 由回车符隔开
|
||
double m_nTextBaseLen; // 左右由正负控制(不乘字高)
|
||
|
||
// sg add 080904,8.0新需求
|
||
double m_dLineSpace; // 行距系数(需要乘字高)
|
||
double m_dParagraphSpace; // 段距系数(需要乘字高)
|
||
double m_dPageWidth; // 页宽(不乘字高),注:左右由正负控制,0为单行文字
|
||
double m_dDist2Line; // 文字距离基线(在线端)或引线(在线上)的距离(需要乘字高)
|
||
// 左右由正负控制
|
||
TArrowStyle m_arrowStyle; //箭头标记 axc add 2015--7-20
|
||
|
||
// sg add 081023,8.0新需求2
|
||
double m_dText2BaseRatio; // 文字距基线系数(需要乘字高)
|
||
XExplodeDraw::TextAlignment m_nAlignment; // 文字对齐方式
|
||
|
||
bool m_bIsStretch; // add by xly on 101228 标记夹点操作是否是拉伸操作
|
||
public:
|
||
TDbSymbComposing();
|
||
~TDbSymbComposing();
|
||
|
||
TArrowStyle GetArrowStyle() const;
|
||
void SetArrowStyle(TArrowStyle arrowStyle);
|
||
void SetArrowSize(double dArrowSize = 3.5, BOOL bAsPaperUni = TRUE);
|
||
double GetArrowSize(BOOL bAsPaperUnit=TRUE) 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 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 Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase); // sg add 080910
|
||
|
||
virtual int ConvertText(TConvertTextPtr ptr, void *pData = NULL);
|
||
|
||
BOOL GetText(Adesk::UInt32 cookies, TDbText &text) const;
|
||
// 返回发现的位置,同时posStart往前移动(以便继续找下一个使用)
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText, TTextPosition &posStart, TTextRange *pRange=NULL) const;
|
||
// 返回下一次查找的开始位置
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep, const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
|
||
virtual long GetSubTextNum()const{XStringList sList;GetTexts(sList);return sList.Length();}//ok
|
||
virtual TSubText* GetSubText(long iText)const;
|
||
virtual TSubText* HitTestText(XPoint pt)const;
|
||
virtual void SetSubText(long i, CString sText);
|
||
|
||
// sg add 101221,支持夹点ctrl功能切换
|
||
virtual int GetCtrlToggleIndex()const { return 7; }
|
||
|
||
// sg add 110211,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
// Helper Method
|
||
double GetDefaultTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetMinTextBaseLen(BOOL bAsPaperUnit) const;
|
||
|
||
// Properties
|
||
const TCHAR *GetText() const;
|
||
XPoint GetStartPoint() const;
|
||
XPoint GetTurnPoint() const;
|
||
XPoint GetEndPoint() const;
|
||
double GetTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
BOOL IsSideText() const;
|
||
void GetTexts(XStringList &lstTexts) const;
|
||
|
||
void SetText(const TCHAR *pszText);
|
||
void SetStartPoint(XPoint pt);
|
||
void SetTurnPoint(XPoint pt);
|
||
void SetTextBaseLen(double nVal, BOOL bAsPaperUnit=TRUE);
|
||
void SetSideText(BOOL bTrue);
|
||
|
||
// sg add 080904,sg modify 081023
|
||
// bRealDist用来控制,需要返回的是“实际距离”(自动乘过字高)或“系数”
|
||
double GetParagraphSpace(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
double GetLineSpace(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
double GetText2BaseRatio(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
double GetDist2Line(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
double GetPageWidth(BOOL bAsPaperUnit = TRUE) const;
|
||
XExplodeDraw::TextAlignment GetAlignment() const;
|
||
|
||
void SetParagraphSpace(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
void SetLineSpace(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
void SetText2BaseRatio(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
void SetDist2Line(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
// 注:当设置的宽度为0时,表示单行显示,用默认最小的宽度
|
||
void SetPageWidth(double dVal = 0, BOOL bAsPaperUnit = TRUE);
|
||
void SetAlignment(XExplodeDraw::TextAlignment nAlign);
|
||
|
||
BOOL IsText() const; // 是否是单行文字
|
||
|
||
// sg add 081104,根据线长的正负符号,获得其他距离的正负符号、单行文字的默认对齐方式
|
||
double GetDistSymbol() const;
|
||
void SetAlignBySymbol();
|
||
|
||
// add by xly on 100928 动态数据的写入
|
||
bool HasOtherPoint() const; // 判断是否有其他标注点
|
||
|
||
void AddDotLoc(const AcGePoint3d &ptLoc); // 向动态数据中添加一点
|
||
void GetAllDots(AcGePoint3dArray &lstPts) const; // 获得动态数据
|
||
bool SetDotLoc(long lIndex, const AcGePoint3d &ptLoc); // 设置数组索引为lIndex的数据
|
||
bool DelDotLoc(long lIndex); // 删除数组索引为lIndex的数据
|
||
void SetAllDots(const AcGePoint3dArray &aryPts); // 一次行修改全部动态数据
|
||
|
||
void SetCirPointSize(double dVal); // 设置圆点的大小
|
||
double GetCirPointSize()const; // 获得圆点的大小
|
||
|
||
|
||
// sg add 101221,增加“圆点标注数量”的动态数据,加快夹点操作速度
|
||
void PlusDotsNum(Adesk::UInt16 nPlusNum = 1); // 自增
|
||
void SetDotsNum(Adesk::UInt16 nNum); // 设置
|
||
Adesk::UInt16 GetDotsNum() const; // 获取
|
||
|
||
protected:
|
||
// add by xly 100920 当端点和拐点移动时,其他夹点的联动,bIsTurn=1以转折点为定位点,否则以端头点为定位点
|
||
void MoveOtherGrip(AcGePoint3d ptStartBefor, bool bIsTurn=true);
|
||
int FindAryData(AcGeIntArray aryInt, int nData);// add by xly on 110309 查找数组中的元素,返回位置值
|
||
// add by xly on 110310 拉伸时移动没有框选到的其他夹点 aryInt存放拉伸的夹点的索引
|
||
void MoveOtherPoint(AcGeIntArray aryInt, bool bTurnPtBase);
|
||
void SortAyry(AcGeIntArray &aryInt);// add by xly on 110310为数组中的元素排序
|
||
};
|
||
|
||
|
||
/////////////////////////////////////////////////////////////
|
||
// 详图索引
|
||
class TARCH_EXP TDbSymbDrawingIndex: public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbDrawingIndex);
|
||
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
|
||
protected:
|
||
XPoint m_ptCenter; // 圆心
|
||
double m_nRadius; // 图纸单位
|
||
double m_nLineWidth; // 线粗(图纸单位)
|
||
|
||
// 文字参数
|
||
XString m_sIndexLabel; // 索引编号
|
||
XString m_sDrawingLabel; // 图号
|
||
|
||
// sg add 081210、081217、090108,110209
|
||
// 是否保留旧的样式:2——随TDbConfig,1——保留,0——不保留,3——出圈样式
|
||
Adesk::UInt8 m_bOldStyle;
|
||
Adesk::UInt8 m_bDrawScale; // 是否绘制比例
|
||
AcDbHardPointerId m_idScaleStyle; // 比例样式
|
||
XString m_szScaleText; // 比例文字
|
||
double m_dScaleTextHeight; // 比例文字字高
|
||
double m_dScaleXDist; // 比例文字距圆心的X方向距离
|
||
double m_dTextRatio; // 文字控制大小的比例,0为随TDbConfig
|
||
|
||
// sg add 090720,8.0正式版增加的临时变量,不保存,处理轴网标注的轴号绘制问题
|
||
BOOL m_bSymbText;
|
||
|
||
// TArch9 Data
|
||
double m_dScaleYDist; // sg add 120110,比例文字距圆心的Y方向距离
|
||
|
||
public:
|
||
TDbSymbDrawingIndex();
|
||
~TDbSymbDrawingIndex();
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
|
||
// sg add 120110,根据9.0需求,增加了一个夹点,需要重载这2个函数
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
public: // 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 int ConvertText(TConvertTextPtr ptr, void *pData = NULL);
|
||
|
||
virtual long GetSubTextNum()const{return (!!m_sDrawingLabel)?2:1;}//ok
|
||
// sg modify 081218,将该函数的实现放到了CPP中
|
||
// virtual void SetSubText(long i, CString sText) {if(i==0)SetIndexLabel(sText);else SetDrawingLabel(sText);}//ok
|
||
virtual void SetSubText(long i, CString sText);
|
||
virtual TSubText* HitTestText(XPoint pt)const;
|
||
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase); // sg add 081223,导出低版本
|
||
|
||
// sg add 090203,查找替换
|
||
BOOL GetText(Adesk::UInt32 cookies, TDbText &text) const;
|
||
// 返回发现的位置,同时posStart往前移动(以便继续找下一个使用)
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText, TTextPosition &posStart,
|
||
TTextRange *pRange=NULL) const;
|
||
// 返回下一次查找的开始位置
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep,
|
||
const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
|
||
// sg add 110211,支持统一标高
|
||
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);
|
||
|
||
XPoint GetCenter() const;
|
||
void SetCenter(XPoint pt);
|
||
double GetRadius(BOOL bAsPaperUnit=TRUE) const;
|
||
void SetRadius(double val, BOOL bAsPaperUnit=TRUE);
|
||
|
||
double GetLineWidth() const;
|
||
void SetLineWidth(double val);
|
||
|
||
// 将文字位置点提供给国际分轴号使用
|
||
double GetTextParam1(XPoint &pt1, XPoint &pt2) const;
|
||
|
||
// sg add 081210,sg add 081217
|
||
BOOL IsDrawScale() const;
|
||
void SetDrawScale(BOOL bDraw);
|
||
XString GetScaleText() const;
|
||
void SetScaleText(const XString &szScaleText);
|
||
AcDbObjectId GetScaleStyleId() const;
|
||
void SetScaleStyleId(const AcDbObjectId &idScaleStyle);
|
||
double GetScaleTextHeight() const;
|
||
void SetScaleTextHeight(double dVal);
|
||
|
||
double GetScaleXDist(BOOL bAsPaperUnit = TRUE) const;
|
||
// sg modify 120110,修改接口,增加出图比例的设置
|
||
// void SetScaleXDist(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
void SetScaleXDist(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// sg add 090108
|
||
void SetOldStyle(int nDraw);
|
||
int GetOldStyle() const;
|
||
// 是否保留旧的样式,考虑基本设定
|
||
BOOL IsOldStyle() const;
|
||
// sg add 110209,获得圆圈文字样式,考虑了随基本设定的情况
|
||
int GetTrueTextStyle() const;
|
||
|
||
// sg add 090115
|
||
double GetTextRatio() const; // 文字控制大小的比例
|
||
void SetTextRatio(double dVal);
|
||
|
||
// sg add 090720,8.0正式版增加的临时变量,不保存,处理轴网标注的轴号绘制问题
|
||
void SetSymbText(BOOL bSymbText);
|
||
|
||
// sg add 120110,比例文字距圆心的Y方向距离
|
||
double GetScaleYDist(BOOL bAsPaperUnit = TRUE) const;
|
||
void SetScaleYDist(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// sg add 120110,直接提供接口,设置比例文字位置,但是内部保存的还是m_dScaleXDist和m_dScaleYDist
|
||
XPoint GetScaleTextPt() const;
|
||
void SetScaleTextPt(XPoint pt);
|
||
|
||
// sg add 120110,获得比例文字默认的文字位置
|
||
XPoint GetDefaultScaleTextLocation() const;
|
||
|
||
private:
|
||
void GetTextExtends(const TCHAR *sText, double &dX, double &dY,
|
||
BOOL bDrawingLabel = FALSE) const;
|
||
};
|
||
|
||
// sg add 101209
|
||
extern TARCH_IMPEXP double g_dIndexPointerBaseLen; // 索引符号延长线的默认长度
|
||
extern TARCH_IMPEXP double g_dSectionBaseLen; // 剖切索引剖切线的默认长度
|
||
|
||
////////////////////////////////////////////////////////////
|
||
// 索引标注夹点示意图
|
||
// 如下示意图,*代表夹点, Q代表图号标注,只有两段索引线的时候,少去gAdd,其他不变
|
||
// (gAdd) (g1)
|
||
// *-------------*
|
||
// |
|
||
// |
|
||
// | Text
|
||
// *-------------*①①①①*--------*
|
||
// (g2) Text (g3) (g4) (g5)
|
||
|
||
// 指向索引/剖切索引
|
||
class TARCH_EXP TDbSymbIndexPointer: public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbIndexPointer);
|
||
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
|
||
public:
|
||
// sg add 090217,文字对齐方式
|
||
enum TSymbIPTextAlign { kAtStart=1, kAtMiddle=2, kAtEnd=3, };
|
||
|
||
protected:
|
||
Adesk::UInt8 m_nFlag; // 0--指向; 1--剖切
|
||
|
||
XPoint m_ptStart, m_ptTurn; // g1点和g2点
|
||
double m_nRadius; // 索引号半径,图纸尺寸
|
||
double m_nTextBaseLen; // 图纸单位, 可以为负数
|
||
double m_nSourceExtent; // 指向,详图区域的直径;剖切,剖视方向
|
||
|
||
// 文字参数
|
||
XString m_sText1; // 文字说明1
|
||
XString m_sText2; // 文字说明2
|
||
XString m_sIndexLabel; // 索引编号
|
||
XString m_sDrawingLabel; // 图号
|
||
|
||
// TArch7
|
||
DList<XString> m_lstIndex;
|
||
DList<XString> m_lstLabel;
|
||
|
||
// TArch8,预留给8.0的BETA2版本
|
||
double m_dText2BaseRatio; // 文字距基线系数,sg add 081112
|
||
TSymbIPTextAlign m_nTextAlign; // 文字对齐方式,sg add 090217
|
||
// 引线的角度,注:圆上任意点指向圆心的方向,与X轴正向夹角
|
||
double m_dLineAngle;
|
||
// 8.5使用它来存储多段剖切线,m_poly中的点代表剖切线的起点,Bulge代表引出线的相对长度
|
||
XPoly2D m_polyCutLine;
|
||
// lgh modify 101227 这个数据被使用来表示索引延长线的长度 (g4 - g5)
|
||
double m_dTextBaseLen2; // 规范6.22图4中,索引符号左侧文字线长,可以为负数
|
||
XString m_szText3; // 索引图名符号左侧文字内容
|
||
|
||
public:
|
||
TDbSymbIndexPointer();
|
||
~TDbSymbIndexPointer();
|
||
|
||
public:
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
public:
|
||
// drived from TDbEntity
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase);
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
|
||
virtual void GetTips(DList<TObjInfoUnit> &) const; // 取动态属性显示数据
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
|
||
virtual int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
||
// 返回发现的位置,同时posStart往前移动(以便继续找下一个使用),
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText,
|
||
TTextPosition &posStart, TTextRange *pRange=NULL) const;
|
||
// 返回下一次查找的开始位置
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep,
|
||
const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
|
||
virtual long GetSubTextNum()const{return 4+GetAppendIndexNum()*2;}
|
||
virtual void SetSubText(long i,CString sText);
|
||
virtual TSubText* HitTestText(XPoint pt)const;
|
||
virtual TSubText* GetSubText(long iText)const;
|
||
virtual long GetNextSubTextIndex(long i,bool bVert,bool bPre)const; // ok
|
||
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
|
||
// sg add 090323
|
||
virtual int GetCtrlToggleIndex()const { return 6; }
|
||
|
||
// sg add 110211,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
public: // Helper Method
|
||
// 返回值为绝对值
|
||
double GetMinTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetDefaultTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
|
||
public: // Properties
|
||
const TCHAR *GetText1() const;
|
||
void SetText1(const TCHAR *pszText);
|
||
const TCHAR *GetText2() const;
|
||
void SetText2(const TCHAR *pszText);
|
||
|
||
const TCHAR *GetIndexLabel() const;
|
||
void SetIndexLabel(const TCHAR *pszText);
|
||
const TCHAR *GetDrawingLabel() const;
|
||
void SetDrawingLabel(const TCHAR *pszText);
|
||
|
||
XPoint GetStartPoint() const;
|
||
void SetStartPoint(XPoint pt);
|
||
XPoint GetTurnPoint() const;
|
||
void SetTurnPoint(XPoint pt);
|
||
|
||
double GetTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
void SetTextBaseLen(double nVal, BOOL bAsPaperUnit=TRUE);
|
||
|
||
double GetRadius(BOOL bAsPaperUnit=TRUE) const;
|
||
void SetRadius(double val, BOOL bAsPaperUnit=TRUE);
|
||
|
||
double GetSourceExtent() const; // Use Model Unit
|
||
void SetSourceExtent(double val); // Use Model Unit
|
||
|
||
BOOL IsIndexPointer() const;
|
||
void SetIndexPointer(BOOL bTrue);
|
||
|
||
// sg add 081112,bRealDist用来控制,返回“实际距离”(自动乘字高)或“系数”
|
||
double GetText2BaseRatio(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
void SetText2BaseRatio(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// sg add 090217,预留给8.0的BETA2版本
|
||
TSymbIPTextAlign GetTextAlign() const;
|
||
void SetTextAlign(TSymbIPTextAlign align);
|
||
|
||
double GetLineAngle() const;
|
||
void SetLineAngle(double dVal);
|
||
|
||
void GetPoly2D(XPoly2D &poly) const;
|
||
void SetPoly2D(const XPoly2D &poly);
|
||
|
||
double GetTextBaseLen2() const;
|
||
void SetTextBaseLen2(double dVal);
|
||
|
||
const TCHAR *GetText3() const;
|
||
void SetText3(const TCHAR *pszText);
|
||
|
||
// sg add 090410,支持文字控制大小的比例,间接设置TDbSymbDrawingIndex,动态数据
|
||
double GetTextRatio(BOOL bDraw = FALSE) const;
|
||
void SetTextRatio(double dVal);
|
||
|
||
// sg add 090723,支持使用新、旧圆圈文字样式,动态数据
|
||
void SetOldStyle(int nOldStyle);
|
||
int GetOldStyle() const;
|
||
BOOL IsOldStyle() const; // 是否保留旧的样式
|
||
|
||
public:
|
||
// lgh add.
|
||
// 8.5的修改使用扩展数据添加以下几个属性:
|
||
// 文字样式(标注的)
|
||
// 标志延长线数据 -->使用预留数据
|
||
// 多加一段引出线(点) (gAdd)
|
||
// 多段剖切线
|
||
typedef CArray<int, int&> AryInt;
|
||
typedef CArray<XPoint, XPoint&> AryXPoint;
|
||
typedef CArray<XLine, XLine&> AryXLine;
|
||
typedef AryXPoint AryXVector;
|
||
|
||
// 8.5新增扩展数据的读写以及操作函数
|
||
// 标注文字样式的读写
|
||
void SetDimTextStyle(const AcDbObjectId &id);
|
||
AcDbObjectId GetDimTextStyle() const;
|
||
|
||
// 引出线的点(gAdd)对应顺序如下:
|
||
void SetAddedPoint(const XPoint &ptAdded);
|
||
bool GetAddedPoint(XPoint &ptAdded) const;
|
||
void ClearAddedPoint();
|
||
bool HasAddedPoint() const;
|
||
|
||
// 多段剖切线相关读写
|
||
// 第一根剖切线仍旧按照原先的格式
|
||
// 新添加的剖切线使用下面函数添加.
|
||
// 剖切线:起点,长度, 起点,长度....
|
||
// 剖切线的起点记录的是在引线上的点,
|
||
// 因此在绘制的时候,根据剖切线的方向做相应的偏移。改变剖切方向,这些点不需要改变。
|
||
// 返回剖切线的个数。(不包括第一段剖切线)
|
||
int GetCutLineNum() const;
|
||
// 重新设置动态数据中的剖切线,不会修正第一段剖切线,内部会针对剖切线排序
|
||
void SetCutLine(AryXLine &arCutLines);
|
||
// 获得所有的剖切线,包括第一段
|
||
int GetCutLineAll(AryXLine &arCutLines) const;
|
||
// 清空剖切线
|
||
void ClearCutLine();
|
||
|
||
// 标注位置:标注在原文字基线上,还是在延长线上
|
||
// nFlag: 0,基线上;1,延长线上
|
||
void SetDimPos(int nFlag);
|
||
int GetDimPos() const;
|
||
|
||
// 设置和读取标注文字宽度
|
||
void SetTextWidthUp(double d, BOOL bAsPaperUnit = TRUE);
|
||
double GetTextWidthUp(BOOL bAsPaperUnit = TRUE) const ;
|
||
void SetTextWidthDown(double d, BOOL bAsPaperUnit = TRUE);
|
||
double GetTextWidthDown(BOOL bAsPaperUnit = TRUE) const;
|
||
// 获取实际文字的宽度,多行文字直接取宽度,单行文字计算宽度,返回。
|
||
double GetTextRelWidth(bool bUp, BOOL bAsPaperUnit = TRUE) const;
|
||
// 上标或者下标是否单行
|
||
bool IsSingleLineText(bool bUp) const;
|
||
|
||
// 检测是否有延长线 (g4 - g5)
|
||
bool HasExtendLine() const;
|
||
// 见索引标注夹点示意图
|
||
XPoint GetG5Point() const;
|
||
|
||
public: // Properties
|
||
XPoint GetIndexCenter() const;
|
||
XPoint GetIndexCenter(long i)const;
|
||
XPoint GetTextBasePoint() const;
|
||
XPoint GetTextEndPoint() const;
|
||
|
||
long GetAppendIndexNum()const {//ok
|
||
assertReadEnabled();
|
||
return m_lstLabel.Length();
|
||
}
|
||
void SetAppendIndexNum(long num);
|
||
|
||
public:// 属性读取辅助函数
|
||
// 设置延长线长度
|
||
void SetExtendLineLen(double dVal, bool bPaperUnit = TRUE);
|
||
double GetExtendLineLen(bool bAsPaperUnit = TRUE);
|
||
// 文字线单位向量,
|
||
XVector3D GetTextLineUnitVec() const;
|
||
// 第一段引线的单位向量
|
||
XVector3D GetFirstLineUnitVec() const;
|
||
// 获取第一段引线
|
||
XLine GetFirstLine() const;
|
||
// 获取绘制标注文字的线段,可能在延长线上,或者在原文字基线上。
|
||
XLine GetTextLine() const;
|
||
// 向量单位化
|
||
static XVector3D UnitVec(XVector3D &vec);
|
||
// 剖切线绘制偏移(剖切线距离引线)
|
||
XVector3D CutLineOffset() const;
|
||
|
||
// 获取默认值
|
||
static double GetDefaultExtendLineLen() { return g_dIndexPointerBaseLen; }
|
||
static double GetDefaultCutLineLen() { return g_dSectionBaseLen; }
|
||
|
||
// 计算单行文字的长度,
|
||
// sText,文字; styleId:文字样式; dHei:字高; iWider:多计算几个字符的宽度(原始长度太小)
|
||
static double CalcTextLen(const CString &sText, const AcDbObjectId &styleId, double dHei, int iWider);
|
||
|
||
public: // 夹点类型,参见索引示意图
|
||
enum {
|
||
eG1 = 0,
|
||
eGAdd,
|
||
eG2,
|
||
eG3,
|
||
eG4,
|
||
eG5,
|
||
eGArea, // 剖切范围
|
||
eGTextWid1, // 上标文字页宽
|
||
eGTextWid2, // 下标文字页宽
|
||
eGPointNum, // 记录夹点的个数
|
||
eGCutFir, // 第一个剖切点(用来改变剖切方向)
|
||
eGCutStart, // 剖切线起点 (不包括第一个剖切线的起点)
|
||
eGCutEnd, // 剖切线终点
|
||
};
|
||
|
||
protected:
|
||
struct SGrip
|
||
{
|
||
int nType; // eG***;
|
||
int nIndeces; // 夹点索引,CAD subMove***,或者subStretch**中传入的数据
|
||
bool bCheck; // 是否被选中
|
||
bool bProcessed; // 是否被处理过。
|
||
};
|
||
|
||
typedef CArray<SGrip, SGrip&> AryGrip;
|
||
// 夹点提取附加信息
|
||
struct SGripAdditional
|
||
{
|
||
// 对应从SubMove***中传来的索引的类型
|
||
AryInt arGripType; // 剖切点类型数组,对应剖切点
|
||
int nCutStart; // 剖切点起始
|
||
int nCutEnd; // 剖切点终止 [nCutStart, nCutEnd)
|
||
AryGrip arGripStruct; // 类型和indeces在初始时写入,并且设置bProcessed,根据indices填写bCheck标记,
|
||
XPoint ptUpTextMin;
|
||
XPoint ptUpTextMax;
|
||
XPoint ptDownTextMin;
|
||
XPoint ptDownTextMax;
|
||
|
||
// 填充arGripStruct是否Check的标记
|
||
void FillCheckProp(const AcDbIntArray &arIndicesSrc);
|
||
void SetChecked(int nType, bool bCheck);
|
||
// 查找某类型对应的夹点是否被选中
|
||
bool FindCheck(int nType) const;
|
||
// 查找某索引对应的夹点是否被选中
|
||
bool FindCutCheckBoth(int nIndec) const;
|
||
// 查找某索引nIndec对应的是第几个CutLine
|
||
int GetCutLineIndex (int nIndec) const;
|
||
bool IsCut(int nIndec) const;
|
||
};
|
||
|
||
protected: // 文字标注绘制相关函数
|
||
// 是否绘制上部标注
|
||
bool NeedDrawUpText() const;
|
||
// 是否绘制下部标注
|
||
bool NeedDrawDownText() const;
|
||
// 文字标注相关函数
|
||
void GetTextAttribute(const XLine &textLine, XPoint &ptAlignUp, XPoint &ptAlignDown) const;
|
||
// 获取文字的实际左下和右上点(旋转之后的)
|
||
bool GetUpTextExtent(XPoint &ptMin, XPoint &ptMax) const;
|
||
bool GetDownTextExtent(XPoint &ptMin, XPoint &ptMax) const;
|
||
|
||
// 计算标注文字位置
|
||
void CalcUpTextPostion(const XLine &textLine, double nDirRot, double nText2Base,
|
||
XPoint &ptPos, XExplodeDraw::TextAlignment &alginment) const;
|
||
void CalcDownTextPostion(const XLine &textLine, double nDirRot, double nText2Base,
|
||
XPoint &ptAlignDown, XExplodeDraw::TextAlignment &alginment) const;
|
||
// 设置构造并且设置文字属性
|
||
TDbText* ConstructDimText(const XLine &textLine, bool bUp) const;
|
||
|
||
protected: // 夹点操作函数
|
||
// 三个内联函数,分别用来添加,夹点,提示信息,以及类型。
|
||
void AddGripPoint(AcGePoint3dArray *pArGripPoints, const XPoint &gripPoint) const;
|
||
void AddGripTip(CStringArray *pArTips, LPCTSTR szTips) const;
|
||
void AddSGripType(TDbSymbIndexPointer::SGripAdditional *pSga, int nType, int nIndex) const;
|
||
|
||
// 调节剖切线终点,处于引线内部,可能会调整点的顺序。
|
||
// nKeepType:剖切线的调整方式:0:保持剖切线的长度,1:保持剖切线起点位置不变(改变长度)
|
||
void KeepCutLineAssistLine(const XLine &lineAssist, XPoint &ptCutStart, XPoint &ptCutEnd, int nKeepType);
|
||
// 构造夹点信息
|
||
// pArTips:提示信息数组
|
||
// pArGripPoints:夹点数组
|
||
// pSga:夹点信息结构体。
|
||
// bGrip:夹点操作还是拉伸操作(所构造的夹点不同)
|
||
void BuildGrip(CStringArray *pArTips, AcGePoint3dArray *pArGripPoints, SGripAdditional *pSga, bool bGrip = true) const;
|
||
// 移动夹点或者拉伸点。
|
||
void MoveGripOrStretchPoints(const SGripAdditional &sgaFull,
|
||
const AcGeVector3d& offset,
|
||
bool bGrip = true,
|
||
int nCutSplit = 0);
|
||
|
||
protected: // 用来对cutLine排序函数
|
||
static int CutLineCmp(const void *p1, const void *p2);
|
||
// 按照lineAssist的方向,根据lines中线段的起点,对lines中的线段排序,并且调节lines中与线段lineAssist方向不同的线段
|
||
static void SortCutLine(const XLine &lineAssist, AryXLine &lines);
|
||
// 向量放缩
|
||
static XVector3D ScaleVec(double dScale, const XVector3D &vec);
|
||
|
||
// 获取MText属性:
|
||
// sText, 显示的字符串
|
||
// idStyle :字体样式ID
|
||
// dHei, dWid, 高和宽
|
||
// ptMin:输出,文字左下坐标
|
||
// ptMax:输出,文字右上坐标
|
||
// pMisValue:文字显示的位置跟实际输入的位置会产生一个偏移(SetPosition的位置跟实际显示的位置)精确控制需要使用这个数据
|
||
void MTextExtents(const CString &sText, const AcDbObjectId &idStyle, double dHei, double dWid,
|
||
XPoint &ptMin, XPoint &ptMax, double *pMisValue = NULL) const;
|
||
// 文字绘制位置偏移
|
||
void SingleTextUpMis(const CString &sText, const AcDbObjectId &idStyle, double dHei, double *pMisValue = NULL) const;
|
||
void SingleTextDownMis(const CString &sText, const AcDbObjectId &idStyle, double dHei, double *pMisValue = NULL) const;
|
||
|
||
protected:
|
||
BOOL GetText(Adesk::UInt32 cookies, TDbText &text) const;
|
||
|
||
void DownGradeSaveText(XExplodeStream &dc);
|
||
};
|
||
|
||
|
||
/////////////////////////////////////////////////////////////
|
||
// 指北针
|
||
class TARCH_EXP TDbSymbNorthThumb: public TDbEntity
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbNorthThumb);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
XPoint m_ptCenter; // 圆心
|
||
double m_nRadius; // 尺寸
|
||
double m_nRotation; // 方向
|
||
|
||
// TArch9,增加文字参数
|
||
AcDbHardPointerId m_idTextStyle; // 文字样式
|
||
double m_dTextHeight; // 文字高度
|
||
Adesk::UInt16 m_colorText; // 文字颜色
|
||
XString m_szText; // 文字内容
|
||
XPoint m_ptText; // 文字位置,ECS相对坐标
|
||
|
||
public:
|
||
TDbSymbNorthThumb();
|
||
~TDbSymbNorthThumb();
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
// drived from TDbEntity
|
||
virtual DrawType GetDrawType() const;
|
||
virtual void GetTips(DList<TObjInfoUnit> &) const; // 取动态属性显示数据
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase);
|
||
|
||
// sg add 111227,支持文字在位编辑
|
||
virtual long GetSubTextNum() const { return 1;}
|
||
virtual void SetSubText(long i, CString sText) { SetText(sText); }
|
||
|
||
// sg add 110301,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
// Properties
|
||
XPoint GetCenter() const;
|
||
double GetRadius(BOOL bAsPaperUnit = TRUE) const;
|
||
double GetRotation() const;
|
||
XPoint GetNorthPoint() const;
|
||
|
||
void SetCenter(XPoint pt);
|
||
void SetRadius(double val, BOOL bAsPaperUnit = TRUE);
|
||
void SetRotation(double val);
|
||
|
||
// TArch9,增加文字参数
|
||
AcDbObjectId GetTextStyleId() const;
|
||
void SetTextStyleId(AcDbObjectId id);
|
||
|
||
double GetTextHeight(BOOL bAsPaperUnit = TRUE) const;
|
||
void SetTextHeight(double nHeight, BOOL bAsPaperUnit = TRUE);
|
||
|
||
void SetTextColor(Adesk::UInt16 color);
|
||
Adesk::UInt16 GetTextColor() const;
|
||
|
||
void SetText(const TCHAR *pszText);
|
||
const TCHAR* GetText() const;
|
||
|
||
XPoint GetTextPoint(BOOL bEcsPoint = FALSE) const;
|
||
void SetTextPoint(XPoint pt);
|
||
|
||
public: // Helper Method
|
||
// 下列函数为9.0新增加的函数,需要增加实现
|
||
AcGePoint2d GetEcsOriginPt() const;
|
||
void GetEcsAxisVector(AcGeVector2d &xAxis, AcGeVector2d &yAxis) const;
|
||
XPoint GetWcsTextPt() const;
|
||
|
||
// 文字默认位置
|
||
XPoint GetDefaultTextLocation() const;
|
||
};
|
||
|
||
|
||
/////////////////////////////////////////////////////////////
|
||
// 对称轴
|
||
class TARCH_EXP TDbSymbSymmetry: public TDbEntity
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbSymmetry);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
XPoint m_ptStart, m_ptEnd; // 端点
|
||
double m_nDist1, m_nDist2; // 第一端线距离端点, 第二端线距离第一端线
|
||
double m_nTermLen; // 端线长度
|
||
|
||
// TArch6 data
|
||
// AcDbHardPointerId m_idLayerCenter;
|
||
|
||
public:
|
||
TDbSymbSymmetry();
|
||
~TDbSymbSymmetry();
|
||
virtual BOOL IsValid() const;
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
|
||
// virtual Acad::ErrorStatus getClassID(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 subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
// drived from TDbEntity
|
||
virtual DrawType GetDrawType() const;
|
||
virtual void GetTips(DList<TObjInfoUnit> &) const; // 取动态属性显示数据
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
|
||
// sg add 110301,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
// Properties
|
||
double GetDist1(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetDist2(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetTermLen(BOOL bAsPaperUnit=TRUE) const;
|
||
XPoint GetStartPoint() const;
|
||
XPoint GetEndPoint()const;
|
||
|
||
// AcDbObjectId GetCenterLayerId() const {
|
||
// return m_idLayerCenter;
|
||
// }
|
||
// void SetCenterLayerId(AcDbObjectId id) {
|
||
// assertWriteEnabled();
|
||
// m_idLayerCenter=id;
|
||
// }
|
||
|
||
void SetDist1(double nDist1, BOOL bAsPaperUnit=TRUE);
|
||
void SetDist2(double nDist2, BOOL bAsPaperUnit=TRUE);
|
||
void SetTermLen(double nLen, BOOL bAsPaperUnit=TRUE);
|
||
void SetStartPoint(XPoint pt);
|
||
void SetEndPoint(XPoint pt);
|
||
};
|
||
|
||
|
||
/////////////////////////////////////////////////////////////
|
||
// 折断线
|
||
class TARCH_EXP TDbSymbRupture: public TDbEntity
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbRupture);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
XPoint m_ptStart, m_ptEnd; // 端点
|
||
Adesk::UInt8 m_nRuptureNum;
|
||
|
||
public:
|
||
TDbSymbRupture();
|
||
~TDbSymbRupture();
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
// drived from TDbEntity
|
||
virtual DrawType GetDrawType() const;
|
||
virtual void GetTips(DList<TObjInfoUnit> &) const; //取动态属性显示数据
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
|
||
// sg add 110301,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
// sg add 120316,支持夹点ctrl功能切换
|
||
virtual int GetCtrlToggleIndex()const { return 10; }
|
||
|
||
// Properties
|
||
XPoint GetStartPoint() const;
|
||
XPoint GetEndPoint()const;
|
||
Adesk::UInt8 GetRuptureNum() const;
|
||
void SetRuptureNum(Adesk::UInt8 num);
|
||
void SetStartPoint(XPoint pt);
|
||
void SetEndPoint(XPoint pt);
|
||
};
|
||
|
||
|
||
/////////////////////////////////////////////////////////////
|
||
// 带折断线的切割对象,可以切割所有上华对象模型(不包括标注类对象)
|
||
#ifdef I_AM_TCH_KERNAL
|
||
class TARCH_EXP TDbSymbCut: public TDbEntity
|
||
#else
|
||
class TARCH_IMPEXP TDbSymbCut: public TDbEntity
|
||
#endif
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbCut);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
XPoly2D m_polyOutline; // 不是真实轮廓
|
||
XDcClip::ClipType m_nClipType;
|
||
DList<int> m_lstRuptureNum; // 7.0无用数据
|
||
|
||
public:
|
||
TDbSymbCut():m_nClipType(XDcClip::kClipOut){}
|
||
|
||
bool IsHideLine()const{return !m_polyOutline.IsClosed();}
|
||
void SetHideLine(bool bHide);
|
||
void SetOutline(const XPoly2D &poly);
|
||
XPoly2D GetOutline()const;
|
||
long GetEdgeNum()const{return m_polyOutline.Length();} // ok
|
||
void InsertNode(long i,XPoint pt);
|
||
bool RemoveNode(XPoint pt); // 返回值代表是否找到pt
|
||
void SetEdgeType(long i,int type);
|
||
int GetEdgeType(long i)const; // ok
|
||
|
||
XDcClip::ClipType GetClipType()const{return m_nClipType;} // ok
|
||
void SetClipType(XDcClip::ClipType type){assertWriteEnabled();m_nClipType=type;} // ok
|
||
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
// drived from TDbEntity
|
||
virtual BOOL IsValid()const;
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
virtual int GetFirstVersion()const{return 7;} // ok
|
||
virtual DrawType GetDrawType() const;
|
||
virtual void GetTips(DList<TObjInfoUnit> &) const; // 取动态属性显示数据
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
virtual Acad::ErrorStatus ExplodeOrDraw3d(XExplodeDraw &dc) const;
|
||
virtual bool IsMeClip()const{return true;}
|
||
virtual bool IsClipOut()const{return (GetClipType()&XDcClip::kClipOut)!=0;} // ok,是否只裁剪外部
|
||
virtual Acad::ErrorStatus GetClipBoundary(XPoly2D& poly)const{poly=GetOutline();return Acad::eOk;}//ok
|
||
|
||
// sg add 110301,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
};
|
||
|
||
|
||
//////////////////////////////////////////////////////////////
|
||
#define SMLF_PARALLEL 0x01 // 引线平行
|
||
|
||
// 引出标注
|
||
class TARCH_EXP TDbSymbMultiLeader: public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbMultiLeader);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
|
||
public:
|
||
// gjm add 为电气 kSortLine 类型
|
||
enum TArrowStyle { kNone=0, kDote=1, kArrow=2, kCrossing=3, kSortLine=4, }; // 箭号型式
|
||
// sg add 090216
|
||
enum TSymbMLTextAlign { kAtStart=1, kAtMiddle=2, kAtEnd=3, }; // 文字对齐方式
|
||
|
||
protected:
|
||
TArrowStyle m_arrow; // 箭头标记
|
||
TSymbMLTextAlign m_nTextAlign; // 文字对齐方式,sg add 090216
|
||
|
||
XPoint m_ptLeader; // 引线端点
|
||
double m_nTextBaseLen; // 基线长度, >0右引, <0左引
|
||
XPointList m_lstVertexes;
|
||
double m_nArrowSize;
|
||
|
||
// 文字参数
|
||
Adesk::UInt8 m_bSideText; // 是否为线端文字
|
||
XString m_sText1;
|
||
XString m_sText2;
|
||
|
||
double m_dText2BaseRatio; // TArch8,文字距基线系数,sg add 081111
|
||
double m_dPageWidth; // 页宽(不乘字高),0为单行文字,sg add 090216
|
||
|
||
// sg add 090720,8.0正式版增加的临时变量,不保存,处理坐标标注的绘制问题
|
||
BOOL m_bSymbMultiLeader;
|
||
|
||
// TArch9.0
|
||
// 0x01引线平行
|
||
Adesk::UInt8 m_nLeaderFlag;
|
||
// 用于确定引线平行时的平行方向,不显示到图面上
|
||
XPoint m_ptLeaderDirection;
|
||
|
||
// add by gjm 为 kSortLine 增加两个点
|
||
AcGePoint3d m_ptSortLineStart, m_ptSortLineEnd;
|
||
|
||
public:
|
||
TDbSymbMultiLeader();
|
||
~TDbSymbMultiLeader();
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
// 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 int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
||
BOOL GetText(Adesk::UInt32 cookies, TDbText &text) const;
|
||
// 返回发现的位置,同时posStart往前移动(以便继续找下一个使用),
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText, TTextPosition &posStart, TTextRange *pRange=NULL) const;
|
||
// 返回下一次查找的开始位置
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep, const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
virtual long GetSubTextNum()const{return 2;} // ok
|
||
virtual void SetSubText(long i,CString sText){if(i==0)SetText1(sText);else SetText2(sText);}//ok
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase); // sg add 090414
|
||
|
||
// sg add 110301,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
// Helper Method
|
||
// 返回值为绝对值
|
||
double GetMinTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetDefaultTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
|
||
// Properties
|
||
const TCHAR *GetText1() const;
|
||
const TCHAR *GetText2() const;
|
||
XPoint GetLeaderPoint() const;
|
||
XPoint GetTextBasePoint() const;
|
||
double GetTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
void GetLeaderVertexes(XPointList &lstPoints) const;
|
||
TArrowStyle GetArrow() const;
|
||
BOOL IsSideText() const;
|
||
double GetArrowSize(BOOL bAsPaperUnit=TRUE) const;
|
||
|
||
void SetText1(const TCHAR *pszText);
|
||
void SetText2(const TCHAR *pszText);
|
||
void SetLeaderPoint(XPoint pt);
|
||
void SetTextBaseLen(double val, BOOL bAsPaperUnit=TRUE);
|
||
// sg modify 120104,新增加的参数用于判断是否要给m_ptLeaderDirection赋值,内部数据用于引线平行样式
|
||
// 默认为要,如果是先调用GetLeaderVertexes函数,获得了点链表后,在点链表中添加一些点,则传FALSE
|
||
// void SetLeaderVertexes(const XPointList &lstPoints);
|
||
void SetLeaderVertexes(const XPointList &lstPoints, BOOL bUpdateLeaderDirection = TRUE);
|
||
void SetArrow(TArrowStyle ar);
|
||
void SetSideText(BOOL bTrue);
|
||
void SetArrowSize(double nSize, BOOL bAsPaperUnit=TRUE);
|
||
|
||
// sg add 081111,bRealDist用来控制,返回“实际距离”(自动乘字高)或“系数”
|
||
double GetText2BaseRatio(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
void SetText2BaseRatio(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// sg add 090216
|
||
TSymbMLTextAlign GetTextAlign() const;
|
||
double GetPageWidth(BOOL bAsPaperUnit = TRUE) const;
|
||
void SetTextAlign(TSymbMLTextAlign align);
|
||
// 注:当设置的宽度为0时,表示单行显示,用默认最小的宽度
|
||
void SetPageWidth(double dVal = 0, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// sg add 090410,线下文字页宽,动态数据
|
||
double GetPageWidth2(BOOL bAsPaperUnit = TRUE) const;
|
||
void SetPageWidth2(double dVal = 0, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// sg add 090413,判断是否是单行文字
|
||
BOOL IsUpText() const; // 线上文字
|
||
BOOL IsDownText() const; // 线下文字
|
||
|
||
// sg add 090720,8.0正式版增加的临时变量,不保存,处理坐标标注的绘制问题
|
||
void SetSymbMultiLeader(BOOL bSymbMultiLeader);
|
||
|
||
// TArch9
|
||
// 引线是否平行
|
||
void SetLeaderParalle(BOOL bParallel);
|
||
BOOL IsLeaderParall() const;
|
||
|
||
// 获得引线平行时的平行方向点
|
||
void SetLeaderDirection(XPoint &pt);
|
||
XPoint GetLeaderDirection() const;
|
||
|
||
// add by gjm for kSortLine type
|
||
void SetSortLinePt(const AcGePoint3d &ptS, const AcGePoint3d &ptE){m_ptSortLineStart = ptS;m_ptSortLineEnd = ptE;}
|
||
void GetSortLinePt(AcGePoint3d &ptS, AcGePoint3d &ptE){ptS = m_ptSortLineStart;ptE = m_ptSortLineEnd;}
|
||
protected:
|
||
XPoint GetTextPt(BOOL bUseLayout = TRUE) const; // sg add 090413,分别计算两段文字位置点
|
||
XPoint GetText2Pt(BOOL bUseLayout = TRUE) const;
|
||
};
|
||
|
||
|
||
///////////////////////////////////////////////////
|
||
// 标高标注
|
||
#define SEF_DOWN 0x01 // 下标注
|
||
#define SEF_LEFT 0x02 // 左标注
|
||
#define SEF_BASELINE 0x04 // 有基线
|
||
#define SEF_LEADER 0x08 // 有引线
|
||
#define SEF_PREC2 0x10 // 2位精度
|
||
#define SEF_FILLED 0x20 // 填充
|
||
// sg add 090204
|
||
#define SEF_DOTE 0x40 // 室外标高圆点样式
|
||
#define SEF_STANDARD 0x80 // 规范样式
|
||
|
||
// 以下保存在 m_nFlag2 内,不要骂娘,也不知道是谁这么干的。无解。
|
||
#define SEF_PARENTHESES 0x01 // 传统方式是否增加括号
|
||
// sg add 090220
|
||
#define SEF_ATSIDE 0x02 // 文字齐线端
|
||
#define SEF_ARCHELEV 0x04 // 是否是建筑标高
|
||
// sg add 090301
|
||
#define SEF_UPDOWNTEXT 0x08 // 总图标高是否上下排列
|
||
|
||
// 以下保存在 m_nFlag3 内。
|
||
// sg add 120608
|
||
#define SEF_TRIANGLE 0x01 // 空心三角形标高符号
|
||
#define SEF_NEWELEV 0x02 // 新总图标高中的右上标注形式,只对三角形填充标高作用
|
||
|
||
// jsx add 160517
|
||
#define SEF_CROSS 0x04 // 十字样式标高
|
||
|
||
|
||
class TARCH_EXP TDbSymbElevation: public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbElevation);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
|
||
protected:
|
||
Adesk::UInt8 m_nFlag; // 控制标记
|
||
XPoint m_ptLocation;
|
||
XString m_sText; // 文字参数,多个的则分行
|
||
|
||
double m_nTextBaseLen, // 文字基线长度(图纸尺寸)
|
||
m_nLeaderLen, // 引线长度(图纸尺寸)
|
||
m_nBaseLen; // 基线长度(图纸尺寸)
|
||
|
||
// TArch8
|
||
double m_dText2BaseRatio; // 文字距基线系数,sg add 081111
|
||
XPoint m_ptText; // 文字夹点位置点,sg add 090204
|
||
Adesk::UInt8 m_nFlag2; // 文字与基线的相对位置标记
|
||
XString m_sLowText; // 预留以后在线下增加文字使用,sg add 090211
|
||
XPoint m_ptLowText;
|
||
|
||
// TArch9
|
||
Adesk::UInt8 m_nFlag3;
|
||
|
||
public:
|
||
TDbSymbElevation();
|
||
~TDbSymbElevation();
|
||
virtual BOOL IsValid() const;
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
|
||
virtual Adesk::Boolean subCloneMeForDragging();
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
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);
|
||
|
||
// 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 int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
||
virtual TSubText* HitTestText(XPoint pt)const;
|
||
virtual long GetSubTextNum()const { return 1; } // ok
|
||
// sg add 090326,处理右键在位编辑错误
|
||
virtual TSubText* GetSubText(long iText)const;
|
||
virtual void SetSubText(long i, CString sText) { SetText(sText); } // ok
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
|
||
// sg add 090204
|
||
BOOL GetText(Adesk::UInt32 cookies, TDbText &text, double &dPageWidth) const;
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText, TTextPosition &posStart,
|
||
TTextRange *pRange=NULL) const;
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep,
|
||
const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase); // sg add 090216,图形导出
|
||
|
||
// sg add 101116,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
public: // Helper Method
|
||
void GetVertexes(XPoint ptArray[7]) const;
|
||
double GetDefaultTextBaseLen(BOOL bAsPaperUnit = TRUE) const;
|
||
|
||
// sg add 090318,将文字位置点,有WCS改为ECS,以下3个函数,用于转化
|
||
AcGePoint2d GetEcsOriginPt() const;
|
||
void GetEcsAxisVector(AcGeVector2d &xAxis, AcGeVector2d &yAxis) const;
|
||
XPoint GetWcsTextPt(BOOL bLowText = FALSE) const;
|
||
|
||
// 从8.0的BETA2起,GetDefaultTextLocation、GetDefaultTextLocation2函数可不使用
|
||
XPoint GetDefaultTextLocation() const; // sg add 090204
|
||
XPoint GetDefaultTextLocation2() const; // sg add 090216
|
||
|
||
BOOL IsDigitEle(const XString &sText) const; // sg add 090204,判断是否是数字标注
|
||
// sg add 090212,计算多行文字最小页宽
|
||
double GetMinTextBaseLen(XStringList &lstTexts, BOOL bAsPaperUnit) const;
|
||
|
||
// XPoint GetElev1DrawPt() const; // sg add 090216,获取各个多行文字的绘制点
|
||
// XPoint GetElev2DrawPt() const;
|
||
// XPoint GetFloorDrawPt() const;
|
||
// sg modify 110125,获取各个多行文字的绘制点,增加参数传递,减少循环次数
|
||
XPoint GetElev1DrawPt(XStringList &lstElevs1, XStringList &lstElevs2) const;
|
||
XPoint GetElev2DrawPt(const XPoint &pt1, const double &dPage) const;
|
||
XPoint GetFloorDrawPt(const XPoint &pt1, XStringList &lstElevs1, XStringList &lstElevs2,
|
||
XStringList &lstFloors, BOOL bHasPt1 = TRUE) const;
|
||
|
||
// 获取基线下方文字,在X方向的宽度(相当于页宽)
|
||
double GetLowTextXExtents(BOOL bAsPaperUnit) const;
|
||
CString FormatLowText() const; // sg add 090223,对基线下方文字进行格式化
|
||
|
||
// Properties
|
||
const TCHAR *GetText() const;
|
||
// add by whl on 040922
|
||
// void GetTexts(XStringList &lstTexts)const; // sg modify 090211
|
||
void GetTexts(XStringList &lstElevs1, XStringList &lstElevs2,
|
||
XStringList &lstFloors)const;
|
||
bool GetElev1(double&res)const; // 取相对高程
|
||
bool GetElev2(double&res)const; // 取黄海高程
|
||
CString GetNoteString()const; // 括号中内容
|
||
void AddElev(double elev); // 高程变化
|
||
|
||
Adesk::UInt8 GetFlag(){return m_nFlag;}
|
||
Adesk::UInt8 GetFlag2(){return m_nFlag2;}
|
||
Adesk::UInt8 GetFlag3(){return m_nFlag3;}
|
||
|
||
public: // Set、Get
|
||
XPoint GetLocation() const;
|
||
double GetTextBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetLeaderLen(BOOL bAsPaperUnit=TRUE) const;
|
||
double GetBaseLen(BOOL bAsPaperUnit=TRUE) const;
|
||
BOOL HasBaseLine() const;
|
||
BOOL HasLeader() const;
|
||
BOOL IsPrec2() const;
|
||
BOOL IsFilled() const {
|
||
return ((m_nFlag&SEF_FILLED)!=0);
|
||
}
|
||
|
||
void SetText(const TCHAR *pszText);
|
||
void SetLocation(XPoint pt);
|
||
void SetTextBaseLen(double val, BOOL bAsPaperUnit=TRUE);
|
||
void SetBaseLen(double val, BOOL bAsPaperUnit=TRUE);
|
||
void SetLeaderLen(double val, BOOL bAsPaperUnit=TRUE);
|
||
void SetBaseLine(BOOL bTrue);
|
||
void SetLeader(BOOL bTrue);
|
||
void SetPrec2(BOOL bTrue);
|
||
void SetFilled(BOOL bTrue) {
|
||
assertWriteEnabled();
|
||
if (bTrue)
|
||
m_nFlag|=SEF_FILLED;
|
||
else
|
||
m_nFlag&=~SEF_FILLED;
|
||
}
|
||
|
||
// sg add 081111,bRealDist用来控制,返回“实际距离”(自动乘字高)或“系数”
|
||
double GetText2BaseRatio(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
void SetText2BaseRatio(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// sg add 090204
|
||
XPoint GetTextPoint(BOOL bEcsPoint = FALSE) const;
|
||
BOOL IsRightText() const;
|
||
BOOL IsDote() const;
|
||
BOOL IsStandard() const;
|
||
|
||
void SetTextPoint(XPoint pt);
|
||
void SetDote(BOOL bTrue);
|
||
void SetStandard(BOOL bTrue);
|
||
|
||
void SetLowText(const TCHAR *pszText); // sg add 090211
|
||
void SetLowTextPt(XPoint pt);
|
||
const TCHAR* GetLowText() const;
|
||
XPoint GetLowTextPt(BOOL bEcsPoint = FALSE) const;
|
||
|
||
//jsx add 160517
|
||
BOOL IsCross() const;
|
||
void SetCross(BOOL bTrue);
|
||
|
||
BOOL IsParentheses() const; // sg add 090212,传统样式时,楼层信息部分,是否增加括号
|
||
void SetParentheses(BOOL bTrue);
|
||
BOOL IsAtLineSide() const; // sg add 090220,设置文字是否齐线端
|
||
void SetAtLineSide(BOOL bTrue);
|
||
BOOL IsArchElev() const; // sg add 090223,设置标高类型,普通标高、总图标高
|
||
void SetArchElev(BOOL bTrue);
|
||
|
||
BOOL IsUpDownTextElev() const; // sg add 090301,总图标高是否上下排列
|
||
void SetUpDownTextElev(BOOL bTrue);
|
||
|
||
BOOL IsFloorsOnRightSide() const; // sg add 110125,多层标高符号中的楼层是否在标高值左侧
|
||
void SetFloorsOnRightSide(BOOL bTrue);
|
||
|
||
BOOL IsNewSitePlanElev() const; // sg add 120608,9.0新增加的总图右上侧标注的三角形填充标高
|
||
void SetNewSitePlanElev(BOOL bTrue);
|
||
|
||
BOOL IsHollowTriangle() const; // sg add 120608,9.0新增加的空心三角形总图标高
|
||
void SetHollowTriangle(BOOL bTrue);
|
||
|
||
BOOL HasKnowFloorsLoc() const; // sg add 110125,判断是否是需要知道楼层注释在左侧或右侧的特殊标高
|
||
|
||
private:
|
||
// sg add 091116,打开T7对象后,对标注内容进行检查,如果是类似"9(%%P0.00)",则将文字拆分成两部分
|
||
void CheckAndModifyT7String();
|
||
|
||
// sg add 120608,将T9格式标高内容与原来的标高格式内容相互转化
|
||
void Change2T9ElevText();
|
||
CString Change2OldElevText() const;
|
||
};
|
||
|
||
TARCH_IMPEXP int EditSymbElevation0(AcDbObjectId id);
|
||
|
||
|
||
////////////////////////////////////////////////////////////
|
||
// 箭头
|
||
// #define ARF_TEXT 0x01 // 有文字
|
||
// #define ARF_TEXT_ALIGN 0x02 // 文字转角与第一段对齐
|
||
class TARCH_EXP TDbSymbArrow: public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbArrow);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
public:
|
||
enum TArTextAlign { kAtSide=1, kAlignMid=2, kAlignEnd=3, };
|
||
|
||
// enum TArrowType {kArrow=0, kHalfArrow=1}; // sg modify 081231,8.0增加了箭号型式
|
||
enum TArrowType {kArrow=0, kHalfArrow=1, kDote=2, kCrossing=3, kNone=4, };
|
||
|
||
protected:
|
||
TArTextAlign m_nFlag; // 控制标记
|
||
XPoly2D m_poly;
|
||
|
||
// 文字参数
|
||
XString m_sText;
|
||
XPoint m_ptText; // 文字位置
|
||
double m_nArrowSize;
|
||
|
||
// void GetText(TDbText &text) const; // sg modify 090106
|
||
BOOL GetText(TDbText &text, Adesk::UInt32 cookies) const;
|
||
|
||
TArrowType m_nType; // TArch7 箭头样式
|
||
double m_dText2BaseRatio; // TArch8,文字距基线系数,sg add 081111
|
||
BOOL m_bShowText2; // 是否显示文字2,sg add 090106
|
||
XString m_sText2; // 文字2
|
||
XPoint m_ptText2; // 文字2位置,对在线端文字不起作用
|
||
|
||
public:
|
||
TDbSymbArrow();
|
||
~TDbSymbArrow();
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase); // sg add 090107
|
||
|
||
// 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 int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
||
// 返回发现的位置,同时posStart往前移动(以便继续找下一个使用),
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText, TTextPosition &posStart, TTextRange *pRange=NULL) const;
|
||
// 返回下一次查找的开始位置
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep, const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
virtual long GetSubTextNum()const {return 1;} // ok
|
||
// virtual void SetSubText(long i,CString sText) {assertWriteEnabled(); m_sText=sText;} // ok
|
||
// sg modify 090106,将该函数的实现放到了CPP中
|
||
virtual void SetSubText(long i, CString sText);
|
||
|
||
// sg add 101116,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
// Properties
|
||
const TCHAR *GetText() const;
|
||
// sg modify 120104,既可返回ECS点,又可以返回WCS点
|
||
// XPoint GetTextLocation() const;
|
||
XPoint GetTextLocation(BOOL bEcsPoint = FALSE) const;
|
||
void GetPoly2D(XPoly2D &poly) const;
|
||
TArTextAlign GetTextAlign() const;
|
||
XPoint GetDefaultTextLocation();
|
||
XExplodeDraw::TextAlignment GetTextAlignment() const;
|
||
double GetTextBaseDir() const;
|
||
double GetArrowSize(BOOL bAsPaperUnit=TRUE) const;
|
||
|
||
void SetTextLocation(XPoint ptLoc);
|
||
void SetText(const TCHAR *pszText);
|
||
void SetPoly2D(const XPoly2D &poly);
|
||
void SetTextAlign(TArTextAlign align);
|
||
void SetArrowSize(double nSize, BOOL bAsPaperUnit=TRUE);
|
||
TArrowType GetArrowType()const{assertReadEnabled();return m_nType;} // ok
|
||
void SetArrowType(TArrowType type){assertWriteEnabled();m_nType=type;} // ok
|
||
|
||
// sg add 081111,bRealDist用来控制,返回“实际距离”(自动乘字高)或“系数”
|
||
double GetText2BaseRatio(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
void SetText2BaseRatio(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// sg add 090106,处理文字2使用
|
||
BOOL GetShowText2() const;
|
||
const TCHAR *GetText2() const;
|
||
// sg modify 120104,既可返回ECS点,又可以返回WCS点
|
||
// XPoint GetText2Location() const;
|
||
XPoint GetText2Location(BOOL bEcsPoint = FALSE) const;
|
||
void SetShowText2(BOOL bShow);
|
||
void SetText2Location(XPoint ptLoc);
|
||
void SetText2(const TCHAR *pszText);
|
||
|
||
XPoint GetDefaultText2Location(); // sg add 090106
|
||
XExplodeDraw::TextAlignment GetText2Alignment() const;
|
||
|
||
// sg add 090623
|
||
double GetDimAngle(double dAngle) const;
|
||
|
||
public:
|
||
// add by lgy 111227,将文字基点由世界坐标系转换为实体坐标系
|
||
// 获取ECS原点,文字位置参考点
|
||
AcGePoint2d GetEcsOriginPt(BOOL bUp) const;
|
||
void GetEcsAxisVector(AcGeVector2d &xAxis, AcGeVector2d &yAxis) const;
|
||
// 通过bUp来控制获得上下文字的wcs坐标 true为上或者在线端
|
||
XPoint GetWcsTextPt(BOOL bUp) const;
|
||
};
|
||
|
||
|
||
|
||
////////////////////////////////////////////////////////////
|
||
// add by lgy 20130319,9.0增加以下宏是为了保存剖面图号的相关信息
|
||
#define SYMB_SECTION_DIM_DIR 0x01 // 标注方向
|
||
#define SYMB_SECTION_START_INDEX 0x02 // 标记始端是否有文字
|
||
#define SYMB_SECTION_END_INDEX 0x04 // 标记终端是否有文字
|
||
#define SYMB_SECTION_VIEW_DIR2 0x08 // 非正交的情况,有2个剖视方向
|
||
|
||
// 剖切符号
|
||
class TARCH_EXP TDbSymbSection : public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbSection);
|
||
|
||
// data members
|
||
public:
|
||
static double g_nLineWidth;
|
||
static double g_nSegLength;
|
||
|
||
protected:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
|
||
Adesk::UInt8 m_bViewLine;
|
||
XPoly2D m_poly;
|
||
double m_nViewDir;
|
||
|
||
XString m_sText;
|
||
XPoint m_ptText1, m_ptText2;
|
||
|
||
// add by lgy 20120319,9.0需求要求添加以下变量
|
||
XPoint m_ptSIndex; // 剖面图号文字位置点,ECS坐标系下
|
||
XPoint m_ptEIndex;
|
||
|
||
XString m_sDrawingIndex; // 剖面图号的文字内容
|
||
AcDbHardPointerId m_idIndexStyle; // 文字样式
|
||
double m_dIndexHeight; // 文字字高
|
||
double m_dText2BaseRatio; // 图号距文字基线系数
|
||
|
||
Adesk::UInt16 m_nFlag; // 标记位
|
||
|
||
double m_nViewDir2; // 终点处的剖视方向
|
||
|
||
public:
|
||
TDbSymbSection();
|
||
virtual ~TDbSymbSection();
|
||
|
||
virtual BOOL IsValid() const;
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
|
||
virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
|
||
virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
|
||
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
|
||
virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
|
||
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
|
||
|
||
// AcDbEntity overrides
|
||
virtual Acad::ErrorStatus subGetGripPoints(
|
||
AcGePoint3dArray& gripPoints,
|
||
AcDbIntArray& osnapMasks,
|
||
AcDbIntArray& geomIds) const;
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(
|
||
const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
virtual Acad::ErrorStatus subGetStretchPoints(
|
||
AcGePoint3dArray& stretchPoints) const;
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(
|
||
const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
||
|
||
public: // from TDbEntity
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase);
|
||
|
||
virtual void GetTips(DList<TObjInfoUnit> &) const;
|
||
Acad::ErrorStatus GetGripText(int idx, CString &cs) const;
|
||
virtual int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
||
|
||
virtual long GetSubTextNum()const { return 2; }//ok
|
||
virtual TSubText*HitTestText(XPoint pt)const;
|
||
virtual void SetSubText(long i, CString sText);
|
||
|
||
// sg add 090626,解决需求平台问题1416,支持查找替换操作
|
||
BOOL GetText(Adesk::UInt32 cookies, TDbText &text) const;
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText, TTextPosition &posStart,
|
||
TTextRange *pRange=NULL) const;
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep,
|
||
const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
|
||
// sg add 110301,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
public: // Properties
|
||
void GetPoly2D(XPoly2D &poly) const;
|
||
void SetPoly2D(const XPoly2D &poly);
|
||
|
||
double GetViewDirection() const;
|
||
void SetViewDirection(double vec);
|
||
|
||
double GetViewDirection2() const;
|
||
void SetViewDirection2(double vec);
|
||
|
||
const TCHAR *GetText() const;
|
||
void SetText(const TCHAR * pStr);
|
||
|
||
BOOL HasViewLine() const;
|
||
void SetViewLine(BOOL bTrue);
|
||
|
||
// nPos为0表示起点端,1为终点端
|
||
XPoint GetDefaultTextLocation(int nPos) const;
|
||
XPoint GetTextLocation(int nPos, BOOL bEcsPoint = FALSE) const;
|
||
void SetTextLocation(int nPos, XPoint pt);
|
||
|
||
// add by lgy 20120417,为剖面图号属性增加相应接口
|
||
// 剖面图号的文字内容
|
||
XString GetDrawingIndex() const;
|
||
void SetDrawingIndex(CString strDrawingIndex);
|
||
|
||
// 文字样式
|
||
AcDbObjectId GetIndexStyleId() const;
|
||
void SetIndexStyleId(AcDbObjectId id);
|
||
|
||
// 文字字高
|
||
double GetIndexHeight() const;
|
||
void SetIndexHeight(double dHeight);
|
||
|
||
// 获得图号标注方向,0为剖切方向,1为剖视方向
|
||
int GetDimDirection() const;
|
||
void SetDimDirection(int nDir);
|
||
|
||
// 始端是否有文字
|
||
BOOL GetIsHasIndexS() const;
|
||
void SetIsHasIndexS(BOOL bHas);
|
||
|
||
// 终端是否有文字
|
||
BOOL GetIsHasIndexE() const;
|
||
void SetIsHasIndexE(BOOL bHas);
|
||
|
||
// 返回图号文字距基线系数
|
||
double GetText2BaseRatios() const;
|
||
void SetText2BaseRatios(double dText2BaseRatio);
|
||
|
||
// nPos为0表示起点端,1为终点端
|
||
XPoint GetDefaultIndexLocation(int nPos) const;
|
||
XPoint GetIndexLocation(int nPos, BOOL bEcsPoint = FALSE) const;
|
||
void SetIndexLocation(int nPos, XPoint pt);
|
||
|
||
// 是否为非正交(非垂直)的剖切符号
|
||
BOOL GetNonPerpendicularitySection() const;
|
||
void SetNonPerpendicularitySection(BOOL bYes);
|
||
|
||
private:
|
||
// add by lgy 20120322,将文字基点由世界坐标系转换为实体坐标系
|
||
// 获取ECS原点,文字位置参考点
|
||
AcGePoint2d GetEcsOriginPt(int nPos) const;
|
||
// 获得X轴Y轴
|
||
void GetEcsAxisVector(AcGeVector2d &xAxis, AcGeVector2d &yAxis, int nPos) const;
|
||
// 由ecs转换成为wcs
|
||
XPoint GetWcsTextPt(int nPos) const;
|
||
|
||
double GetEndViewLineDir() const;
|
||
|
||
XExplodeDraw::TextAlignment GetIndexTextAlignment(int nPos) const;
|
||
double GetIndexTextRotation(int nPos) const;
|
||
};
|
||
|
||
TARCH_IMPEXP int EditSymbSection0(AcDbObjectId id);
|
||
|
||
|
||
/////////////////////////////////////////////////////////////////
|
||
// 坐标标注
|
||
#define SCF_AB 0x01 // AB标注
|
||
// #define SCF_DYNAMIC 0x02 // 动态跟随
|
||
// #define SCF_PREC2 0x10 // 2位精度,removed by whl on 04/05/15
|
||
class TARCH_EXP TDbSymbCoord: public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbCoord);
|
||
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
|
||
protected:
|
||
Adesk::UInt8 m_nFlag; // 控制标记,后四位用来控制精度TArch6.5
|
||
Adesk::UInt8 m_nQuadrant; // 象限0~3
|
||
XPoint m_ptLocation;
|
||
XPoint m_ptValue; // 显示的坐标值 x--Y(B), y--X(A)
|
||
|
||
// TArch6 data
|
||
XPoint m_ptTurn;
|
||
|
||
// TArch7 data
|
||
TDbSymbMultiLeader::TArrowStyle m_nStyle;
|
||
|
||
// TArch8 data
|
||
double m_dText2BaseRatio; // 文字距基线系数,sg add 081113
|
||
|
||
// TArch9 data
|
||
// 基线长度,数据的正负代表方向,用这个100000的数字来表示需要读取默认长度
|
||
double m_dTextBaseLen;
|
||
|
||
public:
|
||
TDbSymbCoord();
|
||
~TDbSymbCoord();
|
||
|
||
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 subTransformBy(const AcGeMatrix3d& xform);
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
// 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 int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
||
virtual long GetSubTextNum()const{return 2;}//ok
|
||
virtual TSubText* HitTestText(XPoint pt)const;
|
||
virtual TSubText* GetSubText(long iText)const;
|
||
virtual void SetSubText(long i,CString sText);
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
|
||
// sg add 090629,解决需求平台问题613,支持查找替换操作
|
||
BOOL GetText(Adesk::UInt32 cookies, TDbText &text) const;
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText, TTextPosition &posStart,
|
||
TTextRange *pRange=NULL) const;
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep,
|
||
const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
|
||
// sg add 110301,支持统一标高
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
||
BOOL *bErase);
|
||
|
||
XPoint GetTurnPoint() const;
|
||
|
||
// Properties
|
||
XPoint GetLocation() const;
|
||
XPoint GetValue() const;
|
||
BOOL IsAB() const;
|
||
BOOL IsPrec2() const;
|
||
Adesk::UInt8 GetQuadrant() const;
|
||
Adesk::UInt8 GetPrecNum() const;
|
||
|
||
void SetLocation(XPoint pt);
|
||
void SetValue(XPoint pt);
|
||
void SetAB(BOOL bTrue);
|
||
void SetPrec2(BOOL bTrue);
|
||
void SetQuadrant(Adesk::UInt8 nQuadrant);
|
||
void SetTurnPoint(XPoint pt);
|
||
void SetPrecNum(Adesk::UInt8 iNum);
|
||
TDbSymbMultiLeader::TArrowStyle GetStyle()const{assertReadEnabled();return m_nStyle;}
|
||
void SetStyle(TDbSymbMultiLeader::TArrowStyle style){assertWriteEnabled();m_nStyle=style;}
|
||
|
||
// sg add 081113,bRealDist用来控制,返回“实际距离”(自动乘字高)或“系数”
|
||
double GetText2BaseRatio(BOOL bAsPaperUnit = TRUE, BOOL bRealDist = TRUE) const;
|
||
void SetText2BaseRatio(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
|
||
// TArch9 data,文字基线长度
|
||
void SetTextBaseLen(double dVal, BOOL bAsPaperUnit = TRUE);
|
||
double GetTextBaseLen(BOOL bAsPaperUnit = TRUE) const;
|
||
|
||
// 文字基线默认长度
|
||
double GetDefaultTextBaseLen(BOOL bAsPaperUnit = TRUE) const;
|
||
// 文字基线的真实长度
|
||
double GetTrueTextBaseLen(BOOL bAsPaperUnit = TRUE) const;
|
||
|
||
protected:
|
||
XPoint _GetTurnPoint() const; // 用于对TArch5的升级
|
||
};
|
||
|
||
TARCH_IMPEXP int EditSymbElevation0(AcDbObjectId id);
|
||
|
||
|
||
|
||
/////////////////////////////////////////////////////////////////
|
||
// 云线标注,9.0新增
|
||
class TARCH_EXP TDbSymbModi : public TDbSymbWithText
|
||
{
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbSymbModi);
|
||
|
||
public:
|
||
TDbSymbModi();
|
||
~TDbSymbModi();
|
||
|
||
protected:
|
||
const static Adesk::UInt8 g_nVersion; // 对象格式版本
|
||
|
||
protected:
|
||
XPoly2D m_poly; // 云线对应的多段线
|
||
|
||
double m_dEndWidth; // 云线的末尾宽度
|
||
double m_dAngle; // 弯曲的弧度值
|
||
|
||
Adesk::UInt8 m_bShowEdition; // 是否显示版次
|
||
XString m_sEdition; // 版次文字
|
||
XPoint m_ptEditLoc; // 版次位置
|
||
|
||
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 subMoveGripPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
virtual Acad::ErrorStatus subGetStretchPoints(AcGePoint3dArray & stretchPoints) const;
|
||
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
|
||
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
||
|
||
public:
|
||
virtual BOOL IsValid() const;
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual void GetTips(DList<TObjInfoUnit> &) const; // 取动态属性显示数据
|
||
|
||
virtual long GetSubTextNum() const {return 1;}
|
||
virtual void SetSubText(long i, CString sText) { assertWriteEnabled(); m_sEdition=sText; };
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
|
||
virtual int GetFirstVersion() const { return 9; }
|
||
|
||
virtual int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
||
|
||
BOOL GetText(Adesk::UInt32 cookies, TDbText &text) const;
|
||
virtual TTextPosition FindSubText(const TCHAR *sSubText, TTextPosition &posStart,
|
||
TTextRange *pRange=NULL) const;
|
||
virtual TTextPosition ReplaceSubText(const TTextPosition &posRep,
|
||
const TCHAR *sRepText, TTextRange *pRange=NULL);
|
||
|
||
virtual bool UnifyElevation(double dElevation = 0.0);
|
||
|
||
public:
|
||
void SetModiPoly(XPoly2D poly);
|
||
void GetModiPoly(XPoly2D &poly) const;
|
||
|
||
BOOL GetIsShowEdition() const; // 是否显示版次
|
||
void SetIsShowEdition(BOOL bShow); // 设置是否显示版次
|
||
|
||
XPoint GetEditLocal() const; // 返回版次位置
|
||
void SetEditLocal(XPoint pt); // 设置版次位置
|
||
XPoint GetDefaultTextLocation(); // 版次文字默认位置点
|
||
|
||
void SetEditionText(CString strText); // 设置版次文字
|
||
CString GetEditionText() const; // 获得版次文字
|
||
|
||
double GetEndWidth() const; // 获得云线线宽
|
||
void SetEndWidth(double dWidth); // 设置线宽
|
||
|
||
void SetArcAngle(double dAngle); // poly中的每个点的弧度值
|
||
double GetArcAngle() const;
|
||
};
|
||
|
||
|
||
#endif |