aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-10-13 18:21:35 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-10-13 18:21:35 -0300
commit013963a9904258696b97e303f4b447bb3c4a26b3 (patch)
tree81b78a78c43db287b58ab6acfe32d33fc41c26f9
parent77a784a139531da570de56c8b3e2edf3222baf9e (diff)
Reorganizing code in main().
-rw-r--r--main.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/main.cpp b/main.cpp
index 4d0d594..8355590 100644
--- a/main.cpp
+++ b/main.cpp
@@ -33,10 +33,6 @@ int main(int argc, char **argv)
app.setApplicationName("pm");
app.setApplicationVersion("1.0");
- qmlRegisterType<Scatterplot>("PM", 1, 0, "Scatterplot");
- qmlRegisterType<HistoryGraph>("PM", 1, 0, "HistoryGraph");
- qmlRegisterSingletonType<Main>("PM", 1, 0, "Main", mainProvider);
-
QCommandLineParser parser;
parser.setApplicationDescription("Interactive multidimensional projections.");
parser.addHelpOption();
@@ -58,12 +54,6 @@ int main(int argc, char **argv)
parser.showHelp(1);
}
- // Set up multisampling
- QSurfaceFormat fmt;
- fmt.setSamples(16);
- QSurfaceFormat::setDefaultFormat(fmt);
- QQmlApplicationEngine engine(QUrl("qrc:///main_view.qml"));
-
Main *m = Main::instance();
if (parser.isSet(indicesFileOutputOption)) {
m->setIndicesSavePath(parser.value(indicesFileOutputOption));
@@ -84,6 +74,16 @@ int main(int argc, char **argv)
arma::mat Ys(subsampleSize, 2, arma::fill::randn);
mp::forceScheme(mp::dist(X.rows(sampleIndices)), Ys);
+ qmlRegisterType<Scatterplot>("PM", 1, 0, "Scatterplot");
+ qmlRegisterType<HistoryGraph>("PM", 1, 0, "HistoryGraph");
+ qmlRegisterSingletonType<Main>("PM", 1, 0, "Main", mainProvider);
+
+ // Set up multisampling
+ QSurfaceFormat fmt;
+ fmt.setSamples(16);
+ QSurfaceFormat::setDefaultFormat(fmt);
+ QQmlApplicationEngine engine(QUrl("qrc:///main_view.qml"));
+
ColorScale colorScale{
QColor("#1f77b4"),
QColor("#ff7f0e"),