//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
#define Nmax 1000
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "OpenGLPanel.h"
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <CheckLst.hpp>
#include <vector>
#include <stdio.h>
#include "AUV.h"
#include <list.h>
#include "box.h"
#include "interval.h"
#include <fstream>

//---------------------------------------------------------------------------

typedef struct
{  float x,y,z,v,psi,grosseur; }Camera;

typedef struct
{  double t,latmes,lonmes,latref,lonref;
   interval distance;
   int mine;
   int k;} Ping;
//        temps        latitude         longitude        latitude de       longitude de   Numéro de
//       CAN(sec)      mesurée          mesurée        référence        référence         la mine



typedef struct mine
{  double latPrior;
   double lonPrior;
   double xPrior,yPrior,zPrior;
   box P;} Mine;


class TForm1 : public TForm
{
__published:	    // IDE-managed Components
    TOpenGLPanel *OpenGLPanel1;
    TTimer *TimerAffichage;
    TLabel *Label13;
        TPanel *Panel1;
        TGroupBox *GroupBoxCam;
        TLabel *Label3;
        TLabel *tangage;
        TLabel *Label7;
        TLabel *Label8;
        TEdit *EditXcam;
        TEdit *EditYcam;
        TEdit *EditPsiCam;
        TButton *ButtonContract;
        TEdit *EditZcam;
        TTrackBar *TrackBarCamPsi;
        TTrackBar *TrackBarCamV;
        TLabel *Label20;
        TLabel *Label21;
        TTrackBar *TrackBarCamZ;
        TLabel *Label22;
        TLabel *Label23;
        TTrackBar *TrackBarCamCiblez;
        TLabel *Label24;
        TCheckListBox *CheckListBoxGraphic;
        TTrackBar *TrackBarGrosseur;
        TLabel *Label25;
        TButton *ContractForward;
        TButton *ContractMine;
        TButton *ButtonContractBackward;
        TButton *ButtonContractInit;
        TTrackBar *TrackBarFog;
        TLabel *Label1;
        TButton *ButtonContractEssai;
    void __fastcall OpenGLPanel1Init(TObject *Sender);
    void __fastcall OpenGLPanel1Paint(TObject *Sender);
    void __fastcall TimerAffichageClock(TObject *Sender);
        void __fastcall CheckListBoxGraphicClick(TObject *Sender);
        void __fastcall ContractForwardClick(TObject *Sender);
        void __fastcall ContractMineClick(TObject *Sender);
        void __fastcall ButtonContractBackwardClick(TObject *Sender);
        void __fastcall ButtonContractInitClick(TObject *Sender);
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
        void __fastcall ButtonContractEssaiClick(TObject *Sender);

private:	// User declarations
        void printValues(void);


public:		// User declarations
    __fastcall TForm1(TComponent* Owner);
    Camera cam;
    float dT;

    bool WithDrawAUV,WithDrawMer,WithDrawPing,WithDrawMine,WithDrawEnveloppe;

    //float hauteur;
    bool NoSolution;
    fstream Fout;
    vector <Mine> mines;
    vector <Ping> pings;


        FILE *state;
        long kmax;
        vector <double >  temps;
        vector <interval> phi;
        vector <interval> theta;
        vector <interval> psi;
        vector <int> pingNb;
        vector <box> V; //vitesse
        vector <box> P; //position
        vector <box> P_Euler; //position calculées par Euler
        vector <interval> depth;
        vector <interval> altitude;
        double GPSfinalx;
        double GPSfinaly;
        interval errormine;
        interval errorDistSonar;
        


    AUV AUV1;
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif









