# HG changeset patch # User John Tsiombikas # Date 1440975324 -10800 # Node ID 7dac9d1bcae46403aedfa521986017efd789b61d # Parent 795217e82f3d846fa0eabd43a2f397ca7b537d69 foo diff -r 795217e82f3d -r 7dac9d1bcae4 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Mon Aug 31 01:55:24 2015 +0300 @@ -0,0 +1,6 @@ +\.o$ +\.swp$ +^Makefile$ +\.pro\.user$ +^build/ +^meshgen$ diff -r 795217e82f3d -r 7dac9d1bcae4 meshgen.pro --- a/meshgen.pro Sun Aug 30 05:54:32 2015 +0300 +++ b/meshgen.pro Mon Aug 31 01:55:24 2015 +0300 @@ -13,11 +13,17 @@ SOURCES += src/main.cc\ - src/mainwindow.cc + src/mainwindow.cc \ + src/glview.cc -HEADERS += src/mainwindow.h +HEADERS += src/mainwindow.h \ + src/glview.h -FORMS += ui/mainwindow.ui +FORMS += ui/mainwindow.ui \ + ui/prop_sphere.ui \ + ui/prop_capsule.ui + +INCLUDEPATH += src CONFIG += mobility MOBILITY = diff -r 795217e82f3d -r 7dac9d1bcae4 src/glview.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/glview.cc Mon Aug 31 01:55:24 2015 +0300 @@ -0,0 +1,34 @@ +#include "glview.h" + +GLView::GLView() +{ +} + +GLView::GLView(QWidget *w) + : QOpenGLWidget(w) +{ +} + +GLView::~GLView() +{ +} + +void GLView::initializeGL() +{ + glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glEnable(GL_MULTISAMPLE); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); +} + +void GLView::resizeGL(int w, int h) +{ + glViewport(0, 0, w, h); +} + +void GLView::paintGL() +{ + glClearColor(0.5, 0.2, 0.1, 1.0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); +} diff -r 795217e82f3d -r 7dac9d1bcae4 src/glview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/glview.h Mon Aug 31 01:55:24 2015 +0300 @@ -0,0 +1,17 @@ +#ifndef GLVIEW_H +#define GLVIEW_H + +#include + +class GLView : public QOpenGLWidget { +public: + GLView(); + GLView(QWidget *w); + virtual ~GLView(); + + virtual void initializeGL(); + virtual void resizeGL(int w, int h); + virtual void paintGL(); +}; + +#endif // GLVIEW_H diff -r 795217e82f3d -r 7dac9d1bcae4 src/mainwindow.cc --- a/src/mainwindow.cc Sun Aug 30 05:54:32 2015 +0300 +++ b/src/mainwindow.cc Mon Aug 31 01:55:24 2015 +0300 @@ -6,9 +6,36 @@ ui(new Ui::MainWindow) { ui->setupUi(this); + + ui_prop_sphere = new Ui::frm_prop_sphere; + ui_prop_capsule = new Ui::frm_prop_capsule; } MainWindow::~MainWindow() { delete ui; } + +void MainWindow::on_bn_add_sphere_clicked() +{ + QWidget *w = new QWidget; + ui_prop_sphere->setupUi(w); + ui->area_add_prop->setWidget(w); +} + +void MainWindow::on_bn_add_capsule_clicked() +{ + QWidget *w = new QWidget; + ui_prop_capsule->setupUi(w); + ui->area_add_prop->setWidget(w); + + QObject::connect(ui_prop_capsule->spin_radius1, SIGNAL(valueChanged(double)), this, SLOT(on_spin_radius1_valueChanged(double))); +} + +// in ui_prop_capsule +void MainWindow::on_spin_radius1_valueChanged(double arg1) +{ + if(ui_prop_capsule->chk_eqrad->isChecked()) { + ui_prop_capsule->spin_radius2->setValue(arg1); + } +} diff -r 795217e82f3d -r 7dac9d1bcae4 src/mainwindow.h --- a/src/mainwindow.h Sun Aug 30 05:54:32 2015 +0300 +++ b/src/mainwindow.h Mon Aug 31 01:55:24 2015 +0300 @@ -2,6 +2,8 @@ #define MAINWINDOW_H #include +#include "ui_prop_sphere.h" +#include "ui_prop_capsule.h" namespace Ui { class MainWindow; @@ -15,8 +17,17 @@ explicit MainWindow(QWidget *parent = 0); ~MainWindow(); +private slots: + void on_bn_add_sphere_clicked(); + + void on_bn_add_capsule_clicked(); + + void on_spin_radius1_valueChanged(double arg1); + private: Ui::MainWindow *ui; + Ui::frm_prop_sphere *ui_prop_sphere; + Ui::frm_prop_capsule *ui_prop_capsule; }; #endif // MAINWINDOW_H diff -r 795217e82f3d -r 7dac9d1bcae4 ui/mainwindow.ui --- a/ui/mainwindow.ui Sun Aug 30 05:54:32 2015 +0300 +++ b/ui/mainwindow.ui Mon Aug 31 01:55:24 2015 +0300 @@ -6,10 +6,16 @@ 0 0 - 800 - 480 + 910 + 591 + + + 0 + 0 + + MainWindow @@ -17,249 +23,199 @@ + + + 0 + 0 + + - 1 + 0 - Tab 1 + Create - - - - 10 - 10 - 115 - 32 - - - - Sphere - - - - - - 10 - 40 - 115 - 32 - - - - Box - - - - - - 180 - 70 - 115 - 32 - - - - Capsule - - - - - - 180 - 40 - 115 - 32 - - - - Rounded Box - - - - - - 10 - 70 - 115 - 32 - - - - Cylinder - - - - - - 10 - 100 - 115 - 32 - - - - Cone - - - - - - 180 - 10 - 115 - 32 - - - - Revolution - - - - - - 180 - 130 - 115 - 32 - - - - Heightfield - - - - - - 180 - 100 - 115 - 32 - - - - Sweep - - - - - - 20 - 130 - 115 - 32 - - - - Inf. Plane - - - - - - 10 - 180 - 351 - 251 - - - - true - - - - true - - - - 0 - 0 - 349 - 249 - - - - + + + + + + + Sphere + + + false + + + false + + + + + + + Revolution + + + + + + + Box + + + + + + + Rounded Box + + + + + + + Cylinder + + + + + + + Capsule + + + + + + + Cone + + + + + + + Sweep + + + + + + + Inf. Plane + + + + + + + Heightfield + + + + + + + + + + 0 + 0 + + + + true + + + + true + + + + 0 + 0 + 344 + 357 + + + + + + - Tab 2 + Modify - - - - 10 - 180 - 351 - 241 - - - - true - - - - true - - - - 0 - 0 - 349 - 239 - - - - - - - - 10 - 0 - 211 - 171 - - - - - - - 240 - 50 - 115 - 32 - - - - Duplicate - - - - - - 240 - 90 - 115 - 32 - - - - Delete - - - - - - 240 - 10 - 115 - 32 - - - - Hide - - + + + + + + + + 0 + 0 + + + + + + + + + + Hide + + + + + + + Duplicate + + + + + + + Delete + + + + + + + + + + + + 0 + 0 + + + + true + + + + true + + + + 0 + 0 + 344 + 248 + + + + + + @@ -281,6 +237,72 @@ + + + + 0 + 0 + 910 + 20 + + + + + &File + + + + + + + + + + + + + &Help + + + + + + + + + &New + + + + + &Open + + + + + &Save + + + + + Export &Mesh + + + + + Export &GLSL + + + + + &Quit + + + + + &About + + diff -r 795217e82f3d -r 7dac9d1bcae4 ui/prop_capsule.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/prop_capsule.ui Mon Aug 31 01:55:24 2015 +0300 @@ -0,0 +1,119 @@ + + + frm_prop_capsule + + + + 0 + 0 + 242 + 300 + + + + Form + + + + + + + + Start radius + + + + + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + End radius + + + + + + + false + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + Equal radii + + + true + + + + + + + Height + + + + + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + + + Qt::Horizontal + + + + 41 + 20 + + + + + + + + + + chk_eqrad + toggled(bool) + spin_radius2 + setDisabled(bool) + + + 127 + 82 + + + 129 + 51 + + + + + diff -r 795217e82f3d -r 7dac9d1bcae4 ui/prop_sphere.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/prop_sphere.ui Mon Aug 31 01:55:24 2015 +0300 @@ -0,0 +1,55 @@ + + + frm_prop_sphere + + + + 0 + 0 + 345 + 303 + + + + Form + + + + + + + + Radius + + + + + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + + + Qt::Horizontal + + + + 198 + 20 + + + + + + + + +