#ifndef RECTIFYWIDGET_H
#define RECTIFYWIDGET_H

#include <QtGui/QWidget>
#include "ui_rectifydialog.h"
#include "rectification.h"
#include "g12buffer.h"

class RectifyDialog : public QWidget
{
    Q_OBJECT

public:
    RectifyDialog(QWidget *parent = 0);
    ~RectifyDialog();

public slots:
	/* Process the child repainting */
	void repaintChild(QPaintEvent *event, QWidget *who);
	void mouseChild(QMouseEvent *event);

	/*Events form the widgets*/
	void dialMovedSlot(int i);

	void corrListChanged(Correspondance *corr, int coornumber);
	void recalculate(void);

    void buffersChangedSlot(G12Buffer *buffer1, G12Buffer *buffer2);

signals:
	void buffersChanged(G12Buffer *left, G12Buffer *right);
	void maxDisparityChanged(int maxDisparity);

private:
    Ui::RectifyWidgetClass ui;
    G12Buffer *buffer1;
    G12Buffer *buffer2;


    vector3Dd z;

    G12Buffer *buffer1Transformed;
    G12Buffer *buffer2Transformed;


    Correspondance *list;
    int corrNumber;

    projectiveTransform2D F;
    projectiveTransform2D leftTransform;
    projectiveTransform2D rightTransform;



};

#endif // RECTIFYWIDGET_H
