#pragma once #include //画块信息结构体 typedef struct CDrawData { AcDbObjectId idBlock; //块id AcGeScale3d scale; //压缩比 CString sText; //注释文字 AcGeVector3d vecOffet; //基点偏移量 }DRAWDATA; //图例块和相应注释文字的插入位置坐标结构体 typedef struct CCoordinateData { AcGePoint3d ptImage; AcGePoint3d ptText; }COORDINATEDATA; class TDbLayoutLegend : public TDbEntity { DECLARE_TENTBASE(); public: ACRX_DECLARE_MEMBERS(TDbLayoutLegend) ; TDbLayoutLegend() ; virtual ~TDbLayoutLegend () ; virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const; virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag); void Push_Back(TCHAR* pszBlockName,TCHAR* pszText); //块数据入列 void SetLocation(AcGePoint3d &pt); //设置基点 void SetCloumnWidth(CList* listCloumnWdith){m_listCloumnWdith = listCloumnWdith;} protected: double m_dWidthStd; //画图边框宽 double m_dHeightStd;//画图边框高 //计算坐标表的偏移常量 const double m_dPtImageXOffet; const double m_dPtImageYOffet; const double m_dPtImageYStepOffet; const double m_dptTextXOffet; const double m_dptTextYOffet; const double m_dptTextYStepOffet; CList* m_listCloumnWdith; protected: void MakeCoordinateTable(int iSize); private: AcGePoint3d m_ptLocation; //本对象基点 AcDbObjectId n_idTextStyle; //文字样式 std::vector m_vecDrawData; //块数据队列 std::vector m_vecCoordinateData;//坐标表 double m_dRot; //文字转角 } ;