KmgConverter.h
上传用户:hell82222
上传日期:2013-12-19
资源大小:1872k
文件大小:5k
源码类别:

CAD

开发平台:

Visual C++

  1. // KmgConverter.h: interface for the CKmgConverter class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_KMGCONVERTER_H__01EEF460_52CC_4030_9E29_9E00B48CD8BE__INCLUDED_)
  5. #define AFX_KMGCONVERTER_H__01EEF460_52CC_4030_9E29_9E00B48CD8BE__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "Database.h"
  10. #include "Converter.h"
  11. #include "KmSection.h"
  12. #include "KmShare.h"
  13. #include "KmObject.h"
  14. #include "KmText.h"
  15. #include "KmSText.h"
  16. #include "CommandInfo.h"
  17. #include "KmMatch.h"
  18. class CShape;
  19. typedef struct tagENTKMGHEAD
  20. {
  21. int ilwidth;
  22. int icolor;
  23. int iltype;
  24. double dlscale;
  25. UINT idlayer;
  26. }ENTKMGHEAD;
  27. class CKmgConverter : public CConverter  
  28. {
  29. public:
  30. CKmgConverter(CCommandInfo* pCommand);
  31. virtual ~CKmgConverter();
  32. public:
  33. CMap<int,int,int,int> m_aLayerStatus;//备份层的状态。   FROZEN OFF
  34. void SaveLayerStatus();
  35. void LoadLayerStatus();
  36. void ResetLayerStatus();
  37. double m_dSysDimScale;
  38. BOOL BeginConverter();
  39. BOOL EndConverter();
  40. BOOL SetDataVessel(int dVessel,DWORD dwKmID=0);
  41. int GetDataVessel(DWORD& dwKmID);
  42. void WriteEnthead(int ilwidth,int icolor,int iltype,double dlscale,UINT idlayer);
  43. void WriteEnthead(int icolor,int iltype);
  44. BOOL SaveAndReinitDataBase(UINT utDimStyleReplace,CString strfilename,BOOL bModel=TRUE);
  45. void UniteModelToSpace(double xoffset,double yoffset,double zoffset,double scale,double minx,double miny,double maxx,double maxy,int mode);
  46. BOOL CheckNoUseBlock(DWORD dwKmID);
  47. public:
  48. void Calculate_ChangeFont(CWordStyle* pWordStyle);
  49. DWORD ConverterEnthead_Layer(BOOL bOn,BOOL bFrozen,CString strName,int icolor,int ilwidth,int iltype);
  50. DWORD ConverterEnthead_Blockdefine(CString strName,CString strDescription);
  51. void  ConverterEnthead_XrefBlock(DWORD dwid,double x1,double y1,double z1,CString XrefPath);
  52. UINT  ConverterEnthead_Dimstyle(PAD_DIMSTYLE dimstyle,CArray<int,int>& acolor,int iLWidthDefault,CMatchList5& ashape,BOOL bAdjusted,double dTextHeight,double dArrowSize,double dDimValueRate,UINT utWordStyle);
  53. UINT  ConverterEnthead_Dimstyle(CDimStyle cdimstyle,BOOL bAdjusted,double dTextHeight,double dArrowSize,double dDimValueRate,UINT utWordStyle);
  54. KMOBJECTID ConverterEntiey_KmObject(KmObject* pObj);
  55. KMOBJECTID ConverterEntiey_KmLine(double x1,double y1,double z1,double x2,double y2,double z2);
  56. KMOBJECTID ConverterEntiey_KmCircle(double x1,double y1,double z1,double ra);
  57. KMOBJECTID ConverterEntiey_KmEllipse(double x1,double y1,double z1,double lr,double sr,double angle,BOOL b90Mirror);
  58. KMOBJECTID ConverterEntiey_KmEllipseArc(double x1,double y1,double z1,double lr,double sr,double angle,double ba,double ea,BOOL b90Mirror);
  59. KMOBJECTID ConverterEntiey_KmArc(double x1,double y1,double z1,double radius,double ba,double ea);
  60. KMOBJECTID ConverterEntiey_KmSPline(int mode,AD_VMADDR ldblob,unsigned short numknots,unsigned short numctlpts,unsigned short numfittps);
  61. KMOBJECTID ConverterEntiey_KmBlockref(double x1,double y1,double z1,double xs,double ys,double zs,double ra,DWORD id,BOOL b90Mirror);
  62. BOOL    ConverterEntiey_KmBlockdef(double x1,double y1,double z1);
  63. KMOBJECTID ConverterEntiey_KmSText(CString strText,double x0,double y0,double z0,PAD_TDATA style,CShape* shape);
  64. KMOBJECTID ConverterEntiey_KmText(CString strEnter,double x0,double y0,double z0,double angle,double texthight,double widthhight, double spacehight,char flag,double height,double width,CShape* shape,double maxWidth);
  65. KMOBJECTID ConverterEntiey_KmText(BOOL btol,CString strEnter,double x0,double y0,double z0,double texthight,double angle,double width,double space,CShape* shape);
  66. KmText*    ConverterEntiey_KmText(BOOL btol,double x0,double y0,double z0,double texthight,double angle,double width,double space,CShape* shape,CString strEnter);
  67. BOOL    ConverterEntiey_KmString(KmText* pText,CString strText,UINT baseWS);
  68. BOOL    ConverterEntiey_KmMString(KmText*pText,CString& strText,UINT baseWS,CUIntArray& aWSIDs,BOOL btol=FALSE,BOOL bdim=FALSE);
  69. BOOL    ConverterEntiey_KmMString(CString& strText);
  70. BOOL    ConverterEntiey_KmTString(KmText*pText,CString strEnter,UINT baseWS);
  71. void    ConverterEntiey_KmArrow(double x1,double y1,double z1,double x2,double y2,double z2,double width);
  72. BOOL    ConverterEntiey_KmArrowHead(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4);
  73. BOOL    ConverterEntiey_KmArrowHead(double x1,double y1,double x2,double y2,double dwidth);
  74. BOOL    ConverterEntiey_KmBuffer(KmBuffer& buff,CString blockname,CString blockdescrip,KmPoint po);
  75. BOOL ConverterDbVar(KMDBVarID nID, VARIANT& var);
  76. BOOL ConverterPreSave_IndentifyExtendInfo();
  77. BOOL ConverterPreSave_KmLegend(BOOL bRected,KmRect rect);
  78. private:
  79. CCommandInfo* m_pCommand;
  80. ENTKMGHEAD m_enthead;
  81. int m_dDataVessel;
  82. CKmDataManager* m_pDataManager;
  83. CList<KmObject*,KmObject*>m_ModelSpace;
  84. KmBlockDef* m_pActiveBlockDef;
  85. private:
  86. KMOBJECTID AddObject(KmObject* pObj,BOOL bSetHead=TRUE);
  87. BOOL calculate_findpilechars(CString& strText);
  88. BOOL calculate_findtolchars(CString strText,int &i,char &symbl);
  89. char calculate_findtoltype(char symbl);
  90. BOOL calculate_findfont(CString& strFont);
  91. public:
  92. void ReActiveDataManager();
  93. short m_sCodePage;
  94. };
  95. #endif // !defined(AFX_KMGCONVERTER_H__01EEF460_52CC_4030_9E29_9E00B48CD8BE__INCLUDED_)