160 lines
4.8 KiB
C++
160 lines
4.8 KiB
C++
#ifndef __DBSYMBOLANNOTATE_H
|
|
#define __DBSYMBOLANNOTATE_H
|
|
|
|
#include "AecEntity.h"
|
|
#include "XExplodeStream.h"
|
|
|
|
class AecDbText;
|
|
// 文字样式应当有全局的设定, 其中包括默认的文字高度
|
|
|
|
// 符号标注基类
|
|
class GEOAPI AecDbSymbWithText: public AecEntity
|
|
{
|
|
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;
|
|
// Aec6 member
|
|
double m_nTextRotation; // 旋转角度,目前只有标高用到
|
|
AcDbHardPointerId m_idTextLayer;
|
|
|
|
// Aec7
|
|
Adesk::UInt16 m_colorText; // 文字颜色
|
|
|
|
public:
|
|
ACRX_DECLARE_MEMBERS(AecDbSymbWithText);
|
|
AecDbSymbWithText();
|
|
~AecDbSymbWithText();
|
|
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 AecEntity
|
|
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);
|
|
}
|
|
|
|
// aec add 090608,增加颜色设置接口
|
|
void SetTextColor(Adesk::UInt16 color)
|
|
{
|
|
assertWriteEnabled();
|
|
m_colorText = color;
|
|
}
|
|
Adesk::UInt16 GetTextColor() const
|
|
{
|
|
return m_colorText;
|
|
}
|
|
};
|
|
|
|
// 剖切符号
|
|
class GEOAPI AecDbSymbSection : public AecDbSymbWithText
|
|
{
|
|
DECLARE_TENTBASE();
|
|
ACRX_DECLARE_MEMBERS(AecDbSymbSection);
|
|
// 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;
|
|
|
|
public:
|
|
AecDbSymbSection();
|
|
virtual ~AecDbSymbSection();
|
|
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 AecEntity
|
|
virtual void GetTips(DList<ObjInfoUnit> &) const;
|
|
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
|
Acad::ErrorStatus GetGripText(int idx, CString &cs) const;
|
|
virtual int ConvertText(TConvertTextPtr ptr, void *pData=NULL);
|
|
|
|
virtual long GetSubTextNum()const{return 1;}//ok
|
|
virtual SubText*HitTestText(XPoint pt)const;
|
|
virtual void SetSubText(long i,CString sText){assertWriteEnabled();m_sText=sText;}//ok
|
|
|
|
// aec add 090626,解决需求平台问题1416,支持查找替换操作
|
|
BOOL GetText(Adesk::UInt32 cookies, AecDbText &text) const;
|
|
virtual TextPosition FindSubText(const TCHAR *sSubText, TextPosition &posStart,
|
|
TextRange *pRange=NULL) const;
|
|
virtual TextPosition ReplaceSubText(const TextPosition &posRep,
|
|
const TCHAR *sRepText, TextRange *pRange=NULL);
|
|
|
|
// aec add 110301,支持统一标高
|
|
virtual bool UnifyElevation(double dElevation = 0.0);
|
|
|
|
public:
|
|
// Properties
|
|
double GetViewDirection() const;
|
|
void GetPoly2D(XPoly2D &poly) const;
|
|
const TCHAR *GetText() const;
|
|
XPoint GetDefaultTextLocation(int nPos) const;
|
|
XPoint GetTextLocation(int nPos) const;
|
|
BOOL HasViewLine() const;
|
|
|
|
void SetPoly2D(const XPoly2D &poly);
|
|
void SetViewDirection(double vec);
|
|
void SetText(const TCHAR * pStr);
|
|
void SetTextLocation(int nPos, XPoint pt);
|
|
void SetViewLine(BOOL bTrue);
|
|
};
|
|
|
|
GEOAPI int EditSymbSection0(AcDbObjectId id);
|
|
|
|
#endif
|