164 lines
6.8 KiB
C++
164 lines
6.8 KiB
C++
#pragma once
|
||
#include "AecDbSymbWithText.h"
|
||
#include "ObjInfoUnit.h"
|
||
#include "globalDefine.h"
|
||
|
||
class AecXDbText;
|
||
class AecXDbSymbComposing : public AecXDbSymbWithText
|
||
{
|
||
public:
|
||
ACRX_DECLARE_MEMBERS(AecXDbSymbComposing);
|
||
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; // 文字在基线边上, 还是在基线上方
|
||
ADSGePoint3d m_ptStart, m_ptTurn;
|
||
TCString 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; // 文字距基线系数(需要乘字高)
|
||
AcGiDraw::TextAlignment m_nAlignment; // 文字对齐方式
|
||
|
||
bool m_bIsStretch; // add by xly on 101228 标记夹点操作是否是拉伸操作
|
||
public:
|
||
AecXDbSymbComposing();
|
||
~AecXDbSymbComposing();
|
||
|
||
TArrowStyle GetArrowStyle() const;
|
||
void SetArrowStyle(TArrowStyle arrowStyle);
|
||
virtual BOOL IsValid() const;
|
||
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 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 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(PtrList<ObjInfoUnit> &) const; // 取动态属性显示数据
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual Acad::ErrorStatus Draw2d(AcGiDraw &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, AecXDbText &text) const;
|
||
// 返回发现的位置,同时posStart往前移动(以便继续找下一个使用)
|
||
virtual TextPosition FindSubText(const TCHAR *sSubText, TextPosition &posStart, TextRange *pRange = NULL) const;
|
||
// 返回下一次查找的开始位置
|
||
virtual TextPosition ReplaceSubText(const TextPosition &posRep, const TCHAR *sRepText, TextRange *pRange = NULL);
|
||
|
||
virtual long GetSubTextNum()const { TCStringList sList; GetTexts(sList); return sList.Length(); }//ok
|
||
virtual SubText* GetSubText(long iText)const;
|
||
virtual SubText* HitTestText(ADSGePoint3d 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;
|
||
ADSGePoint3d GetStartPoint() const;
|
||
ADSGePoint3d GetTurnPoint() const;
|
||
ADSGePoint3d GetEndPoint() const;
|
||
double GetTextBaseLen(BOOL bAsPaperUnit = TRUE) const;
|
||
BOOL IsSideText() const;
|
||
void GetTexts(TCStringList &lstTexts) const;
|
||
|
||
void SetText(const TCHAR *pszText);
|
||
void SetStartPoint(ADSGePoint3d pt);
|
||
void SetTurnPoint(ADSGePoint3d 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;
|
||
AcGiDraw::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(AcGiDraw::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为数组中的元素排序
|
||
};
|