#ifndef SGMDIALOG_H
#define SGMDIALOG_H

#include <QtGui/QDialog>
#include "g12buffer.h"
#include "disparity.h"
#include "ui_sgmdialog.h"

class SGMDialog : public QDialog
{
    Q_OBJECT

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

    static void callback(int path, int persent);
    static SGMDialog *instance;


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

   void buffersChangedSlot(G12Buffer *buffer1, G12Buffer *buffer2);
   void maxDisparityChangedSlot(int maxDisparity);
   void recalculate(void);

signals:
	void setBuffers(G12Buffer *image, DisparityBuffer *disparity, double focal);


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

    G12Buffer *dispLeft;
    G12Buffer *dispRight;
    G12Buffer *totalDisp;

    DisparityBuffer *trueDisp;

    QCheckBox* pathes[8];

	uint32_t *sArrayTest;
	uint32_t *cArrayTest;
	uint32_t *pArrayTest;

};

#endif // SGMDIALOG_H
