MyCADInfo.h
上传用户:netltd
上传日期:2013-02-12
资源大小:7234k
文件大小:3k
- /////////////////////////////////////////////////////////////////////////////
- #include "MyDefine.h"
- //////////////////////////////////////////////////////////////////////
- //图纸信息类
- class CFileInfo: public CObject
- {
- public:
- CFileInfo(CString name, CString filename, CString filepath, CSize size, COLORREF pencolor,
- int linestyle, COLORREF backcolor);
- DECLARE_SERIAL(CFileInfo)
- CFileInfo()
- {}
- CFileInfo(const CFileInfo& Info);
- operator =(const CFileInfo& Info);
- CString m_Name;
- CString m_FileName;
- CString m_FilePath;
- CSize m_Size; //图纸尺寸
- COLORREF m_PenColor;
- int m_LineStyle;
- COLORREF m_BackColor;
- public:
- virtual ~CFileInfo();
- void Serialize(CArchive& ar);
- };
- /////////////////////////////////////////////////////////////////////////////////////////////
- class CFileIndex : public CObject
- {
- public:
- CFileIndex(CString name, CString filename, CString filepath);
- DECLARE_SERIAL(CFileIndex)
- CFileIndex()
- {}
- private:
- CString m_name;
- CString m_filename;
- CString m_filepath;
- public:
- CString GetName();
- CString GetFileName();
- CString GetFilePath();
- void SetFileIndex(CString name, CString filename, CString filepath);
- void Serialize(CArchive& ar);
- };
- //////////////////////////////////////////////////////////////////////////////////////////////
- //项目信息类
- class CProjectInfo: public CObject
- {
- public:
- CProjectInfo();
- DECLARE_SERIAL(CProjectInfo)
- CString Name;
- CString FileName;
- CString FilePath;
-
- private:
- CObArray m_FileIndexArray;
- public:
- void AddFileIndex(CString name, CString filename, CString filepath);
- void DelFileIndex(CString name);
- int GetFileIndexNum();
- CFileIndex* GetFileIndex(int index);
- //注意不允许文件名重复
- CFileIndex* FindFileIndex(CString name);
-
- public:
- virtual ~CProjectInfo();
- void Serialize(CArchive& ar);
- };
- ////////////////////////////////////////////////////////////////////////////
- // CCADInfo document
- class CCADInfo : public CObject
- {
- // Attributes
- public:
- CCADInfo();
- BOOL IsEmpty; //如果有新建或打开的项目、图纸或元件为FALSE,否则为TRUE
- UINT KindofNew; //项目、图纸或模板标志
- CString ProjectPath; //缺省项目路径
- CString FilePath; //缺省图纸文件路径
-
- int OpenedFileNum;
- int ActiveFileIndex;
- COLORREF PenColor; //缺省画笔颜色
- int LineStyle; //缺省线型
- COLORREF BackColor; //缺省背景色
-
- CFileInfo FileInfo;
- // Operations
- public:
- virtual ~CCADInfo();
- };