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
6// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.6// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
7//7//
8#include "ImportDialog.h"8#include "ImportDialog.h"
9#include "Application.h"
9 10
10#include <QStandardPaths>11#include <QStandardPaths>
11#include <QGridLayout>12#include <QGridLayout>
@@ -23,7 +24,7 @@ const QString IMPORT_FILE_TYPES = QObject::tr("Sparse Voxel Oc · 11 unmodified lines
23const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);24const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
24 25
25 26
26const glm::vec3 UP = glm::vec3(0, 1, 0);27const glm::vec3 UP_VECT = glm::vec3(0, 1, 0);
27const float ANGULAR_RATE = 0.02f;28const float ANGULAR_RATE = 0.02f;
28const float VERTICAL_ANGLE = M_PI_4 / 2.0f;29const float VERTICAL_ANGLE = M_PI_4 / 2.0f;
29const float RETURN_RATE = 0.02f;30const float RETURN_RATE = 0.02f;
@@ -61,7 +62,7 @@ private: · 31 unmodified lines
61};62};
62 63
63GLWidget::GLWidget(QWidget *parent, VoxelSystem *voxelSystem)64GLWidget::GLWidget(QWidget *parent, VoxelSystem *voxelSystem)
64 : QGLWidget(parent),65 : QGLWidget(parent, Application::getInstance()->getGLWidget()),
65 _voxelSystem(voxelSystem),66 _voxelSystem(voxelSystem),
66 _draw(false),67 _draw(false),
67 _a(0.0f),68 _a(0.0f),
@@ -77,11 +78,6 @@ void GLWidget::initializeGL() { · 9 unmodified lines
77 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);78 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
78 glShadeModel (GL_SMOOTH);79 glShadeModel (GL_SMOOTH);
79 glEnable(GL_DEPTH_TEST);80 glEnable(GL_DEPTH_TEST);
80
81 if(_voxelSystem) {
82 _voxelSystem->init();
83 }
84
85}81}
86 82
87void GLWidget::resizeGL(int width, int height) {83void GLWidget::resizeGL(int width, int height) {
@@ -111,7 +107,7 @@ void GLWidget::paintGL() { · 23 unmodified lines
111 _targetCenter.y + (glm::length(_targetCenter) + NEAR_CLIP) * sin(_h),107 _targetCenter.y + (glm::length(_targetCenter) + NEAR_CLIP) * sin(_h),
112 _targetCenter.z + (glm::length(_targetCenter) + NEAR_CLIP) * sin(_a),108 _targetCenter.z + (glm::length(_targetCenter) + NEAR_CLIP) * sin(_a),
113 _targetCenter.x, _targetCenter.y, _targetCenter.z,109 _targetCenter.x, _targetCenter.y, _targetCenter.z,
114 UP.x, UP.y, UP.z);110 UP_VECT.x, UP_VECT.y, UP_VECT.z);
115 111
116 112
117 if (_draw && _voxelSystem) {113 if (_draw && _voxelSystem) {
@@ -138,7 +134,7 @@ void GLWidget::paintGL() { · 20 unmodified lines
138 glVertex3d(2 * _targetCenter.x, 2 * _targetCenter.y, 0 );134 glVertex3d(2 * _targetCenter.x, 2 * _targetCenter.y, 0 );
139 glEnd();135 glEnd();
140 136
141 _voxelSystem->render(false);137 _voxelSystem->render(true);
142 }138 }
143}139}
144 140
@@ -221,11 +217,7 @@ void ImportDialog::reject() { · 76 unmodified lines
221}217}
222 218
223int ImportDialog::exec() {219int ImportDialog::exec() {
224 reset();220 return QFileDialog::exec();
225 int ret = QFileDialog::exec();
226 preview(false);
227
228 return ret;
229}221}
230 222
231void ImportDialog::setGLCamera(float x, float y, float z) {223void 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