DXF图元文件提取与显示(一)
来源:互联网 发布:澳门mac book pro价格 编辑:程序博客网 时间:2024/05/17 01:47
#include "StdAfx.h"#include "DXFMeta.h"//图元名称const string DXFMeta::NAMES[MetaTypes]={"OTHER","LINE","CIRCLE","POLYLINE"};//************************************// 图元对象是所有图元的基类,针对DXF的行和偏移// 的字节数,利用虚函数读取相关图元信息来构建一// 个图元对象// Method: DXFMeta// FullName: DXFMeta::DXFMeta// Access: public // Returns: // Qualifier:// Parameter: UINT rCount所在DXF文件的行号// Parameter: UINT seekBytes所在DXF文件的字节// 偏移位置// Author:zhengzhe 2011-11-22//************************************DXFMeta::DXFMeta(UINT rCount,UINT seekBytes){m_rowEndIndex=m_rowStartIndex=rCount;m_memSeekEndPos=m_memSeekStartPos=seekBytes;type = OTHER;}DXFMeta::~DXFMeta(void){}//************************************// 获取图元名称// Method: GetName// FullName: DXFMeta::GetName// Access: public // Returns: std::string// Qualifier: const// Author:zhengzhe 2011-11-22//************************************std::string DXFMeta::GetName() const{return NAMES[GetMetaType()];}//************************************// 获取图元类型// Method: GetMetaType// FullName: DXFMeta::GetMetaType// Access: public // Returns: DXFMeta::DXFMetaType// Qualifier: const// Author:zhengzhe 2011-11-22//************************************DXFMeta::DXFMetaType DXFMeta::GetMetaType() const{return type;}//************************************// 读取一行信息的更新操作,增加一行,并更新读写指针// 偏移的字节数// Method: IncrementCount// FullName: DXFMeta::IncrementCount// Access: public // Returns: void// Qualifier:// Parameter: DXFMeta & meta// Parameter: char * tmp// Author:zhengzhe 2011-11-22//************************************void DXFMeta::IncrementCount( DXFMeta &meta, char * tmp ){++meta.m_rowEndIndex;meta.m_memSeekEndPos+=(strlen(tmp)+1)*sizeof(char);}//************************************// 获取线信息在文档中的结束位置的偏移字节数// Method: GetSeekEndPos// FullName: DXFLine::GetSeekEndPos// Access: virtual public // Returns: UINT// Qualifier: const// Author: zhengzhe 2011-11-21//************************************UINT DXFMeta::GetSeekEndPos() const{return m_memSeekEndPos;}//************************************// 获取信息结束的行号// Method: GetRowEndIndex// FullName: DXFMeta::GetRowEndIndex// Access: public // Returns: UINT// Qualifier: const// Author:zhengzhe 2011-11-21//************************************UINT DXFMeta::GetRowEndIndex() const{return m_rowEndIndex;}//************************************// 获取信息开始的行号// Method: GetRowStartIndex// FullName: DXFMeta::GetRowStartIndex// Access: public // Returns: UINT// Qualifier: const// Author:zhengzhe 2011-11-21//************************************UINT DXFMeta::GetRowStartIndex() const{return m_rowStartIndex;}//************************************// 获取未修改前信息数据的字节大小// Method: GetOrgByteSize// FullName: DXFMeta::GetOrgByteSize// Access: public // Returns: UINT// Qualifier: const// Author:zhengzhe 2011-11-21//************************************UINT DXFMeta::GetOrgByteSize() const{return m_orgByteSize;}//************************************// 获取修改后信息数据的字节大小// Method: GetCurByteSize// FullName: DXFMeta::GetCurByteSize// Access: public // Returns: UINT 字节数// Qualifier: const// Author:zhengzhe 2011-11-21//************************************UINT DXFMeta::GetCurByteSize() const{return m_curByteSize;}//************************************// 计算当前字节大小// Method: CalCurByteSize// FullName: DXFMeta::CalCurByteSize// Access: public // Returns: void// Qualifier:// Author:zhengzhe 2011-11-21//************************************void DXFMeta::CalCurByteSize(){m_curByteSize = m_memSeekEndPos-m_memSeekStartPos;}//************************************// 获取该线段描述开始在文档中偏移的字节位置// Method: GetSeekStartPos :// FullName: DXFLine::GetSeekStartPos// Access: virtual public // Returns: UINT// Qualifier: const// Author:zhengzhe 2011-11-21//************************************UINT DXFMeta::GetSeekStartPos() const{return m_memSeekStartPos;}//************************************// 显示图元基本信息// Method: operator<<// FullName: operator<<// Access: public // Returns: ostream&// Qualifier:// Parameter: ostream & os// Parameter: const DXFMeta & meta// Author:zhengzhe 2011-11-21//************************************ostream& operator<<( ostream& os,const DXFMeta& meta ){os<<"Meta Info:\n"<<"----------------------------------"<<"\n\tMeta Name:"<< meta.GetName()<<"\n\tOrgInfo Byte Size:"<<meta.GetOrgByteSize()<<"\tCurInfo Byte Size:"<<meta.GetCurByteSize()<<"\n\tStart At Line No:"<<meta.m_rowStartIndex<<"\tEnd At Line No:"<<meta.m_rowEndIndex<<"\n\tSeek Byte:"<<meta.GetSeekStartPos();return os;}
http://blog.csdn.net/password318/article/details/7009939
- DXF图元文件提取与显示(一)
- DXF图元文件提取与显示(一)
- DXF图元文件提取与显示(二)-Line
- DXF图元文件提取与显示(三)-Circle
- DXF图元文件提取与显示(二)-Line
- DXF图元文件提取与显示(三)-Circle
- AutoCAD dxf 文件保存图元的顺序
- [C#][CAD][dxf]提取dxf中指定的数据到TXT文件中
- C/C++ 图像处理(15)------DXF文件の读取、绘图与显示
- WPF读取DXF文件(一)——DXF文件的分段存储
- DXF文件解析显示(读取,合并,保存)
- 基于开源dxflib解析库的dxf文件显示
- 基于开源dxflib解析库的dxf文件显示
- dwg文件怎么与dxf文件互转
- C++读取和生成dxf文件(一)
- C# 读取DXF文件
- WinAPI 读取DXF文件
- vb读dxf文件
- 三角形余弦定理
- 电子邮件书写规则
- Super用法
- 风雨过后 问答网站Answers.com再获融资
- 设计模式13——Bridge设计模式
- DXF图元文件提取与显示(一)
- hdu1978
- 取消IOS对App Icon抛光
- inserter、back_inserter、front_inserter
- IE6解决PNG问题
- 关于DOM SAX StAX JAXP JDOM DOM4J Xerces Crimson
- 获取IOS的当前版本号
- DXF图元文件提取与显示(二)-Line
- 很有意思的NumericUpDown的Value