// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'CGM.pas' rev: 4.00

#ifndef CGMHPP
#define CGMHPP

#pragma delphiheader begin
#pragma option push -w-
#include <TTF.hpp>	// Pascal unit
#include <MVFont.hpp>	// Pascal unit
#include <Math.hpp>	// Pascal unit
#include <sgConsts.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 Cgm
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TCGMTypeEntity { cgmNone, cgmArc, cgmCircle, cgmCircularArcCenter, cgmCircularArcCenterClose, cgmEllipse, 
	cgmEllipticalArc, cgmEllipticalArcClose, cgmPolygone, cgmPolyline, cgmRectangle, cgmText, cgmPolyBezier, 
	cgmDisjtPolyline, cgmMarker };
#pragma option pop

typedef void __fastcall (__closure *TcgmProgressEvent)(Graphics::TProgressStage Stage, int Done, int 
	Count);

struct TsgParametrs;
typedef TsgParametrs *PsgParametrs;

#pragma pack(push, 4)
struct TsgParametrs
{
	
	union
	{
		struct 
		{
			int Parametrs;
			
		};
		struct 
		{
			Word FirstTwoParams;
			Word LastTwoParams;
			
		};
		struct 
		{
			Byte Params[4];
			
		};
		struct 
		{
			Byte Param1;
			Byte Param2;
			Byte Param3;
			Byte Param4;
			
		};
		
	};
} ;
#pragma pack(pop)

struct TsgEntProperty;
typedef TsgEntProperty *PsgEntProperty;

#pragma pack(push, 4)
struct TsgEntProperty
{
	Graphics::TColor Color;
	int TypeLine;
	Word Visibility;
	double Width;
	int WidthSpecificationMode;
} ;
#pragma pack(pop)

class DELPHICLASS TCGMParameters;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TCGMParameters : public System::TObject 
{
	typedef System::TObject inherited;
	
protected:
	TsgParametrs FParameters;
	
public:
	__fastcall TCGMParameters(void);
	int __fastcall FourToOne(Byte AValue1, Byte AValue2, Byte AValue3, Byte AValue4);
	void __fastcall ThreeToTwo(Byte AValue1, Byte AValue2, Byte AValue3);
	short __fastcall TwoToOne(Byte AValue1, Byte AValue2);
	void __fastcall TwoToThree(Byte AValue1, Byte AValue2);
	__property Byte Parameter1 = {read=FParameters.Param1, nodefault};
	__property Byte Parameter2 = {read=FParameters.Param2, nodefault};
	__property Byte Parameter3 = {read=FParameters.Param3, nodefault};
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TCGMParameters(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

class DELPHICLASS TsgCGMImage;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TsgCGMImage : public Dxfimage::TsgDXFImage 
{
	typedef Dxfimage::TsgDXFImage inherited;
	
private:
	Graphics::TColor FBackgroundColor;
	int FBits;
	AnsiString FBuffer;
	int FBufferSize;
	Sgconsts::TFRect FCharOrientation;
	Classes::TList* FColors;
	int FColorSelectionMode;
	double FDigitDiv;
	TsgEntProperty FEdgeProperty;
	bool FError;
	AnsiString FFileName;
	Graphics::TColor FFillColor;
	bool FFillColorDraw;
	bool FFillColorHave;
	tagSIZE FFormatData;
	int FHatchIndex;
	int FIndexBuffer;
	int FIndexFunction;
	int FInteriorStyle;
	bool FIsBinary;
	bool FIsDigitDWord;
	bool FIsDouble;
	bool FIsMonochromTable;
	bool FIsVDCExtKoef;
	AnsiString FKeyWord;
	Classes::TStringList* FKeyWords;
	Dxfconv::TsgDXFLayer* FLayer;
	TsgEntProperty FLineProperty;
	double FLineTypeScale;
	int FMarkerSizeMode;
	int FMetafileElementListCode;
	int FMetafileVersion;
	TcgmProgressEvent FOnProgress;
	TCGMParameters* FParameters;
	AnsiString FProfileId;
	Dxfconv::TsgDXFText* FRestText;
	bool FStopLoading;
	Windows::TPoint FTextAlign;
	Graphics::TColor FTextColor;
	int FTextFontIndex;
	double FTextHeight;
	double FTextScaleX;
	TCGMTypeEntity FTypeEntity;
	int FUpdateProgress;
	int FUpdateProgressCount;
	Windows::TRect FVDCExt;
	Sgconsts::TFPoint FVDCExtKoef;
	Windows::TPoint FVDCExtrution;
	int FVDCMode;
	Graphics::TColor __fastcall GetColorByIndex(const int AIndex);
	Byte __fastcall GetDataBuffer(const int AIndex);
	short __fastcall GetDataBuffer2(const int AIndex);
	int __fastcall GetDataBuffer4(const int AIndex);
	int __fastcall GetTagLength(void);
	
protected:
	void __fastcall AddEntity(Dxfconv::TsgDXFEntity* AEntity);
	void __fastcall AddEntitiesFromList(Classes::TList* AList);
	void __fastcall AddHatchFromList(Classes::TList* AList);
	void __fastcall AddHatchOfArc(Classes::TList* AHatch, Dxfconv::TsgDXFArc* AArc);
	void __fastcall AddHatchOfCircle(Classes::TList* AHatch, Dxfconv::TsgDXFCircle* ACircle);
	void __fastcall AddHatchOfEllipse(Classes::TList* AHatch, Dxfconv::TsgDXFEllipse* AEllipse);
	void __fastcall AddHatchOfPolyBezier(Classes::TList* AHatch, Dxfconv::TsgDXFSpline* ASpline);
	void __fastcall AddHatchOfPolyline(Classes::TList* AHatch, Dxfconv::TsgDXFPolyline* APoly);
	void __fastcall AddStyleByText(const AnsiString AFontName);
	void __fastcall AnalizeHead(void);
	void __fastcall AnalizePictureBody(void);
	void __fastcall AnalizeTextFile(void);
	HIDESBASE void __fastcall DoProgress(Graphics::TProgressStage Stage, int Done, int Count);
	double __fastcall GetAngleRotateByText(const Sgconsts::PFRect ARect);
	int __fastcall IndexOfKeyWordsObject(PsgParametrs AParams);
	void __fastcall InitStandartStyleByText(void);
	void __fastcall InvertColor(Graphics::TColor &AColor);
	bool __fastcall IsDrawHatch(void);
	bool __fastcall IsEvent(int AVal);
	bool __fastcall IsHasHatch(void);
	void __fastcall LoadKeyWords(void);
	Dxfconv::TsgDXFPolyline* __fastcall MakeCloseLineByArc(Dxfconv::TsgDXFCircle* AArc, bool AType);
	void __fastcall MakeLineType(void);
	void __fastcall MakePolyBezier(Dxfconv::TsgDXFSpline* &AEntity);
	void __fastcall ReadAltCharSetIndex(void);
	void __fastcall ReadApndText(void);
	void __fastcall ReadArc(void);
	void __fastcall ReadAttributes(void);
	void __fastcall ReadBackGroundColor(void);
	void __fastcall ReadCellArray(void);
	void __fastcall ReadCharacterHeight(void);
	void __fastcall ReadCharacterOrientation(void);
	void __fastcall ReadCharSetIndex(void);
	void __fastcall ReadCharSpace(void);
	void __fastcall ReadCircle(void);
	void __fastcall ReadCircularArcCenter(void);
	void __fastcall ReadCircularArcCenterClose(void);
	void __fastcall ReadColor(Graphics::TColor &AColor);
	unsigned __fastcall ReadDigit(void);
	void __fastcall ReadEdgeVisibility(void);
	void __fastcall ReadEllipse(void);
	void __fastcall ReadEllipticalArc(void);
	void __fastcall ReadEllipticalArcClose(void);
	void __fastcall ReadFillColor(void);
	void __fastcall ReadLenMetadata(void);
	void __fastcall ReadLineToMoveTo(void);
	void __fastcall ReadMetafileDescription(void);
	void __fastcall ReadMetafileElementList(void);
	void __fastcall ReadMetafileFontList(void);
	void __fastcall ReadMetafileName(void);
	int __fastcall ReadOneParams(int &AParams);
	Windows::TPoint __fastcall ReadPoint(void);
	void __fastcall ReadPolyBezier(void);
	void __fastcall ReadPolyline(TCGMTypeEntity ATypeEntity);
	void __fastcall ReadQuantityBitsInDigit(void);
	void __fastcall ReadRastrImage(void);
	void __fastcall ReadRectangle(void);
	void __fastcall ReadRestrTextType(void);
	void __fastcall ReadScale(void);
	void __fastcall ReadTableColor(void);
	void __fastcall ReadText(void);
	void __fastcall ReadTextAlign(void);
	void __fastcall ReadTextPath(void);
	void __fastcall ReadTextScaleX(void);
	void __fastcall ReadType(int &AType);
	void __fastcall ReadUnknowBlock(void);
	void __fastcall ReadVDCextent(void);
	void __fastcall ReadVDCExtKoef(void);
	void __fastcall ReadVDCType(void);
	void __fastcall ReadWidth(double &AWidth);
	Byte __fastcall ReadWord(void);
	Sgconsts::TFPoint __fastcall ReCalcPoint(const Windows::TPoint &APoint);
	Graphics::TColor __fastcall RGBToTColor(Byte AR, Byte AG, Byte AB);
	void __fastcall SetupPropertyEntity(Dxfconv::TsgDXFEntity* AEntity, PsgEntProperty AEntProperty);
	double __fastcall StringToFloat(AnsiString vString);
	void __fastcall UpdateProgress(void);
	
public:
	__fastcall virtual TsgCGMImage(void);
	__fastcall virtual ~TsgCGMImage(void);
	virtual void __fastcall LoadFromStream(Classes::TStream* AStream);
	virtual void __fastcall StopLoading(void);
	__property bool Error = {read=FError, nodefault};
	__property AnsiString FileName = {read=FFileName};
	__property bool IsBinary = {read=FIsBinary, nodefault};
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
#define SCGMImage "CGM image"
extern PACKAGE Word CF_CGM;

}	/* namespace Cgm */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Cgm;
#endif
#pragma option pop	// -w-

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