#pragma once

#include "DxfLib\dl_entities.h"

class DL_WriterA;
class DL_Dxf;
class MxReadFilter;

class MxReadContext;
class MxWriteContext;

class MxOptBlockTable
{
public:
	MxOptBlockTable(MxWriteContext* pWriteContext);
	MxOptBlockTable(MxReadContext* pReadContext);
	
	virtual ~MxOptBlockTable(void);

	
	McDbObjectId Dxf2Mx(const DL_BlockData& data);

	bool Mx2Dxf(DL_WriterA* dw);

	
	void WriteBlockEntity(MxString sBlkName,DL_WriterA* dw);
protected:
	void WriteEntity(McDbBlockTableRecord* pBlkRec,DL_WriterA* dw);

	void WriteBlock(MxString sBlkName,DL_WriterA* dw,bool isWriteEntity);
private:
	MxWriteContext* m_pWriteContext;

	MxReadContext*  m_pReadContext;
};
