MyCADInfo.cpp
上传用户:netltd
上传日期:2013-02-12
资源大小:7234k
文件大小:2k
- // MyCADInfo.cpp : implementation file
- //////////////////////////////////////////////////////////////////////////////////////////////
- // CCADInfo
- #include "stdafx.h"
- #include "MyCADInfo.h"
- CFileLayer::CFileLayer(CString name, int index, BOOL show, BOOL locked)
- {
- m_name = name;
- m_index = index;
- m_show = show;
- m_locked = locked;
- }
- void CFileLayer::SetShow()
- {
- m_show = TRUE;
- }
- void CFileLayer::SetLocked()
- {
- m_locked = TRUE;
- }
- void CFileLayer::SetIndex(int index)
- {
- m_index = index;
- }
- void CFileLayer::Serialize(CArchive& ar)
- {
- if(ar.IsStoring())
- {
- ar << m_name << m_index << m_show << m_locked;
- }
- else
- {
- ar >> m_name >> m_index >> m_show >> m_locked;
- }
- }
- //////////////////////////////////////////////////////////////////////////////////////////////
- CCADInfo::CCADInfo()
- {
- char pDir[_MAX_PATH];
- //获取当前路径
- ::GetCurrentDirectory(_MAX_PATH,pDir);
- //省缺的项目文件路径为当前路径
- ProjectPath = pDir;
- //省缺的图纸文件路径为当前路径
- FilePath = pDir;
-
- IsEmpty = TRUE;
- KindofNew = NEW_NONE;
-
- PenColor = RGB(0, 0, 0); //缺省画笔颜色为黑色
- LineStyle = PS_SOLID; //缺省画笔线形
- BackColor = RGB (200, 255, 255); //缺省背景色为淡青色
-
- }
- CCADInfo::~CCADInfo()
- {
- }
- //////////////////////////////////////////////////////////////////////////////////////////////
- //CFileInfo
- IMPLEMENT_SERIAL(CFileInfo, CObject, 1)
- CFileInfo::CFileInfo()
- {
- size.cx = 0;
- size.cy = 0;
- }
- CFileInfo::CFileInfo(const CFileInfo& Info)
- {
- Name = Info.Name;
- FileName = Info.FileName;
- FilePath = Info.FilePath;
- size.cx = Info.size.cx;
- size.cy = Info.size.cy;
- }
- CFileInfo::operator =(const CFileInfo& Info)
- {
- Name = Info.Name;
- FileName = Info.FileName;
- FilePath = Info.FilePath;
- size.cx = Info.size.cx;
- size.cy = Info.size.cy;
- }
- CFileInfo::~CFileInfo()
- {
- }
- void CFileInfo::Serialize(CArchive& ar)
- {
- if(ar.IsStoring())
- {
- ar << Name << FilePath << FileName << size;
- }
- else
- {
- ar >> Name >> FilePath >> FileName >> size;
- }
- }
- //////////////////////////////////////////////////////////////////////////////////////////////
- // CProjectInfo
- IMPLEMENT_SERIAL(CProjectInfo, CObject, 1)
- CProjectInfo::CProjectInfo()
- {
- //初始图纸数目为0
- FileNum = 0;
- }
- CProjectInfo::~CProjectInfo()
- {
- }