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

// (DO NOT EDIT: machine generated header) 'IEVect.pas' rev: 3.00

#ifndef IEVectHPP
#define IEVectHPP
#include <iedefs.hpp>
#include <IEUtils.hpp>
#include <Forms.hpp>
#include <StdCtrls.hpp>
#include <Controls.hpp>
#include <ImageEnView.hpp>
#include <Graphics.hpp>
#include <Classes.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Windows.hpp>
#include <SysInit.hpp>
#include <System.hpp>

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

namespace Ievect
{
//-- type declarations -------------------------------------------------------
struct TDPoint
{
	double X;
	double y;
} ;

typedef TDPoint TDPointArray[67108864];

typedef TDPointArray *PDPointArray;

enum TIEVObjectKind { iekFRAME, iekLINE, iekBOX, iekELLIPSE, iekARC, iekBITMAP, iekTEXT };

enum TIEShape { iesNONE, iesINARROW, iesOUTARROW };

struct TIEVBitmap
{
	Graphics::TBitmap* fBitmap;
	int fRefCount;
} ;

typedef TIEVBitmap *PIEVBitmap;

typedef TIEVBitmap TIEVBitmapArray[16777216];

typedef TIEVBitmapArray *PIEVBitmapArray;

enum IEVect__1 { ievsSelectable, ievsMoveable, ievsSizeable, ievsVisible };

typedef Set<IEVect__1, ievsSelectable, ievsVisible>  TIEVStyle;

struct TIEVObject;
typedef TIEVObject *PIEVObject;

struct TIEVObject
{
	int x1;
	int y1;
	int x2;
	int y2;
	TIEVObjectKind Kind;
	int ParentFrame;
	int ObjCount;
	Iedefs::IntegerArray *Obj;
	TIEShape BeginShape;
	TIEShape EndShape;
	int ShapeWidth;
	int ShapeHeight;
	Graphics::TColor PenColor;
	TPenStyle PenStyle;
	int PenWidth;
	Graphics::TColor BrushColor;
	TBrushStyle BrushStyle;
	double a1;
	double a2;
	int BitmapIdx;
	char *Text;
	tagLOGFONTA *LogFont;
	TAlignment TextAlign;
	char *Name;
	int ID;
	TIEVStyle Style;
} ;

typedef TIEVObject TIEVObjectArray[16777216];

typedef TIEVObjectArray *PIEVObjectArray;

enum TIEUnits { ieuPIXELS, ieuINCHES, ieuKM, ieuMETERS, ieuCENTIMETERS, ieuMILLIMETERS };

enum TIEMouseInteractVtItems { miArea, miLineLen, miPutLine, miPutBox, miPutEllipse, miPutBitmap, miPutText, 
	miObjectSelect };

typedef Set<TIEMouseInteractVtItems, miArea, miObjectSelect>  TIEMouseInteractVt;

typedef void __fastcall (__closure *TIEVMeasureHintEvent)(System::TObject* Sender, System::AnsiString 
	&Text, double Value);

class DELPHICLASS TImageEnVect;
class PASCALIMPLEMENTATION TImageEnVect : public Imageenview::TImageEnView 
{
	typedef Imageenview::TImageEnView inherited;
	
private:
	TIEMouseInteractVt fMouseInteractVt;
	double fScale;
	TIEUnits fMUnit;
	double fCoefX;
	double fCoefY;
	Ieutils::TIEHint* fWHint;
	int fFloatPrecision;
	int fFloatDigits;
	bool fMeasureTrack;
	int fVMoveX;
	int fVMoveY;
	Classes::TNotifyEvent fOnSelectObject;
	TIEVMeasureHintEvent fOnMeasureHint;
	TIEVObject fFBase;
	int fObjCount;
	TIEVObjectKind fInserting;
	TIEVObject fNewObj;
	Iedefs::IntegerArray *fSelObj;
	int fSelObjCount;
	int fGripping;
	int fTextEditing;
	Stdctrls::TEdit* fTextEdit;
	TIEVObjectArray *fObjHeap;
	int fObjHeapCount;
	TIEVBitmapArray *fBitmaps;
	int fBitmapsCount;
	bool fShareBitmaps;
	void __fastcall CalcCoef(void);
	void __fastcall ShowAreaHint(const tagPOINT &p);
	void __fastcall ShowLineLenHint(const tagPOINT &p);
	void __fastcall DrawLineInserting(void);
	void __fastcall DrawBoxInserting(void);
	void __fastcall DrawEllipseInserting(void);
	void __fastcall RemoveVObjData(TIEVObject &obj);
	int __fastcall AddVObject(int HFrame, const TIEVObject &aObj);
	void __fastcall RemoveVObject(int HFrame, int hobj);
	PIEVObject __fastcall GetObj(int hobj);
	void __fastcall DrawObject(Graphics::TCanvas* WCanvas, const TIEVObject &aobj, bool re);
	void __fastcall DrawObjectText(Graphics::TCanvas* wcanvas, int x1, int y1, int x2, int y2, const TIEVObject 
		&aobj, double zz);
	void __fastcall DrawObjectGrips(Graphics::TCanvas* Canvas, const TIEVObject &aobj);
	int __fastcall FindNearObj(int Frame, int x, int y, double &ds);
	double __fastcall CalcDistPtObj(PIEVObject Obj, int x, int y);
	void __fastcall DrawSelGrips(Graphics::TCanvas* Canvas);
	int __fastcall FindSelGrip(int x, int y, int &gr);
	void __fastcall TraslateObject(int o, int ox, int oy);
	void __fastcall ChangeObjectCoor(int o, int ox1, int oy1, int ox2, int oy2);
	void __fastcall SelInRect(int aobj, int xx1, int yy1, int xx2, int yy2);
	void __fastcall DrawLineShape(Graphics::TCanvas* Canvas, int x1, int y1, int x2, int y2, TIEShape Shape
		, int w, int h);
	void __fastcall AddSelObjectNS(int hobj);
	void __fastcall ActiveTextEdit(void);
	void __fastcall RemoveTextEdit(void);
	void __fastcall SaveObj(Classes::TStream* Stream, int hobj);
	void __fastcall ReadObj1_2(Classes::TStream* Stream, int HFrame);
	void __fastcall ReadObj3_4(Classes::TStream* Stream, int HFrame, System::AnsiString ver);
	TIEVObjectKind __fastcall GetObjKind(int hobj);
	void __fastcall SetObjKind(int hobj, TIEVObjectKind v);
	Graphics::TColor __fastcall GetObjPenColor(int hobj);
	void __fastcall SetObjPenColor(int hobj, Graphics::TColor v);
	Graphics::TPenStyle __fastcall GetObjPenStyle(int hobj);
	void __fastcall SetObjPenStyle(int hobj, Graphics::TPenStyle v);
	int __fastcall GetObjPenWidth(int hobj);
	void __fastcall SetObjPenWidth(int hobj, int v);
	Graphics::TColor __fastcall GetObjBrushColor(int hobj);
	void __fastcall SetObjBrushColor(int hobj, Graphics::TColor v);
	Graphics::TBrushStyle __fastcall GetObjBrushStyle(int hobj);
	void __fastcall SetObjBrushStyle(int hobj, Graphics::TBrushStyle v);
	Graphics::TBitmap* __fastcall GetObjBitmap(int hobj);
	void __fastcall SetObjBitmap(int hobj, Graphics::TBitmap* v);
	int __fastcall GetSelObjects(int idx);
	void __fastcall SetObjBeginShape(int hobj, TIEShape v);
	TIEShape __fastcall GetObjBeginShape(int hobj);
	void __fastcall SetObjEndShape(int hobj, TIEShape v);
	TIEShape __fastcall GetObjEndShape(int hobj);
	void __fastcall SetObjShapeWidth(int hobj, int v);
	int __fastcall GetObjShapeWidth(int hobj);
	void __fastcall SetObjShapeHeight(int hobj, int v);
	int __fastcall GetObjShapeHeight(int hobj);
	void __fastcall SetObjText(int hobj, System::AnsiString v);
	System::AnsiString __fastcall GetObjText(int hobj);
	void __fastcall SetObjName(int hobj, System::AnsiString v);
	System::AnsiString __fastcall GetObjName(int hobj);
	void __fastcall SetObjFontAngle(int hobj, double v);
	double __fastcall GetObjFontAngle(int hobj);
	int __fastcall GetObjFontHeight(int hobj);
	void __fastcall SetObjFontHeight(int hobj, int v);
	System::AnsiString __fastcall GetObjFontName(int hobj);
	void __fastcall SetObjFontName(int hobj, System::AnsiString v);
	Graphics::TFontStyles __fastcall GetObjFontStyles(int hobj);
	void __fastcall SetObjFontStyles(int hobj, Graphics::TFontStyles v);
	void __fastcall SetObjTextAlign(int hobj, Classes::TAlignment v);
	Classes::TAlignment __fastcall GetObjTextAlign(int hobj);
	void __fastcall SetObjLeft(int hobj, int v);
	int __fastcall GetObjLeft(int hobj);
	void __fastcall SetObjTop(int hobj, int v);
	int __fastcall GetObjTop(int hobj);
	void __fastcall SetObjWidth(int hobj, int v);
	int __fastcall GetObjWidth(int hobj);
	void __fastcall SetObjHeight(int hobj, int v);
	int __fastcall GetObjHeight(int hobj);
	void __fastcall SetObjID(int hobj, int v);
	int __fastcall GetObjID(int hobj);
	void __fastcall SetObjStyle(int hobj, TIEVStyle v);
	TIEVStyle __fastcall GetObjStyle(int hobj);
	Graphics::TBitmap* __fastcall GetBitmap(int idx);
	void __fastcall FreeBitmap(int idx);
	int __fastcall AllocBitmap(void);
	void __fastcall PackBMP(void);
	int __fastcall FindBitmap(Graphics::TBitmap* SBitmap);
	void __fastcall SetObjBitmapNU(int hobj, Graphics::TBitmap* v);
	void __fastcall SetObjBitmapIdxNU(int hobj, int idx);
	void __fastcall VPaintTo(Graphics::TCanvas* Canvas);
	
protected:
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
		int Y);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
		Y);
	virtual void __fastcall SetMouseInteract(Imageenview::TIEMouseInteract v);
	void __fastcall SetMouseInteractVt(TIEMouseInteractVt v);
	HIDESBASE TIEMouseInteractVt __fastcall GetMouseInteract(void);
	void __fastcall SetMUnit(TIEUnits v);
	void __fastcall SetScale(double v);
	void __fastcall SetFloatDigits(int v);
	void __fastcall SetFloatPrecision(int v);
	void __fastcall UpdateHint(int x, int y);
	virtual void __fastcall ViewChange(int c);
	virtual void __fastcall SubMouseMoveScroll(int scx, int scy);
	int __fastcall GetObjPos(int hframe, int hobj);
	void __fastcall ReInsertVObject(int HFrame, int hobj, int pos);
	
public:
	int ObjDrawed;
	__fastcall virtual TImageEnVect(Classes::TComponent* Owner);
	__fastcall virtual ~TImageEnVect(void);
	virtual void __fastcall Paint(void);
	virtual void __fastcall PaintTo(Graphics::TCanvas* Canvas);
	virtual void __fastcall Update(void);
	__property TIEMouseInteractVt MouseInteractVt = {read=GetMouseInteract, write=SetMouseInteractVt, default=0
		};
	virtual void __fastcall SetDPIX(int dpiX);
	virtual void __fastcall SetDPIY(int dpiY);
	double __fastcall GetSelectionArea(void);
	double __fastcall GetSelectionLen(void);
	__property bool MeasureTrack = {read=fMeasureTrack, write=fMeasureTrack, default=1};
	void __fastcall SetScaleFromPixels(int px, double mm);
	__property double ScaleFactor = {read=fScale, write=SetScale};
	void __fastcall SetScaleFromSelectionLen(double mm);
	virtual void __fastcall AddSelPoint(int x, int y);
	virtual void __fastcall Select(int x1, int y1, int x2, int y2);
	void __fastcall CancelInteracts(void);
	__property TIEVObjectKind ObjKind[int hobj] = {read=GetObjKind, write=SetObjKind};
	__property Graphics::TColor ObjPenColor[int hobj] = {read=GetObjPenColor, write=SetObjPenColor};
	__property Graphics::TPenStyle ObjPenStyle[int hobj] = {read=GetObjPenStyle, write=SetObjPenStyle};
		
	__property int ObjPenWidth[int hobj] = {read=GetObjPenWidth, write=SetObjPenWidth};
	__property Graphics::TColor ObjBrushColor[int hobj] = {read=GetObjBrushColor, write=SetObjBrushColor
		};
	__property Graphics::TBrushStyle ObjBrushStyle[int hobj] = {read=GetObjBrushStyle, write=SetObjBrushStyle
		};
	__property Graphics::TBitmap* ObjBitmap[int hobj] = {read=GetObjBitmap, write=SetObjBitmap};
	__property TIEShape ObjBeginShape[int hobj] = {read=GetObjBeginShape, write=SetObjBeginShape};
	__property TIEShape ObjEndShape[int hobj] = {read=GetObjEndShape, write=SetObjEndShape};
	__property int ObjShapeWidth[int hobj] = {read=GetObjShapeWidth, write=SetObjShapeWidth};
	__property int ObjShapeHeight[int hobj] = {read=GetObjShapeHeight, write=SetObjShapeHeight};
	__property System::AnsiString ObjText[int hobj] = {read=GetObjText, write=SetObjText};
	__property double ObjFontAngle[int hobj] = {read=GetObjFontAngle, write=SetObjFontAngle};
	__property int ObjFontHeight[int hobj] = {read=GetObjFontHeight, write=SetObjFontHeight};
	__property System::AnsiString ObjFontName[int hobj] = {read=GetObjFontName, write=SetObjFontName};
	__property Graphics::TFontStyles ObjFontStyles[int hobj] = {read=GetObjFontStyles, write=SetObjFontStyles
		};
	__property Classes::TAlignment ObjTextAlign[int hobj] = {read=GetObjTextAlign, write=SetObjTextAlign
		};
	__property int ObjLeft[int hobj] = {read=GetObjLeft, write=SetObjLeft};
	__property int ObjTop[int hobj] = {read=GetObjTop, write=SetObjTop};
	__property int ObjWidth[int hobj] = {read=GetObjWidth, write=SetObjWidth};
	__property int ObjHeight[int hobj] = {read=GetObjHeight, write=SetObjHeight};
	__property System::AnsiString ObjName[int hobj] = {read=GetObjName, write=SetObjName};
	__property int ObjID[int hobj] = {read=GetObjID, write=SetObjID};
	__property TIEVStyle ObjStyle[int hobj] = {read=GetObjStyle, write=SetObjStyle};
	void __fastcall GetObjRect(int hobj, Windows::TRect &Rect);
	void __fastcall SetObjRect(int hobj, const Windows::TRect &Rect);
	void __fastcall SetObjFont(int hobj, Graphics::TFont* v);
	void __fastcall SetObjBitmapICO(int hobj, int ico, int iwidth, int iheight);
	void __fastcall SetObjFrontOf(int hobj, int refobj);
	void __fastcall SetObjBackTo(int hobj, int refobj);
	bool __fastcall IsSelObject(int hobj);
	void __fastcall UnSelObject(int hobj);
	void __fastcall AddSelObject(int hobj);
	void __fastcall UnSelAllObjects(void);
	void __fastcall RemoveAllObjects(void);
	void __fastcall RemoveObject(int hobj);
	int __fastcall AddNewObject(void);
	__property int SelObjects[int idx] = {read=GetSelObjects};
	__property int SelObjectsCount = {read=fSelObjCount, nodefault};
	void __fastcall CopyObjectsToBack(void);
	int __fastcall GetObjFromName(const System::AnsiString oName);
	int __fastcall GetObjFromID(int oID);
	void __fastcall ImportDXF(const System::AnsiString nf);
	void __fastcall SaveToFileIEV(const System::AnsiString nf);
	void __fastcall SaveToStreamIEV(Classes::TStream* Stream);
	void __fastcall LoadFromFileIEV(const System::AnsiString nf);
	void __fastcall LoadFromStreamIEV(Classes::TStream* Stream);
	void __fastcall CopyToClipboard(void);
	void __fastcall PasteFromClipboard(void);
	void __fastcall InsertFromClipboard(int x, int y);
	void __fastcall CutToClipboard(void);
	
__published:
	__property TIEUnits MUnit = {read=fMUnit, write=SetMUnit, default=0};
	__property int FloatDigits = {read=fFloatDigits, write=SetFloatDigits, default=2};
	__property int FloatPrecision = {read=fFloatPrecision, write=SetFloatPrecision, default=15};
	__property bool ShareBitmaps = {read=fShareBitmaps, write=fShareBitmaps, default=1};
	__property Classes::TNotifyEvent OnSelectObject = {read=fOnSelectObject, write=fOnSelectObject};
	__property TIEVMeasureHintEvent OnMeasureHint = {read=fOnMeasureHint, write=fOnMeasureHint};
public:
		
	/* TWinControl.CreateParented */ __fastcall TImageEnVect(HWND ParentWindow) : Imageenview::TImageEnView(
		ParentWindow) { }
	
};

//-- var, const, procedure ---------------------------------------------------
extern PACKAGE System::AnsiString strunits[6];
#define GRIPDIM (Byte)(4)
#define NULLOBJ (Shortint)(-4)
#define DEFWIDTH (Byte)(64)
#define DEFHEIGHT (Byte)(64)

}	/* namespace Ievect */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Ievect;
#endif
//-- end unit ----------------------------------------------------------------
#endif	// IEVect
