#ifndef SIGNATURESDIALOG_H
#define SIGNATURESDIALOG_H

#include <QtGui/QDialog>
#include "ui_signaturesdialog.h"
#include "signatures.h"
#include "integral.h"
#include "viflow.h"
#include "signaturewidget.h"
#include "sigdistributionwidget.h"

class SignaturesDialog : public QDialog
{
    Q_OBJECT

public slots:
    void regeneratePoints(signature_t sig);

    void notifyBufferChangeSlot(G12Buffer *buf);

    void repaintChild(QPaintEvent *event, QWidget *who);
    void mouseChild(QMouseEvent *event);


    void notifyRecalculate(void);

    /*Process the text change*/
    void sDevLowChanged(int value);
    void sDevHighChanged(int value);
    void epsLowChanged(int value);
    void epsHighChanged(int value);

    /* Process the mask change*/
    void maskChanged( void );

    void parametersChangedSlot (SignatureParameters);

signals:
	void notifyCoratgesChange(CortageList *list, G12Buffer *buf);
	void parametersChanged (SignatureParameters);

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

private:
    Ui::SignaturesDialogClass ui;
    SignatureParameters sParam;

    G12Buffer *input;
    integralBuffer *integralInput;
    signaturesBuffer * signatures;
	CortageList *cortageList;

	signature_t sigToDraw;
	QList<QPoint> pointsToShow;
	QList<SignatureWidget *> infos;
	//QSpacerItem *spacer;
	QHBoxLayout *infoLayout;

	QCheckBox* (sigBoxes[16]);

	void deleteChildWidgets( void );
	void addChildWidget(int x, int y);

	SigDistributionWidget sdw;
};

#endif // SIGNATURESDIALOG_H
