//#####################################################################
// Copyright 2022, Craig Schroeder.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#ifndef __QT_SLICE_MODE__
#define __QT_SLICE_MODE__

#include <Core/Data_Structures/HASHTABLE.h>
#include <Core/Grids/GRID.h>
#include "QT_WINDOW.h"
#include <functional>
#include <QDialog>
#include <QKeyEvent>
#include <QMainWindow>
#include <QWindow>

QT_BEGIN_NAMESPACE
// class QPainter;
// class QOpenGLContext;
// class QOpenGLPaintDevice;
// class QOpenGLShaderProgram;
// class QOpenGLFunctions;
// class QMenu;
class QGridLayout;
class QLineEdit;
class QPushButton;
class QRadioButton;
QT_END_NAMESPACE

namespace PhysBAM{
// class QT_WORLD;
// class QT_RENDER_UTILS;
// class QT_COMPONENT;
// class PARSE_ARGS;
// template<class T> class INTERPOLATED_SLICE_MODE;

class QT_SLICE_MODE : public QDialog
{
    Q_OBJECT

public:
    typedef VECTOR<float,3> TV;
    QT_SLICE_MODE(QT_MAIN_WINDOW& main_window,const GRID<TV>& grid);
    virtual ~QT_SLICE_MODE();

public slots:
    void Close();
private:
    void Update_Index();
    void Set_Index(int index);
    void Set_Axis(int axis);
    void Action_Quit();
    void Change_Index();

    QT_MAIN_WINDOW& main_window;
    GRID<TV> grid;
    QGridLayout *layout = nullptr;
    QRadioButton *axis_x = nullptr;
    QRadioButton *axis_y = nullptr;
    QRadioButton *axis_z = nullptr;
    QLineEdit* slice_i= nullptr;
    QPushButton *slice_m = nullptr;
    QPushButton *slice_p = nullptr;
    QPushButton *exit_slice_mode = nullptr;
};
}
#endif
