DwgConverter.h
上传用户:hell82222
上传日期:2013-12-19
资源大小:1872k
文件大小:3k
- // KMCAD40-FileSwitch-DwgConverter.h-1.0
- // DwgConverter.h: interface for the CDwgConverter class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_DWGCONVERTER_H__3B441884_C368_4A86_A7F2_52D615BE8FEE__INCLUDED_)
- #define AFX_DWGCONVERTER_H__3B441884_C368_4A86_A7F2_52D615BE8FEE__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "stdafx.h"
- #include "Converter.h"
- #include "CommandInfo.h"
- #include "CShow.h"
- #include "KmMatch.h"
- #include "KmDim.h"
- typedef struct tagENTDWGHEAD
- {
- short scolor;
- short swidth;
- double dscale;
- AD_OBJHANDLE hltype;
- AD_OBJHANDLE hlayer;
- }ENTDWGHEAD;
- class CDwgConverter : public CConverter
- {
- public:
- CDwgConverter(CCommandInfo* pCommand);
- virtual ~CDwgConverter();
- public:
- BOOL BeginConverter();
- BOOL EndConverter();
- BOOL allocateadptrs(void); //为DWG读取包申请内存空间.
- void freeadptrs(void); //为DWG读取包释放内存空间.
- public:
- CShow* m_pTextCalcShow; //用于计算文本外接矩形的显示
- AD_DB_HANDLE m_dwghandle;
- CCommandInfo* m_pCommand;
- AD_VMADDR m_DataVassel;
- // AD_OBJHANDLE m_Shape;
- PAD_DWGHDR adhd; //adhd -- header structure
- PAD_ENT_HDR adenhd; //adenhd -- entity header structure
- PAD_ENT aden; //aden -- entity body structure
- PAD_OBJ_HDR adobhd;
- PAD_OBJ adob;
- PAD_TB adtb; //adtb -- union containing the various table structures
- PAD_XD adxd; //adxd -- extended data structure
- short sReturnValue;
- long m_lShapeIndex;
- ENTDWGHEAD m_enthead;
- void AddObject();
- void GetAppHandle(AD_OBJHANDLE* objhandle);
- public:
- void WriteEnthead(short scolor,short swidth,double dscale,AD_OBJHANDLE& hltype,AD_OBJHANDLE& hlayer);
- void SetBlockDataVassel(AD_OBJHANDLE handle);
- void SetModelDataVassel();
- void ConverterEntity_AdLine(double x1,double y1,double z1,double x2,double y2,double z2);
- void ConverterEntity_AdCircle(double x1,double y1,double z1,double ra);
- void ConverterEntity_AdArc(double x1,double y1,double z1,double radius,double ba,double ea);
- void ConverterEntity_AdText(S_TEXT* text);
- void ConverterEntity_AdInsert(double x0,double y0,double z0,double xs,double ys,double zs,double ang,AD_OBJHANDLE handle);
- void ConverterEntity_AdSolid(short scolor,double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4);
- void ConverterKmLegend(double x0,double y0,double dx,double dy);
- void AddEndBlkSign();
- void AddBegBlkSign(double x0,double y0,double z0);
- BOOL ConverterEntity_KmBlockdef(CString strName,CMatch2* match);
- BOOL ConverterEntity_AdDimHead(KmDim* pDim);
- BOOL ConverterEntity_AdSimpleDim(KmDim* pDim,KmPoint p1,KmPoint p2,KmPoint p3,double dAngle,AD_OBJHANDLE handle,AD_OBJHANDLE hDimStyle,AD_VMADDR blob);
- BOOL ConverterEntity_AdRadiusDim(KmDim* pDim,KmPoint p1,KmPoint p2,AD_OBJHANDLE handle,AD_OBJHANDLE hDimStyle,AD_VMADDR blob);
- BOOL ConverterEntity_AdDiameterDim(KmDim* pDim,KmPoint p1,KmPoint p2,AD_OBJHANDLE handle,AD_OBJHANDLE hDimStyle,AD_VMADDR blob);
- BOOL ConverterEntity_AdAngleDim(KmDim* pDim,KmPoint p1,KmPoint p2,KmPoint p3,KmPoint p4,KmPoint p5,AD_OBJHANDLE handle,AD_OBJHANDLE hDimStyle,AD_VMADDR blob);
- CString ConverterTabEntName(CString strName);
- };
- #endif // !defined(AFX_DWGCONVERTER_H__3B441884_C368_4A86_A7F2_52D615BE8FEE__INCLUDED_)