History

merge + few efficiency ameliorations to importDialog

atlante45 committed 13 years ago

Commit 3eb5ace2 parents 24531fd 86f2cbe27 files · +603 −97Browse files

Showing the changes to interface/src/ImportDialog.cpp (1 of 27 files). Show all

Unified · Split

interface/src/ImportDialog.cpp+6−14
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 // Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
77 //
88 #include "ImportDialog.h"
9+#include "Application.h"
910
1011 #include <QStandardPaths>
1112 #include <QGridLayout>
@@ -23,7 +24,7 @@ const QString IMPORT_FILE_TYPES = QObject::tr("Sparse Voxel Oc · 11 unmodified lines
2324 const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
2425
2526
26−const glm::vec3 UP = glm::vec3(0, 1, 0);
27+const glm::vec3 UP_VECT = glm::vec3(0, 1, 0);
2728 const float ANGULAR_RATE = 0.02f;
2829 const float VERTICAL_ANGLE = M_PI_4 / 2.0f;
2930 const float RETURN_RATE = 0.02f;
@@ -61,7 +62,7 @@ private: · 31 unmodified lines
6162 };
6263
6364 GLWidget::GLWidget(QWidget *parent, VoxelSystem *voxelSystem)
64− : QGLWidget(parent),
65+ : QGLWidget(parent, Application::getInstance()->getGLWidget()),
6566 _voxelSystem(voxelSystem),
6667 _draw(false),
6768 _a(0.0f),
@@ -77,11 +78,6 @@ void GLWidget::initializeGL() { · 9 unmodified lines
7778 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
7879 glShadeModel (GL_SMOOTH);
7980 glEnable(GL_DEPTH_TEST);
80−
81− if(_voxelSystem) {
82− _voxelSystem->init();
83− }
84−
8581 }
8682
8783 void GLWidget::resizeGL(int width, int height) {
@@ -111,7 +107,7 @@ void GLWidget::paintGL() { · 23 unmodified lines
111107 _targetCenter.y + (glm::length(_targetCenter) + NEAR_CLIP) * sin(_h),
112108 _targetCenter.z + (glm::length(_targetCenter) + NEAR_CLIP) * sin(_a),
113109 _targetCenter.x, _targetCenter.y, _targetCenter.z,
114− UP.x, UP.y, UP.z);
110+ UP_VECT.x, UP_VECT.y, UP_VECT.z);
115111
116112
117113 if (_draw && _voxelSystem) {
@@ -138,7 +134,7 @@ void GLWidget::paintGL() { · 20 unmodified lines
138134 glVertex3d(2 * _targetCenter.x, 2 * _targetCenter.y, 0 );
139135 glEnd();
140136
141− _voxelSystem->render(false);
137+ _voxelSystem->render(true);
142138 }
143139 }
144140
@@ -221,11 +217,7 @@ void ImportDialog::reject() { · 76 unmodified lines
221217 }
222218
223219 int ImportDialog::exec() {
224− reset();
225− int ret = QFileDialog::exec();
226− preview(false);
227−
228− return ret;
220+ return QFileDialog::exec();
229221 }
230222
231223 void ImportDialog::setGLCamera(float x, float y, float z) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t