#ifndef TKSELECTION_H
#define TKSELECTION_H
#include "Visualisation/CustomTracker/interface/TkSceneUpdate.h"

#include "Visualisation/CustomTracker/interface/TkLayerSelectionWindow.h"
#include <qwidget.h>
class  TkSelection : public QWidget
{
    Q_OBJECT
public:
    TkSelection( TkSceneUpdate *par, QWidget *parent=0, const char *name=0);
    TkLayerSelectionWindow *ly;
    TkSceneUpdate *tkm;
    void crea();
    QSizePolicy sizePolicy() const;
    double x[100];
    double y[100];
    int h, w, h1, w1, h2, w2, w3, h3, h6, h7, wpf, hpf;
    double w22;
    QPoint pt;
    QRect r[700], qlay[700], layer_disk[700] ;   
    int nelem, layer[700], anello[700], nlay;
    bool cliccato[700]; 
    //int sim[700];   
    
public slots:

signals:
    void myclicked(bool,int,int);
    void layer_clicked(bool,int);

protected:
    void paintEvent( QPaintEvent * );
    void mousePressEvent( QMouseEvent *);   

private: 
    double xmin, xmax, ymin, ymax;
    int xpixel(double x){
	return(int)((x-xmin)/(xmax-xmin)*width());
    }
    int ypixel(double y){
        double y1;
        y1 = (y-ymin)/(ymax-ymin);
	return height()-(int)(y1*height());
    }
};

#endif 
