2022-06-23 21:36:00 -04:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
#include <interleaf.h>
|
|
|
|
#include <object.h>
|
|
|
|
#include <QGroupBox>
|
2022-06-23 21:36:00 -04:00
|
|
|
#include <QMainWindow>
|
2022-06-24 13:46:25 -04:00
|
|
|
#include <QStackedWidget>
|
2022-07-04 02:34:49 -04:00
|
|
|
#include <QTreeView>
|
2022-06-23 21:36:00 -04:00
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
#include "objectmodel.h"
|
2022-07-10 23:51:49 -04:00
|
|
|
#include "panel.h"
|
2022-07-21 20:39:13 -04:00
|
|
|
#include "vector3edit.h"
|
2022-07-18 23:22:52 -04:00
|
|
|
#include "viewer/mediapanel.h"
|
2022-06-23 21:36:00 -04:00
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
void OpenFilename(const QString &s);
|
|
|
|
|
2022-06-23 21:36:00 -04:00
|
|
|
signals:
|
|
|
|
|
|
|
|
private:
|
|
|
|
void InitializeMenuBar();
|
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
void SetPanel(Panel *panel, si::Object *chunk);
|
|
|
|
|
|
|
|
void ExtractObject(si::Object *obj);
|
2022-07-18 03:27:00 -04:00
|
|
|
void ReplaceObject(si::Object *obj);
|
|
|
|
|
|
|
|
static bool OpenInterleafFileInternal(QWidget *parent, si::Interleaf *interleaf, const QString &s);
|
|
|
|
|
|
|
|
QString GetOpenFileName();
|
|
|
|
|
|
|
|
static const QString kFileFilter;
|
2022-06-24 13:46:25 -04:00
|
|
|
|
|
|
|
QStackedWidget *config_stack_;
|
|
|
|
|
2022-07-10 23:51:49 -04:00
|
|
|
QTreeView *tree_;
|
2022-07-04 02:34:49 -04:00
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
QGroupBox *action_grp_;
|
|
|
|
|
2022-06-24 13:46:25 -04:00
|
|
|
Panel *panel_blank_;
|
2022-07-18 23:22:52 -04:00
|
|
|
MediaPanel *panel_media_;
|
2022-06-24 13:46:25 -04:00
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
ObjectModel model_;
|
|
|
|
si::Interleaf interleaf_;
|
|
|
|
|
|
|
|
si::Object *last_set_data_;
|
2022-06-24 13:46:25 -04:00
|
|
|
|
2022-07-18 03:27:00 -04:00
|
|
|
QString current_filename_;
|
|
|
|
|
2022-07-21 20:39:13 -04:00
|
|
|
QGroupBox *properties_group_;
|
|
|
|
|
2023-08-25 22:40:12 -04:00
|
|
|
QLineEdit *m_extraEdit;
|
2022-07-21 20:39:13 -04:00
|
|
|
Vector3Edit *m_LocationEdit;
|
2023-08-23 17:34:23 -04:00
|
|
|
Vector3Edit *m_UpEdit;
|
2022-07-21 20:39:13 -04:00
|
|
|
|
|
|
|
QSpinBox *start_time_edit_;
|
|
|
|
|
2022-06-23 21:36:00 -04:00
|
|
|
private slots:
|
2022-07-18 03:27:00 -04:00
|
|
|
void NewFile();
|
2022-06-23 21:36:00 -04:00
|
|
|
void OpenFile();
|
2022-07-18 03:27:00 -04:00
|
|
|
bool SaveFile();
|
|
|
|
bool SaveFileAs();
|
2022-07-11 17:20:05 -04:00
|
|
|
|
2022-06-24 13:46:25 -04:00
|
|
|
void SelectionChanged(const QModelIndex &index);
|
|
|
|
|
2022-07-04 02:34:49 -04:00
|
|
|
void ShowContextMenu(const QPoint &p);
|
|
|
|
|
|
|
|
void ExtractSelectedItems();
|
2022-07-11 04:48:50 -04:00
|
|
|
void ExtractClicked();
|
|
|
|
|
2022-07-18 03:27:00 -04:00
|
|
|
void ReplaceClicked();
|
|
|
|
|
|
|
|
void ViewSIFile();
|
|
|
|
|
2023-08-25 22:40:12 -04:00
|
|
|
void ExtraChanged(const QString &v);
|
2022-07-21 20:39:13 -04:00
|
|
|
void LocationChanged(const si::Vector3 &v);
|
2023-08-23 17:34:23 -04:00
|
|
|
void UpChanged(const si::Vector3 &v);
|
2022-07-21 20:39:13 -04:00
|
|
|
void StartTimeChanged(int t);
|
|
|
|
|
2022-06-23 21:36:00 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|