151 lines
6.6 KiB
C++
151 lines
6.6 KiB
C++
/*
|
|
Stanley Designer
|
|
Ivan Pelipenko peri4ko@yandex.ru
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef QGLVIEWWINDOW_H
|
|
#define QGLVIEWWINDOW_H
|
|
|
|
#include "loader_3ds.h"
|
|
#include "loader_ase.h"
|
|
#include "renderer_deferred_shading.h"
|
|
#include "renderer_simple.h"
|
|
#include "session_manager.h"
|
|
#include "ui_qglview_window.h"
|
|
|
|
#include <QClipboard>
|
|
#include <QCloseEvent>
|
|
#include <QColorDialog>
|
|
#include <QFileDialog>
|
|
#include <QInputDialog>
|
|
#include <QRadioButton>
|
|
#include <QSplitter>
|
|
#include <QThread>
|
|
#include <QTime>
|
|
#include <QTranslator>
|
|
#include <QUrl>
|
|
// #include "renderer_rt.h"
|
|
#include "glparticles_system.h"
|
|
#include "qglview.h"
|
|
#include "ui_qglview_window.h"
|
|
|
|
|
|
class QGLViewWindow
|
|
: public QMainWindow
|
|
, public Ui::QGLViewWindow {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
QGLViewWindow(QWidget * parent = 0);
|
|
~QGLViewWindow();
|
|
|
|
void loadFile(const QString & path);
|
|
|
|
private:
|
|
// Qt`s overloaded
|
|
void changeEvent(QEvent * e);
|
|
void timerEvent(QTimerEvent *);
|
|
|
|
void importFile(const QString & path);
|
|
void makeObjetTree(const GLObjectBase * o, QTreeWidgetItem * ti);
|
|
|
|
QTranslator translator;
|
|
QIcon icon_geo, icon_camera, icon_light;
|
|
QString prev_path;
|
|
GLObjectBase *sel_obj, *axis;
|
|
Light * cam_light;
|
|
GLPrimitiveCube * box;
|
|
Material m;
|
|
SessionManager session;
|
|
bool isChanged;
|
|
|
|
GLParticlesSystem partsys;
|
|
|
|
private slots:
|
|
void on_spinFOV_valueChanged(double val) { view->view()->setFOV(val); }
|
|
void on_spinDepthStart_valueChanged(double val) { view->view()->setDepthStart(val); }
|
|
void on_spinDepthEnd_valueChanged(double val) { view->view()->setDepthEnd(val); }
|
|
void on_comboRenderer_currentIndexChanged(int val);
|
|
void on_comboViewRenderMode_currentIndexChanged(int val) {
|
|
static int modes[] = {GL_POINT, GL_LINE, GL_FILL};
|
|
view->view()->setRenderMode((GLObjectBase::RenderMode)modes[val]);
|
|
}
|
|
void on_groupHoverHalo_clicked(bool val) { view->view()->setHoverHaloEnabled(val); }
|
|
void on_groupSelectionHalo_clicked(bool val) { view->view()->setSelectionHaloEnabled(val); }
|
|
void on_spinHoverHaloFill_valueChanged(double val) { view->view()->setHoverHaloFillAlpha(val); }
|
|
void on_spinSelectionHaloFill_valueChanged(double val) { view->view()->setSelectionHaloFillAlpha(val); }
|
|
void on_colorHoverHalo_colorChanged(QColor color) { view->view()->setHoverHaloColor(color); }
|
|
void on_colorSelectionHalo_colorChanged(QColor color) { view->view()->setSelectionHaloColor(color); }
|
|
void on_checkFXAA_clicked(bool val) { view->view()->setFeature(QGLView::qglFXAA, val); }
|
|
void on_checkMSAA_clicked(bool val) { view->view()->setFeature(QGLView::qglMSAA, val); }
|
|
void on_colorBack_colorChanged(QColor color) { view->view()->setBackColor(color); }
|
|
void on_colorAmbient_colorChanged(QColor color) { view->view()->setAmbientColor(color); }
|
|
void on_checkCameraOrbit_clicked(bool val) { view->view()->setCameraOrbit(val); }
|
|
void on_spinViewLineWidth_valueChanged(double val) { view->view()->setLineWidth(val); }
|
|
|
|
void on_groupShadows_clicked(bool val) { view->view()->setFeature(QGLView::qglShadowsEnabled, val); }
|
|
void on_groupEyeAccomodation_clicked(bool val) { view->view()->setFeature(QGLView::qglEyeAccomodationEnabled, val); }
|
|
void on_groupBloom_clicked(bool val) { view->view()->setFeature(QGLView::qglBloomEnabled, val); }
|
|
void on_groupMotionBlur_clicked(bool val) { view->view()->setFeature(QGLView::qglMotionBlurEnabled, val); }
|
|
void on_groupReflections_clicked(bool val) { view->view()->setFeature(QGLView::qglReflectionsEnabled, val); }
|
|
void on_checkSoftShadows_clicked(bool val) { view->view()->setFeature(QGLView::qglShadowsSoftEnabled, val); }
|
|
void on_groupSSAO_clicked(bool val) { view->view()->setFeature(QGLView::qglSSAOEnabled, val); }
|
|
void on_groupDOF_clicked(bool val) { view->view()->setFeature(QGLView::qglDepthOfFieldEnabled, val); }
|
|
void on_checkDOFAutoFocus_clicked(bool val) { view->view()->setFeature(QGLView::qglDepthOfFieldAutoFocusEnabled, val); }
|
|
void on_spinDOFFocus_valueChanged(double val) { view->view()->setFeature(QGLView::qglDepthOfFieldFocus, val); }
|
|
void on_spinDOFDiaphragm_valueChanged(double val) { view->view()->setFeature(QGLView::qglDepthOfFieldDiaphragm, val); }
|
|
void on_spinDOFSpeed_valueChanged(double val) { view->view()->setFeature(QGLView::qglDepthOfFieldAutoFocusSpeed, val); }
|
|
void on_spinAccom_valueChanged(double val) { view->view()->setFeature(QGLView::qglEyeAccomodationTime, val); }
|
|
void on_spinAccomMS_valueChanged(double val) { view->view()->setFeature(QGLView::qglEyeAccomodationMaxSpeed, val); }
|
|
void on_checkReflectionsBlur_clicked(bool val) { view->view()->setFeature(QGLView::qglReflectionsBlur, val); }
|
|
void on_spinShadowmapSize_valueChanged(double val) { view->view()->setFeature(QGLView::qglShadowsMapSize, val); }
|
|
void on_spinMotionBlurFactor_valueChanged(double val) { view->view()->setFeature(QGLView::qglMotionBlurFactor, val); }
|
|
void on_spinMotionBlurSteps_valueChanged(int val) { view->view()->setFeature(QGLView::qglMotionBlurSteps, val); }
|
|
void on_spinBloomFactor_valueChanged(double val) { view->view()->setFeature(QGLView::qglBloomFactor, val); }
|
|
void on_spinBloomRadius_valueChanged(int val) { view->view()->setFeature(QGLView::qglBloomRadius, val); }
|
|
void on_spinBloomThreshold_valueChanged(double val) { view->view()->setFeature(QGLView::qglBloomThreshold, val); }
|
|
void on_spinSSAORadius_valueChanged(int val) { view->view()->setFeature(QGLView::qglSSAORadius, val); }
|
|
|
|
void on_actionExit_triggered() { close(); }
|
|
void on_actionReset_triggered();
|
|
void on_actionImport_triggered();
|
|
void on_actionSave_triggered();
|
|
void on_actionSaveSelected_triggered();
|
|
void on_actionOpen_triggered();
|
|
|
|
void view_keyEvent(Qt::Key k, Qt::KeyboardModifiers m);
|
|
|
|
void on_treeObjects_itemClicked(QTreeWidgetItem * ti, int);
|
|
|
|
void removeObjects();
|
|
void objectsTreeChanged();
|
|
void materialChanged();
|
|
void selectionChanged(GLObjectBase * cur, GLObjectBase *);
|
|
|
|
void on_pushButton_clicked();
|
|
void on_pushButton_2_clicked() { view->view()->reloadShaders(); }
|
|
void on_pushButton_3_clicked();
|
|
|
|
public slots:
|
|
|
|
signals:
|
|
|
|
private:
|
|
QMatrix4x4 cam_mat;
|
|
};
|
|
|
|
#endif // QGLVIEWWINDOW_H
|