#pragma once

class MxReadFilter;
class DL_Dxf;

class MxReadContext
{
public:
	MxReadContext(McDbDatabase* pMxDataBase,
		DL_Dxf*			pDxf,
		MxReadFilter*   pFilter
			);


	virtual ~MxReadContext(void);

	McDbDatabase* GetDatabase() const
	{
		return m_pMxDataBase;
	}

	DL_Dxf*	      GetDxf() const
	{
		return m_pDxf;
	}

	MxReadFilter* GetReadFilter() const
	{
		return m_pFilter;
	}

	void AddLineType(McDbObjectId id,MxString sTypeLine);

	void AddSysVar(MxString sVarName,struct resbuf* pVal);

	void EndReadEvent();

	McDbObjectId GetModelSpaceId() const
	{
		return m_modelSpaceId;
	}

	void SetCurSpaceId(McDbObjectId id)
	{
		m_curSpaceId = id;
	}

	McDbObjectId GetCurSpaceId() const
	{
		return m_curSpaceId;
	}


protected:
	void ReadLineType();

	void ReplaceLineTypeId();

	void ReplaceSysVar();
private:
	McDbDatabase*	m_pMxDataBase;

	DL_Dxf*			m_pDxf;
	MxReadFilter*   m_pFilter;

	std::set<MxString> m_setReadLineType;					// 在读取过程，发现线型名称。
	
	std::map<McDbObjectId,MxString> m_mapReplaceLineType;	// 读完成后，需要把替换线型名称到线型ID的对象。

	std::map<MxString,struct resbuf*> m_mapReplaceSysVar;

	McDbObjectId   m_modelSpaceId;
	McDbObjectId   m_curSpaceId;
};
