// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'DWG12.pas' rev: 6.00

#ifndef DWG12HPP
#define DWG12HPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <DWG.hpp>	// Pascal unit
#include <SGLines.hpp>	// Pascal unit
#include <sgConsts.hpp>	// Pascal unit
#include <Extrusion.hpp>	// Pascal unit
#include <DXFImage.hpp>	// Pascal unit
#include <DXFConv.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Dwg12
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *Tdwg12Proc)(Dxfconv::TsgDXFEntity* &E);

#pragma pack(push, 1)
struct Tdwg12Table
{
	Word Size;
	int Nr;
	int Start;
} ;
#pragma pack(pop)

#pragma pack(push, 1)
struct Tdwg12Header
{
	Byte Version[20];
	int Entities;
	int EntEnd;
	int Blocks;
	int Unused1;
	int BlockEnd;
	int Unused2;
	Tdwg12Table BlockRecs;
	Tdwg12Table Layers;
	Tdwg12Table Styles;
	Tdwg12Table LTypes;
} ;
#pragma pack(pop)

class DELPHICLASS Tdwg12Reader;
class PASCALIMPLEMENTATION Tdwg12Reader : public Dwg::TdwgReader 
{
	typedef Dwg::TdwgReader inherited;
	
private:
	Classes::TStringList* FBlkRecs;
	Dxfconv::TsgDXFEntity* FLastBlk;
	Dxfconv::TsgDXFEntity* FLastEnt;
	int FLastPos;
	int FDone;
	int FCount;
	#pragma pack(push, 1)
	Tdwg12Header FHeader;
	#pragma pack(pop)
	
	bool __fastcall OldVer(void);
	Byte __fastcall ReadByte(void);
	Word __fastcall ReadWord(void);
	double __fastcall ReadDouble(void);
	double __fastcall ReadAngle(void);
	HIDESBASE System::TObject* __fastcall NewObject(Byte Kind);
	AnsiString __fastcall NextBlkName();
	HIDESBASE void __fastcall DoProgress(Graphics::TProgressStage Stage);
	void __fastcall FindBlock(Dxfconv::TsgDXFInsert* I);
	void __fastcall ReadBlks(void);
	void __fastcall ReadVPorts(void);
	void __fastcall ReadTable(const Tdwg12Table &ATable, Dxfconv::TsgDXFGroup* AOwner, Tdwg12Proc Proc);
	void __fastcall ReadLayer(Dxfconv::TsgDXFEntity* &E);
	void __fastcall ReadLType(Dxfconv::TsgDXFEntity* &E);
	void __fastcall ReadEntities(int AStart, int AEnd);
	
protected:
	virtual void __fastcall ReadHeader(void);
	virtual void __fastcall ReadObjects(void);
	virtual void __fastcall ReadImage(void);
	
public:
	__fastcall Tdwg12Reader(Dxfconv::TsgDXFConverter* Conv, Classes::TStream* S);
	__fastcall virtual ~Tdwg12Reader(void);
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Dwg12 */
using namespace Dwg12;
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// DWG12
