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

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

#ifndef CADtoDXFHPP
#define CADtoDXFHPP

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

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

namespace Cadtodxf
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TsgApplyBlocksProc)(Dxfconv::TsgDXFBlock* ABlock, const AnsiString AName);

class DELPHICLASS TsgCADtoDXF;
class PASCALIMPLEMENTATION TsgCADtoDXF : public Cadexport::TsgCADExport 
{
	typedef Cadexport::TsgCADExport inherited;
	
private:
	HPALETTE FAutoCADPalette;
	Dxfimage::TsgDXFImage* FCADImage;
	unsigned FHandle;
	Classes::TList* FHandlesList;
	bool FHasViewPortWindow;
	bool FPaperMode;
	Dxfconv::TsgDXFBlock* FSGBlock;
	AnsiString FSGVersionMessage;
	Classes::TStream* FStream;
	Sgconsts::TsgDWGVersion FVersion;
	int __fastcall ColorToDXF(Graphics::TColor Value);
	void __fastcall CreateAutoCADPalette(void);
	void __fastcall DoExport(Dxfconv::TsgDXFEntity* E);
	AnsiString __fastcall ExtractLayerName(AnsiString ALayerName);
	Dxfconv::TsgDXFLayout* __fastcall GetPaperLayout(void);
	AnsiString __fastcall GetCorrectBlockName(AnsiString AName);
	AnsiString __fastcall GetMultibyteString(Dxfconv::TsgDXFEntity* ATextEntity);
	void __fastcall ApplyBlocksByProc(TsgApplyBlocksProc AProc);
	void __fastcall ProcBlockRecord(Dxfconv::TsgDXFBlock* ABlock, const AnsiString AName);
	void __fastcall ProcBlock(Dxfconv::TsgDXFBlock* ABlock, const AnsiString AName);
	
protected:
	void __fastcall Add2DFlatPoint(const int Code, const Sgconsts::TFPoint &Pt);
	void __fastcall Add2DPoint(const int Code, const Sgconsts::TF2DPoint &Pt);
	void __fastcall Add3DPoint(const int Code, const Sgconsts::TFPoint &Pt);
	void __fastcall Add3DPointExtruded(const int Code, const Sgconsts::TFPoint &Pt, const Sgconsts::TFPoint &Extr);
	void __fastcall AddCode(const int AValue);
	void __fastcall AddCommonEntityGroup(Dxfconv::TsgDXFEntity* AEntity);
	void __fastcall AddCommonEntityGroupEx(Dxfconv::TsgDXFEntity* AEntity, const AnsiString AName, const AnsiString ASubName);
	void __fastcall AddCommonTableGroup(Dxfconv::TsgDXFEntity* AEntity, const AnsiString ABaseName, const AnsiString ASub, const AnsiString AName, const int AHandleCode, const int AFlags);
	void __fastcall AddDXFColor(const Graphics::TColor AValue);
	void __fastcall AddEntName(Dxfconv::TsgDXFEntity* AEntity, const AnsiString AName);
	void __fastcall AddExtrusion(const Sgconsts::TFPoint &Pt);
	void __fastcall AddFloat(const int Code, double Value);
	void __fastcall AddHandle(Dxfconv::TsgDXFEntity* AEntity, const int Code, const unsigned AParentHandle);
	void __fastcall AddHexInt(const int Code, const unsigned Value);
	void __fastcall AddInt(const int Code, const int Value);
	void __fastcall AddLineWeight(const double AValue);
	void __fastcall AddLineType(Dxfconv::TsgDXFLineType* ALineType);
	void __fastcall AddLTypeScale(const double AValue);
	void __fastcall AddString(const int Code, const AnsiString Str);
	void __fastcall AddStringByCount(const int Code, const int Count, const AnsiString Str);
	void __fastcall AddSubclassMarker(const AnsiString Str);
	void __fastcall AddThickness(const double AValue);
	void __fastcall AddVisibility(const bool AValue);
	void __fastcall BeginSection(const AnsiString AName);
	void __fastcall BeginTable(Dxfconv::TsgDXFGroup* AGroup, const AnsiString AName);
	void __fastcall EndOfFile(int APos);
	void __fastcall EndSection(void);
	void __fastcall EndTable(void);
	bool __fastcall Export3DFace(Dxfconv::TsgDXF3dFace* F3D);
	bool __fastcall ExportACISEntity(Dxfconv::TsgDXFACISEntity* ACIS);
	bool __fastcall ExportArc(Dxfconv::TsgDXFArc* A);
	bool __fastcall ExportCircle(Dxfconv::TsgDXFCircle* C);
	bool __fastcall ExportDimension(Dxfconv::TsgDXFDimension* D);
	bool __fastcall ExportEllipse(Dxfconv::TsgDXFEllipse* E);
	bool __fastcall ExportFlatHatch(Dxfconv::TsgFlatHatch* FH);
	bool __fastcall ExportFlatPoly(Dxfconv::TsgFlatPoly* FP);
	bool __fastcall ExportHatch(Dxfconv::TsgCADPolyPolygon* PP);
	bool __fastcall ExportInsert(Dxfconv::TsgDXFInsert* INS);
	bool __fastcall ExportLeader(Dxfconv::TsgDXFLeader* L);
	bool __fastcall ExportLine(Dxfconv::TsgDXFLine* L);
	bool __fastcall ExportMText(Dxfconv::TsgDXFMText* MT);
	bool __fastcall ExportPoint(Dxfconv::TsgDXFPoint* P);
	bool __fastcall ExportPolyLine(Dxfconv::TsgDXFPolyline* PL);
	bool __fastcall ExportSolid(Dxfconv::TsgDXFSolid* S);
	bool __fastcall ExportSpline(Dxfconv::TsgDXFSpline* SPL);
	bool __fastcall ExportText(Dxfconv::TsgDXFText* T);
	bool __fastcall ExportViewPort(Dxfconv::TsgDXFViewport* V);
	void __fastcall ExportSectionBLOCKS(void);
	void __fastcall ExportSectionENTITIES(void);
	int __fastcall ExportSectionHEADER(void);
	void __fastcall ExportSectionOBJECTS(void);
	void __fastcall ExportSectionTABLES(void);
	void __fastcall ExportTablesAPPID(void);
	void __fastcall ExportTablesBLOCK_RECORD(void);
	void __fastcall ExportTablesDIMSTYLE(void);
	void __fastcall ExportTablesLAYER(void);
	void __fastcall ExportTablesLTYPE(void);
	void __fastcall ExportTablesSTYLE(void);
	void __fastcall ExportTablesVPORT(void);
	void __fastcall ExportTablesVIEW(void);
	void __fastcall ExportTablesUCS(void);
	AnsiString __fastcall GetStringDXFVersion();
	void __fastcall InitializeVersionData(const Byte AVersion, const AnsiString AMessage);
	
public:
	__fastcall virtual TsgCADtoDXF(Dxfimage::TsgDXFImage* ACADImage);
	__fastcall virtual ~TsgCADtoDXF(void);
	__property Sgconsts::TsgDWGVersion Version = {read=FVersion, write=FVersion, nodefault};
	virtual void __fastcall SaveToStream(Classes::TStream* S);
};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE AnsiString cnstDXFExportVersion;

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

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