#ifndef QT_INPUT_GEOMETRY_HPP
#define QT_INPUT_GEOMETRY_HPP

#include <iostream>
#include <fstream>

#include <QWidget>
#include <QVBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QDoubleValidator>
#include <QIntValidator>
#include <QPushButton>
#include "geometry.hpp"

static const double def_lX=10;
static const size_t def_nX=100;
static const size_t def_depth=1;
static const size_t def_nZ=100;

using namespace std;

class QtInputGeometry:public QWidget{
  Q_OBJECT
private:
  Geometry* geometry;
  QVBoxLayout* main_layout;
  QLabel* lX_label;
  QLabel* nX_label;
  QLabel* nZ_label;
  QLabel* depth_label;
  QLineEdit* lX_input;
  QLineEdit* nX_input;
  QLineEdit* nZ_input;
  QLineEdit* depth_input;
  QPushButton* refresh_button;
  QDoubleValidator* positive_double_validator;
  QIntValidator* positive_int_validator;
  
public:
  QtInputGeometry(Geometry* geometry);
  ~QtInputGeometry();
  QWidget* validate();
  void save(fstream& file);
  void load(fstream& file);
public slots:
  void emitGeometryChanged();
signals:
  void geometryChanged();
};

inline
QtInputGeometry::~QtInputGeometry(){
}

inline void
QtInputGeometry::emitGeometryChanged(){
  emit geometryChanged();
}

#endif
