diff --git a/.gitignore b/.gitignore index ec3414bf7d..a607eada61 100644 --- a/.gitignore +++ b/.gitignore @@ -40,16 +40,15 @@ gui/externaltimecontrol/CMakeLists.txt gui/externaltimecontrol/main.cpp gui/externaltimecontrol/mainwindow.cpp gui/externaltimecontrol/mainwindow.h -include/openspace/version.h data/scene/67P/obj/67P_rotated_5_130.obj data/spice/NewHorizonsKernels/ data/spice/RosettaKernels/ -data/scene/plutoprojectionhybrid/textures/ -data/scene/plutoprojectionhybrid/textures/Shenk_180.jpg -data/scene/plutoprojectionhybrid/textures/barycenter.png -data/scene/plutoprojectionhybrid/textures/defaultProj.png -data/scene/plutoprojectionhybrid/textures/pluto_highres_180.jpg -data/scene/plutoprojectionhybrid/utcEvents.txt +data/scene/newhorizons/pluto/plutoprojection/textures/ +data/scene/newhorizons/pluto/plutoprojection/textures/Shenk_180.jpg +data/scene/newhorizons/pluto/plutoprojection/textures/barycenter.png +data/scene/newhorizons/pluto/plutoprojection/textures/defaultProj.png +data/scene/newhorizons/pluto/plutoprojection/textures/pluto_highres_180.jpg +data/scene/newhorizons/pluto/plutoprojection/utcEvents.txt data/scene/rosetta/obj/mainbodyros.obj data/scene/rosetta/obj/solarpanelleft.obj data/scene/rosetta/obj/solarpanelright.obj @@ -69,7 +68,7 @@ data/scene/uranus/textures/uranus.jpg data/scene/venus/textures/venus.jpg data/scene/vestaprojection/VestaComet/VestaComet_5000.obj data/spice/DawnKernels/ -data/scene/jupiterprojection/ProjectionsOfInterest/ +data/scene/newhorizons/jupiter/jupiterprojection/ProjectionsOfInterest/ data/scene/67P/textures/black.jpg data/scene/67P/textures/defaultProj.jpg data/scene/67P/textures/gray.jpg @@ -77,12 +76,12 @@ data/scene/67P/textures/gray.png data/scene/67P/textures/texmapflipped.jpg data/scene/67P/textures/white.jpg data/scene/67P/textures/white.png -data/scene/callistoprojection/textures/callisto.jpg +data/scene/newhorizons/jupiter/callistoprojection/textures/callisto.jpg data/scene/ceres/textures/gray.png -data/scene/charonprojection/textures/Charon-Text.png -data/scene/charonprojection/textures/charon_highres.jpg -data/scene/charonprojection/textures/charon_highres_annotated.jpg -data/scene/charonprojection/textures/defaultProj.png +data/scene/newhorizons/pluto/charonprojection/textures/Charon-Text.png +data/scene/newhorizons/pluto/charonprojection/textures/charon_highres.jpg +data/scene/newhorizons/pluto/charonprojection/textures/charon_highres_annotated.jpg +data/scene/newhorizons/pluto/charonprojection/textures/defaultProj.png data/scene/dawn/obj/mainbodydawn.obj data/scene/dawn/obj/solarpanelleft.obj data/scene/dawn/obj/solarpanelright.obj @@ -93,25 +92,25 @@ data/scene/earth/textures/earth_bluemarble.jpg data/scene/earth/textures/earth_bluemarble_height.jpg data/scene/earth/textures/earth_night.jpg data/scene/earth/textures/marker.png -data/scene/europaprojection/textures/europa.jpg -data/scene/ganymedeprojection/textures/ganymede.jpg -data/scene/ioprojection/textures/io.jpg +data/scene/newhorizons/jupiter/europaprojection/textures/europa.jpg +data/scene/newhorizons/jupiter/ganymedeprojection/textures/ganymede.jpg +data/scene/newhorizons/jupiter/ioprojection/textures/io.jpg data/scene/jupiter/textures/jupiter.jpg data/scene/mars/textures/mars.jpg data/scene/mercury/textures/mercury.jpg data/scene/milkyway/textures/DarkUniverse_mellinger_8k.jpg data/scene/neptune/textures/neptune.jpg -data/scene/newhorizons/models/Labels.obj -data/scene/newhorizons/models/NewHorizonsCleanModel.obj -data/scene/newhorizons/textures/NHTextureFlipCol.jpg -data/scene/newhorizons/textures/goldfoilbump.tif -data/scene/newhorizons/textures/labels.png +data/scene/newhorizons/newhorizons/models/Labels.obj +data/scene/newhorizons/newhorizons/models/NewHorizonsCleanModel.obj +data/scene/newhorizons/newhorizons/textures/NHTextureFlipCol.jpg +data/scene/newhorizons/newhorizons/textures/goldfoilbump.tif +data/scene/newhorizons/newhorizons/textures/labels.png data/scene/pluto/textures/ data/scene/pluto/textures/Shenk_180.jpg data/scene/pluto/textures/pluto_highres_180.jpg -data/scene/plutoprojectionhybrid/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt -data/scene/plutoprojectionhybrid/textures/3.jpg -data/scene/plutoprojectionhybrid/textures/Pluto-Text.png +data/scene/newhorizons/pluto/plutoprojection/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt +data/scene/newhorizons/pluto/plutoprojection/textures/3.jpg +data/scene/newhorizons/pluto/plutoprojection/textures/Pluto-Text.png data/scene/vestaprojection/VestaComet/VestaComet.mtl data/scene/vestaprojection/textures/defaultProj_backup.png data/scene/vestaprojection/textures/dummy.jpg @@ -120,3 +119,4 @@ data/scene/vestaprojection/textures/projectMe.png data/spice/MAR063.BSP data/spice/de430_1850-2150.bsp data/spice/jup260.bsp +data/scene/newhorizons/pluto/plutoprojection/images diff --git a/CMakeLists.txt b/CMakeLists.txt index f006b1afb6..c08556a2d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,6 @@ include(${GHOUL_BASE_DIR}/support/cmake/CopySharedLibraries.cmake) test_compiler_compatibility() cleanup_project() set_build_output_directories() -configure_openspace_version(0 3 0 "prerelease-8") option(OPENSPACE_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) diff --git a/apps/Launcher/infowidget.cpp b/apps/Launcher/infowidget.cpp index ff2537c407..ddde63591a 100644 --- a/apps/Launcher/infowidget.cpp +++ b/apps/Launcher/infowidget.cpp @@ -75,7 +75,7 @@ InfoWidget::InfoWidget(QString name, int totalBytes) setLayout(layout); } -void InfoWidget::update(openspace::DownloadManager::FileFuture* f) { +void InfoWidget::update(std::shared_ptr f) { _bytes->setText( QString("%1 / %2") .arg(f->currentSize) diff --git a/apps/Launcher/infowidget.h b/apps/Launcher/infowidget.h index 2099a774af..2eaec279b9 100644 --- a/apps/Launcher/infowidget.h +++ b/apps/Launcher/infowidget.h @@ -40,7 +40,7 @@ Q_OBJECT public: InfoWidget(QString name, int totalBytes = -1); - void update(openspace::DownloadManager::FileFuture* f); + void update(std::shared_ptr f); void update(libtorrent::torrent_status s); void error(QString message); diff --git a/apps/Launcher/main.cpp b/apps/Launcher/main.cpp index 2a2b819bdf..c802f468cc 100644 --- a/apps/Launcher/main.cpp +++ b/apps/Launcher/main.cpp @@ -166,11 +166,11 @@ QScrollBar::add-page, QScrollBar::sub-page { )style"; int main(int argc, char** argv) { - QApplication app(argc, argv); + QApplication app(argc, argv); app.setStyleSheet(style); - MainWindow window; - window.show(); + MainWindow window; + window.show(); - return app.exec(); + return app.exec(); } diff --git a/apps/Launcher/mainwindow.cpp b/apps/Launcher/mainwindow.cpp index c2b125f018..77d61a51d2 100644 --- a/apps/Launcher/mainwindow.cpp +++ b/apps/Launcher/mainwindow.cpp @@ -104,58 +104,58 @@ MainWindow::MainWindow() QWidget* container = new QWidget; { - QGridLayout* layout = new QGridLayout; + QGridLayout* innerLayout = new QGridLayout; QLabel* shortcutLabel = new QLabel("Keyboard Shortcuts:"); - layout->addWidget(shortcutLabel, 0, 0); + innerLayout->addWidget(shortcutLabel, 0, 0); QPushButton* shortcutButton = new QPushButton("Open..."); QObject::connect(shortcutButton, SIGNAL(clicked(bool)), this, SLOT(shortcutButtonPressed()) ); - layout->addWidget(shortcutButton, 0, 1); + innerLayout->addWidget(shortcutButton, 0, 1); - layout->setRowStretch(1, 10); + innerLayout->setRowStretch(1, 10); QLabel* configurationSelectionLabel = new QLabel("Configuration:"); - layout->addWidget(configurationSelectionLabel, 2, 0); + innerLayout->addWidget(configurationSelectionLabel, 2, 0); _configurations = new QComboBox; - layout->addWidget(_configurations, 2, 1); + innerLayout->addWidget(_configurations, 2, 1); QLabel* sceneSelectionLabel = new QLabel("Scenes:"); - layout->addWidget(sceneSelectionLabel, 3, 0); + innerLayout->addWidget(sceneSelectionLabel, 3, 0); _scenes = new QComboBox; - layout->addWidget(_scenes, 3, 1); + innerLayout->addWidget(_scenes, 3, 1); - container->setLayout(layout); + container->setLayout(innerLayout); } layout->addWidget(container, 1, 1); container = new QWidget; { - QBoxLayout* layout = new QHBoxLayout; + QBoxLayout* innerLayout = new QHBoxLayout; QPushButton* cancelButton = new QPushButton("Cancel"); QObject::connect( cancelButton, SIGNAL(clicked(bool)), QApplication::instance(), SLOT(quit()) ); - layout->addWidget(cancelButton); + innerLayout->addWidget(cancelButton); QPushButton* syncButton = new QPushButton("Sync"); QObject::connect( syncButton, SIGNAL(clicked(bool)), this, SLOT(syncButtonPressed()) ); - layout->addWidget(syncButton); + innerLayout->addWidget(syncButton); QPushButton* startButton = new QPushButton("Start"); QObject::connect( startButton, SIGNAL(clicked(bool)), this, SLOT(startButtonPressed()) ); - layout->addWidget(startButton); + innerLayout->addWidget(startButton); - container->setLayout(layout); + container->setLayout(innerLayout); } layout->addWidget(container, 2, 1); @@ -257,8 +257,8 @@ void MainWindow::newsNetworkError() { } void MainWindow::newsReadyRead() { - QByteArray data = _newsReply->readAll(); - QString news = QString::fromLatin1(data); + QByteArray arrayData = _newsReply->readAll(); + QString news = QString::fromLatin1(arrayData); _informationWidget->setText(news); _newsReply->deleteLater(); } diff --git a/apps/Launcher/mainwindow.h b/apps/Launcher/mainwindow.h index e3360b1c23..9b9d9bd10e 100644 --- a/apps/Launcher/mainwindow.h +++ b/apps/Launcher/mainwindow.h @@ -79,8 +79,8 @@ private: //class MainWindow : public QWidget { //Q_OBJECT //public: -// MainWindow(); -// ~MainWindow(); +// MainWindow(); +// ~MainWindow(); // // std::string nextTarget() const; // @@ -94,7 +94,7 @@ private: // void onSocketConnected(); // void onSocketDisconnected(); // -// void readTcpData(); +// void readTcpData(); // void handleStatusMessage(QByteArray data); // void handlePlaybook(QByteArray data); // @@ -106,7 +106,7 @@ private: // InformationWidget* _informationWidget; // TimelineWidget* _timelineWidget; // -// QTcpSocket* _socket; +// QTcpSocket* _socket; // // bool _hasHongKangTimeline = false; // bool _hasLabelTimeline = false; diff --git a/apps/Launcher/syncwidget.cpp b/apps/Launcher/syncwidget.cpp index 6ed87b2544..386c44c320 100644 --- a/apps/Launcher/syncwidget.cpp +++ b/apps/Launcher/syncwidget.cpp @@ -26,7 +26,7 @@ #include "infowidget.h" -#include +#include #include #include @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -138,9 +139,9 @@ SyncWidget::SyncWidget(QWidget* parent, Qt::WindowFlags f) libtorrent::session_settings settings = _session->settings(); settings.user_agent = "OpenSpace/" + - std::to_string(OPENSPACE_VERSION_MAJOR) + "." + - std::to_string(OPENSPACE_VERSION_MINOR) + "." + - std::to_string(OPENSPACE_VERSION_PATCH); + std::to_string(openspace::OPENSPACE_VERSION_MAJOR) + "." + + std::to_string(openspace::OPENSPACE_VERSION_MINOR) + "." + + std::to_string(openspace::OPENSPACE_VERSION_PATCH); settings.allow_multiple_connections_per_ip = true; settings.ignore_limits_on_local_network = true; settings.connection_speed = 20; @@ -230,7 +231,7 @@ void SyncWidget::setSceneFiles(QMap sceneFiles) { } void SyncWidget::clear() { - for (openspace::DownloadManager::FileFuture* f : _futures) + for (std::shared_ptr f : _futures) f->abortDownload = true; using libtorrent::torrent_handle; @@ -254,7 +255,7 @@ void SyncWidget::handleDirectFiles() { for (const DirectFile& f : _directFiles) { LDEBUG(f.url.toStdString() << " -> " << f.destination.toStdString()); - openspace::DownloadManager::FileFuture* future = DlManager.downloadFile( + std::shared_ptr future = DlManager.downloadFile( f.url.toStdString(), absPath("${SCENE}/" + f.module.toStdString() + "/" + f.destination.toStdString()), OverwriteFiles @@ -275,8 +276,8 @@ void SyncWidget::handleFileRequest() { LDEBUG(f.identifier.toStdString() << " (" << f.version << ") -> " << f.destination.toStdString()); ghoul::filesystem::Directory d = FileSys.currentDirectory(); - std::string thisDirectory = absPath("${SCENE}/" + f.module.toStdString() + "/"); - FileSys.setCurrentDirectory(thisDirectory); +// std::string thisDirectory = absPath("${SCENE}/" + f.module.toStdString() + "/"); + FileSys.setCurrentDirectory(f.baseDir.toStdString()); std::string identifier = f.identifier.toStdString(); @@ -301,8 +302,9 @@ void SyncWidget::handleTorrentFiles() { LDEBUG(f.file.toStdString() << " -> " << f.destination.toStdString()); ghoul::filesystem::Directory d = FileSys.currentDirectory(); - std::string thisDirectory = absPath("${SCENE}/" + f.module.toStdString() + "/"); - FileSys.setCurrentDirectory(thisDirectory); +// std::string thisDirectory = absPath("${SCENE}/" + f.module.toStdString() + "/"); + FileSys.setCurrentDirectory(f.baseDir.toStdString()); +// FileSys.setCurrentDirectory(thisDirectory); QString file = QString::fromStdString(absPath(f.file.toStdString())); @@ -367,18 +369,65 @@ void SyncWidget::syncButtonPressed() { LERROR("Could not find 'Modules'"); return; } - - QStringList modulesList; - for (int i = 1; i <= modules.size(); ++i) { - std::string module = modules.value(std::to_string(i)); - modulesList.append(QString::fromStdString(module)); - } - modulesList.append("common"); - + + struct ModuleInformation { + QString moduleName; + QString moduleDatafile; + QString modulePath; + }; + QDir sceneDir(scene); sceneDir.cdUp(); - for (QString module : modulesList) { - QString dataFile = sceneDir.absoluteFilePath(module + "/" + module + ".data"); + QList modulesList; + for (int i = 1; i <= modules.size(); ++i) { + std::string module = modules.value(std::to_string(i)); + std::string shortModule = module; + + std::string::size_type pos = module.find_last_of(FileSys.PathSeparator); + if (pos != std::string::npos) { + shortModule = module.substr(pos+1); + } + + QString m = QString::fromStdString(module); + + QString dataFile = sceneDir.absoluteFilePath( + QString::fromStdString(module) + "/" + QString::fromStdString(shortModule) + ".data" + ); + + if (QFileInfo(dataFile).exists()) { + modulesList.append({ + QString::fromStdString(module), + dataFile, + sceneDir.absolutePath() + "/" + QString::fromStdString(module) + }); + } + else { + QDir metaModuleDir = sceneDir; + metaModuleDir.cd(QString::fromStdString(module)); + + QDirIterator it(metaModuleDir.absolutePath(), QStringList() << "*.data", QDir::Files, QDirIterator::Subdirectories); + while (it.hasNext()) { + QString v = it.next(); + QDir d(v); + d.cdUp(); + + modulesList.append({ + d.dirName(), + v, + d.absolutePath() + }); + } + } + } + modulesList.append({ + "common", + sceneDir.absolutePath() + "/common/common.data", + sceneDir.absolutePath() + "/common" + }); + + for (const ModuleInformation& module : modulesList) { + QString dataFile = module.moduleDatafile; +// QString dataFile = sceneDir.absoluteFilePath(module + "/" + module + ".data"); if (QFileInfo(dataFile).exists()) { ghoul::Dictionary dataDictionary; @@ -407,9 +456,10 @@ void SyncWidget::syncButtonPressed() { dest = d.value(DestinationKey); _directFiles.append({ - module, + module.moduleName, QString::fromStdString(url), - QString::fromStdString(dest) + QString::fromStdString(dest), + module.modulePath }); } } @@ -436,9 +486,10 @@ void SyncWidget::syncButtonPressed() { int version = static_cast(d.value(VersionKey)); _fileRequests.append({ - module, + module.moduleName, QString::fromStdString(url), QString::fromStdString(dest), + module.modulePath, version }); } @@ -462,9 +513,10 @@ void SyncWidget::syncButtonPressed() { dest = ""; _torrentFiles.append({ - module, + module.moduleName, QString::fromStdString(file), - QString::fromStdString(dest) + QString::fromStdString(dest), + module.modulePath }); } } @@ -571,8 +623,8 @@ void SyncWidget::handleTimer() { using namespace libtorrent; using FileFuture = openspace::DownloadManager::FileFuture; - std::vector toRemove; - for (FileFuture* f : _futures) { + std::vector> toRemove; + for (std::shared_ptr f : _futures) { InfoWidget* w = _futureInfoWidgetMap[f]; if (CleanInfoWidgets && (f->isFinished || f->isAborted)) { @@ -585,13 +637,12 @@ void SyncWidget::handleTimer() { w->update(f); } - for (FileFuture* f : toRemove) { + for (std::shared_ptr f : toRemove) { _futures.erase(std::remove(_futures.begin(), _futures.end(), f), _futures.end()); - delete f; } while (_mutex.test_and_set()) {} - for (openspace::DownloadManager::FileFuture* f : _futuresToAdd) { + for (std::shared_ptr f : _futuresToAdd) { InfoWidget* w = new InfoWidget(QString::fromStdString(f->filePath), -1); _downloadLayout->insertWidget(_downloadLayout->count() - 1, w); @@ -679,7 +730,7 @@ void SyncWidget::handleTimer() { } void SyncWidget::handleFileFutureAddition( - const std::vector& futures) + const std::vector>& futures) { while (_mutex.test_and_set()) {} _futuresToAdd.insert(_futuresToAdd.end(), futures.begin(), futures.end()); diff --git a/apps/Launcher/syncwidget.h b/apps/Launcher/syncwidget.h index b4b2c108e4..c91838c13c 100644 --- a/apps/Launcher/syncwidget.h +++ b/apps/Launcher/syncwidget.h @@ -65,12 +65,14 @@ private: QString module; QString url; QString destination; + QString baseDir; }; struct FileRequest { QString module; QString identifier; QString destination; + QString baseDir; int version; }; @@ -78,12 +80,13 @@ private: QString module; QString file; QString destination; + QString baseDir; }; void clear(); QStringList selectedScenes() const; - void handleFileFutureAddition(const std::vector& futures); + void handleFileFutureAddition(const std::vector>& futures); void handleDirectFiles(); void handleFileRequest(); @@ -101,10 +104,10 @@ private: QList _fileRequests; QList _torrentFiles; - std::vector _futures; - std::map _futureInfoWidgetMap; + std::vector> _futures; + std::map, InfoWidget*> _futureInfoWidgetMap; - std::vector _futuresToAdd; + std::vector> _futuresToAdd; std::atomic_flag _mutex; }; diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 753aa07ed3..d43be6508b 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -167,9 +167,9 @@ int main(int argc, char** argv) { LDEBUG("Starting rendering loop"); _sgctEngine->render(); - //clear function bindings to avoid crash after destroying the OpenSpace Engine - sgct::MessageHandler::instance()->setLogToCallback(false); - sgct::MessageHandler::instance()->setLogCallback(nullptr); + //clear function bindings to avoid crash after destroying the OpenSpace Engine + sgct::MessageHandler::instance()->setLogToCallback(false); + sgct::MessageHandler::instance()->setLogCallback(nullptr); LDEBUG("Destroying OpenSpaceEngine"); openspace::OpenSpaceEngine::destroy(); @@ -183,7 +183,7 @@ int main(int argc, char** argv) { } void mainInitFunc() { - //is this node the master? (must be set after call to _sgctEngine->init()) + //is this node the master? (must be set after call to _sgctEngine->init()) OsEng.setMaster(_sgctEngine->isMaster()); bool success = OsEng.initialize(); @@ -199,7 +199,7 @@ void mainInitFunc() { size_t nWindows = _sgctEngine->getNumberOfWindows(); for (size_t i = 0; i < nWindows; ++i) { sgct::SGCTWindow* w = _sgctEngine->getWindowPtr(i); - size_t nViewports = nViewports = w->getNumberOfViewports(); + size_t nViewports = w->getNumberOfViewports(); for (size_t j = 0; j < nViewports; ++j) { sgct_core::Viewport* v = w->getViewport(j); ghoul_assert(v != nullptr, "Number of reported viewports was incorrect"); diff --git a/apps/TimelineView/configurationwidget.h b/apps/TimelineView/configurationwidget.h index 3beca827f7..1f7ff034c2 100644 --- a/apps/TimelineView/configurationwidget.h +++ b/apps/TimelineView/configurationwidget.h @@ -32,7 +32,7 @@ class ConfigurationWidget : public QWidget { Q_OBJECT public: - ConfigurationWidget(QWidget* parent); + ConfigurationWidget(QWidget* parent); void socketConnected(); void socketDisconnected(); diff --git a/apps/TimelineView/controlwidget.h b/apps/TimelineView/controlwidget.h index 8ae2f11fd8..5c6e99e5df 100644 --- a/apps/TimelineView/controlwidget.h +++ b/apps/TimelineView/controlwidget.h @@ -35,7 +35,7 @@ class QSlider; class ControlWidget : public QWidget { Q_OBJECT public: - ControlWidget(QWidget* parent); + ControlWidget(QWidget* parent); void update(QString currentTime, QString currentDelta); diff --git a/apps/TimelineView/informationwidget.h b/apps/TimelineView/informationwidget.h index c1a657ee20..811151a415 100644 --- a/apps/TimelineView/informationwidget.h +++ b/apps/TimelineView/informationwidget.h @@ -30,7 +30,7 @@ class InformationWidget : public QTextEdit { Q_OBJECT public: - InformationWidget(QWidget* parent); + InformationWidget(QWidget* parent); void socketConnected(); void socketDisconnected(); diff --git a/apps/TimelineView/main.cpp b/apps/TimelineView/main.cpp index 463578f67e..f9bd72520c 100644 --- a/apps/TimelineView/main.cpp +++ b/apps/TimelineView/main.cpp @@ -28,15 +28,15 @@ static const QString style = R"style( QWidget { - background-color: rgb(80, 80, 80); - font-family: Helvetica; + background-color: rgb(80, 80, 80); + font-family: Helvetica; } QGroupBox { background-color: qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #858585, - stop: 1 #959595); + x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #858585, + stop: 1 #959595); border: 2px solid gray; border-radius: 5px; margin-top: 4ex; @@ -44,7 +44,7 @@ QGroupBox { } QGroupBox::title { - background-color: #E0E0E0; + background-color: #E0E0E0; border: 2px solid gray; border-radius: 5px; subcontrol-origin: margin; @@ -60,10 +60,10 @@ QSlider::groove:horizontal { border: 1px solid #999999; height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ background: qlineargradient( - x1:0, y1:0, x2:1, y2:0, - stop:0 #c4c4c4, - stop:0.5 #555555, - stop:1 #c4c4c4 + x1:0, y1:0, x2:1, y2:0, + stop:0 #c4c4c4, + stop:0.5 #555555, + stop:1 #c4c4c4 ); margin: 2px 0; } @@ -77,7 +77,7 @@ QSlider::handle:horizontal { } QPushButton { - background-color: lightgray; + background-color: lightgray; border-style: outset; border-width: 0.5px; border-radius: 5px; @@ -87,16 +87,16 @@ QPushButton { } QPushButton#connection { - background-color: lightgreen; + background-color: lightgreen; } QPushButton#connection:pressed { - background-color: green; + background-color: green; } QPushButton#pause, QPushButton#play { - padding: 5px; + padding: 5px; } QPushButton#pause:pressed, QPushButton#play:pressed, QPushButton:pressed { @@ -112,7 +112,7 @@ QCombobox { } QComboBox:editable { - background: lightgrey; + background: lightgrey; } QComboBox QAbstractItemView { @@ -123,34 +123,34 @@ QComboBox QAbstractItemView { } QLabel#label { - font-size: 13px; - background-color: transparent; - font-variant: small-caps; + font-size: 13px; + background-color: transparent; + font-variant: small-caps; } QLabel#value { - font-family: monospace; - font-weight: bold; - font-size: 14px; - background-color: transparent; + font-family: monospace; + font-weight: bold; + font-size: 14px; + background-color: transparent; } QWidget#background { - background-color: transparent; + background-color: transparent; } QTextEdit { - font-family: monospace; + font-family: monospace; } )style"; int main(int argc, char** argv) { - QApplication app(argc, argv); + QApplication app(argc, argv); app.setStyleSheet(style); - MainWindow window; - window.show(); + MainWindow window; + window.show(); - return app.exec(); + return app.exec(); } diff --git a/apps/TimelineView/mainwindow.cpp b/apps/TimelineView/mainwindow.cpp index bbf66f7e8c..dc5e623e88 100644 --- a/apps/TimelineView/mainwindow.cpp +++ b/apps/TimelineView/mainwindow.cpp @@ -67,9 +67,9 @@ MainWindow::MainWindow() , _timeControlWidget(nullptr) , _informationWidget(nullptr) , _timelineWidget(nullptr) - , _socket(nullptr) + , _socket(nullptr) { - setWindowTitle("OpenSpace Timeline"); + setWindowTitle("OpenSpace Timeline"); _configurationWidget = new ConfigurationWidget(this); _configurationWidget->setMinimumWidth(350); @@ -79,7 +79,7 @@ MainWindow::MainWindow() _informationWidget->setMinimumWidth(350); _timelineWidget = new TimelineWidget(this); - QGridLayout* layout = new QGridLayout; + QGridLayout* layout = new QGridLayout; layout->addWidget(_configurationWidget, 0, 0); layout->addWidget(_timeControlWidget, 1, 0); layout->addWidget(_informationWidget, 2, 0); @@ -102,7 +102,7 @@ MainWindow::MainWindow() this, SLOT(sendScript(QString)) ); - setLayout(layout); + setLayout(layout); _configurationWidget->socketDisconnected(); _timeControlWidget->socketDisconnected(); @@ -111,7 +111,7 @@ MainWindow::MainWindow() } MainWindow::~MainWindow() { - delete _socket; + delete _socket; } void MainWindow::onConnect(QString host, QString port) { @@ -138,7 +138,7 @@ void MainWindow::readTcpData() { static const uint16_t MessageTypePlayBookHongKang = 4; QByteArray data = continuousData.append(_socket->readAll()); - int d = data.size(); +// int d = data.size(); if (QString(data) == "Connected to SGCT!\r\n") { continuousData.clear(); @@ -191,7 +191,7 @@ void MainWindow::readTcpData() { case MessageTypePlayBookHongKang: case MessageTypePlayBookLabel: { - const char* payloadDebug = data.mid(2).data(); +// const char* payloadDebug = data.mid(2).data(); size_t beginning = 0; uint32_t size = readFromBuffer(data.mid(2).data(), beginning); diff --git a/apps/TimelineView/mainwindow.h b/apps/TimelineView/mainwindow.h index 126dc314cf..9c23cf8448 100644 --- a/apps/TimelineView/mainwindow.h +++ b/apps/TimelineView/mainwindow.h @@ -38,8 +38,8 @@ class TimelineWidget; class MainWindow : public QWidget { Q_OBJECT public: - MainWindow(); - ~MainWindow(); + MainWindow(); + ~MainWindow(); std::string nextTarget() const; @@ -53,7 +53,7 @@ private slots: void onSocketConnected(); void onSocketDisconnected(); - void readTcpData(); + void readTcpData(); void handleStatusMessage(QByteArray data); QByteArray handlePlaybook(QByteArray data); void printMapping(QByteArray data); @@ -66,7 +66,7 @@ private: InformationWidget* _informationWidget; TimelineWidget* _timelineWidget; - QTcpSocket* _socket; + QTcpSocket* _socket; bool _isConnected = false; }; diff --git a/apps/TimelineView/timelinewidget.cpp b/apps/TimelineView/timelinewidget.cpp index aa25576041..791e90dba1 100644 --- a/apps/TimelineView/timelinewidget.cpp +++ b/apps/TimelineView/timelinewidget.cpp @@ -78,6 +78,7 @@ namespace { TimelineWidget::TimelineWidget(QWidget* parent) : QWidget(parent) + , _currentTime{"", 0.0} { setMinimumWidth(600); setMinimumHeight(600); @@ -152,17 +153,14 @@ void TimelineWidget::drawContent(QPainter& painter, QRectF rect) { } void TimelineWidget::drawLegend(QPainter& painter, QRectF rect) { - static const int HalfHeight = LegendHeight / 2; static const int Padding = 5; static const int BoxSize = 20; - // Draw Targets int currentHorizontalPosition = Padding; - int currentVerticalPosition = Padding; + int currentVerticalPosition = Padding + BoxSize + Padding; + // Draw Targets // Draw Instruments - currentHorizontalPosition = Padding; - currentVerticalPosition = Padding + BoxSize + Padding; for (int i = 0; i < _instruments.size(); ++i) { if (i == _instruments.size() / 3 || i == _instruments.size() * 2 / 3) { currentVerticalPosition += BoxSize + Padding; @@ -179,7 +177,7 @@ void TimelineWidget::drawLegend(QPainter& painter, QRectF rect) { painter.setPen(QPen(QColor(200, 200, 200))); //painter.setPen(QPen(Qt::black)); painter.drawText(currentHorizontalPosition, currentVerticalPosition + BoxSize / 2 + TextOffset, InstrumentConversion[QString::fromStdString(instrument)]); - int textWidth = painter.boundingRect(QRect(), QString::fromStdString(instrument)).width(); +// int textWidth = painter.boundingRect(QRect(), QString::fromStdString(instrument)).width(); //currentHorizontalPosition += std::max(textWidth, 25) + Padding; currentHorizontalPosition += 125; } @@ -198,9 +196,6 @@ void TimelineWidget::drawImages( std::vector images, double minimumTime, double maximumTime) { - int width = timelineRect.width(); - - int nInstruments = 0; std::set instrumentSet; for (Image* i : images) { for (std::string instrument : i->instruments) @@ -225,7 +220,7 @@ void TimelineWidget::drawImages( std::string target = i->target; auto it = std::find(_targets.begin(), _targets.end(), target); - int iTarget = std::distance(_targets.begin(), it); +// int iTarget = std::distance(_targets.begin(), it); for (std::string instrument : i->instruments) { auto it = std::find(_instruments.begin(), _instruments.end(), instrument); diff --git a/apps/TimelineView/timelinewidget.h b/apps/TimelineView/timelinewidget.h index f0c9233a8a..be3a880d00 100644 --- a/apps/TimelineView/timelinewidget.h +++ b/apps/TimelineView/timelinewidget.h @@ -38,7 +38,7 @@ class QPaintEvent; class TimelineWidget : public QWidget { Q_OBJECT public: - TimelineWidget(QWidget* parent); + TimelineWidget(QWidget* parent); void setData(std::vector images, std::map targetMap, std::map instrumentMap); void setCurrentTime(std::string currentTime, double et); diff --git a/data/scene/67P/67P.mod b/data/scene/67P/67P.mod index dce0892f50..0624cf2bcd 100644 --- a/data/scene/67P/67P.mod +++ b/data/scene/67P/67P.mod @@ -130,4 +130,4 @@ return { }, GuiName = "/Solar/67PTrail" } -} +} \ No newline at end of file diff --git a/data/scene/default_nh.scene b/data/scene/default_nh.scene index 5eab7337a7..dacd320a0c 100644 --- a/data/scene/default_nh.scene +++ b/data/scene/default_nh.scene @@ -1,3 +1,5 @@ +UseAccurateNewHorizonsKernels = false + return { ScenePath = ".", CommonFolder = "common", @@ -14,41 +16,15 @@ return { "saturn", "uranus", "neptune", - --"PlutoProjection", - "plutoprojectionhybrid", - "charonprojection", - "kerberos", - "nix", - "styx", - "hydra", + "newhorizons/pluto", + "newhorizons/jupiter", "stars", -- "stars-denver", "milkyway", -- "milkyway-eso", "imageplane", - --"constellationbounds", - --"io", - --"europa", - --"ganymede", - --"callisto", - "jupiterprojection", - "ioprojection", - "europaprojection", - "ganymedeprojection", - "callistoprojection", - "newhorizons", - "newhorizonsfov", - --"gridGalactic", - --"gridEcliptic", - --"gridEquatorial", - -- "ephemeris", - - -- "newhorizonspath", - -- "newhorizonstrail", - -- "enlil", - -- "volumegl3", - -- "volumegl2", - -- "volumegl", + "newhorizons/newhorizons", + "newhorizons/newhorizonsfov", } } diff --git a/data/scene/enlilnh/enlilnh.mod b/data/scene/enlilnh/enlilnh.mod new file mode 100644 index 0000000000..cfd8de50de --- /dev/null +++ b/data/scene/enlilnh/enlilnh.mod @@ -0,0 +1,22 @@ +return { + -- Volume module + { + Name = "Enlil New Horizons", + Parent = "Root", + Ephemeris = { + Type = "Static", + Position = { 0.0, 0.0, 0.0, 0} + }, + Renderable = { + Type = "RenderableMultiresVolume", + Translation = {0, 0, 0}, + Rotation = {2.1, 0, 0}, + Scaling = {1.1, 1.1, 1.1}, + ScalingExponent = 12, + Source = "tsp/enlil_nh_128_128_16.tsp", + TransferFunction = "transferfunctions/fire.txt", + BrickSelector = "tf", + }, + GuiName = "/Volumes/ENLIL New Horizons" + } +} diff --git a/data/scene/enlilnh/transferfunctions/fire.txt b/data/scene/enlilnh/transferfunctions/fire.txt new file mode 100644 index 0000000000..0d2d364253 --- /dev/null +++ b/data/scene/enlilnh/transferfunctions/fire.txt @@ -0,0 +1,10 @@ +width 1024 +lower 0.0 +upper 1.0 + +mappingkey 0.05 254 0 0 0 +mappingkey 0.10 254 0 0 110 +mappingkey 0.12 254 220 0 254 +mappingkey 0.15 254 100 0 254 +mappingkey 0.20 180 0 0 254 +mappingkey 0.25 180 0 80 254 diff --git a/data/scene/mars/mars.data b/data/scene/mars/mars.data index fdb9a8d161..afaf7ab69d 100644 --- a/data/scene/mars/mars.data +++ b/data/scene/mars/mars.data @@ -3,6 +3,6 @@ return { { Identifier = "mars_textures", Destination = "textures", Version = 1 } }, TorrentFiles = { - { File = "MAR063.BSP.torrent", Destination = "${SPICE}" } + -- { File = "MAR063.BSP.torrent", Destination = "${SPICE}" } } } \ No newline at end of file diff --git a/data/scene/mars/mars.mod b/data/scene/mars/mars.mod index 7e60f4c79b..ba4605c8f3 100644 --- a/data/scene/mars/mars.mod +++ b/data/scene/mars/mars.mod @@ -37,7 +37,7 @@ return { Reference = "ECLIPJ2000", Observer = "SUN", Kernels = { - "${OPENSPACE_DATA}/spice/MAR063.BSP" + "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" } }, Rotation = { diff --git a/data/scene/callistoprojection/callistoprojection.data b/data/scene/newhorizons/jupiter/callistoprojection/callistoprojection.data similarity index 100% rename from data/scene/callistoprojection/callistoprojection.data rename to data/scene/newhorizons/jupiter/callistoprojection/callistoprojection.data diff --git a/data/scene/callistoprojection/callistoprojection.mod b/data/scene/newhorizons/jupiter/callistoprojection/callistoprojection.mod similarity index 100% rename from data/scene/callistoprojection/callistoprojection.mod rename to data/scene/newhorizons/jupiter/callistoprojection/callistoprojection.mod diff --git a/data/scene/callistoprojection/textures/Callisto-Text.png b/data/scene/newhorizons/jupiter/callistoprojection/textures/Callisto-Text.png similarity index 100% rename from data/scene/callistoprojection/textures/Callisto-Text.png rename to data/scene/newhorizons/jupiter/callistoprojection/textures/Callisto-Text.png diff --git a/data/scene/callistoprojection/textures/defaultProj.png b/data/scene/newhorizons/jupiter/callistoprojection/textures/defaultProj.png similarity index 100% rename from data/scene/callistoprojection/textures/defaultProj.png rename to data/scene/newhorizons/jupiter/callistoprojection/textures/defaultProj.png diff --git a/data/scene/europaprojection/europaprojection.data b/data/scene/newhorizons/jupiter/europaprojection/europaprojection.data similarity index 100% rename from data/scene/europaprojection/europaprojection.data rename to data/scene/newhorizons/jupiter/europaprojection/europaprojection.data diff --git a/data/scene/europaprojection/europaprojection.mod b/data/scene/newhorizons/jupiter/europaprojection/europaprojection.mod similarity index 100% rename from data/scene/europaprojection/europaprojection.mod rename to data/scene/newhorizons/jupiter/europaprojection/europaprojection.mod diff --git a/data/scene/europaprojection/textures/Europa-Text.png b/data/scene/newhorizons/jupiter/europaprojection/textures/Europa-Text.png similarity index 100% rename from data/scene/europaprojection/textures/Europa-Text.png rename to data/scene/newhorizons/jupiter/europaprojection/textures/Europa-Text.png diff --git a/data/scene/europaprojection/textures/defaultProj.png b/data/scene/newhorizons/jupiter/europaprojection/textures/defaultProj.png similarity index 100% rename from data/scene/europaprojection/textures/defaultProj.png rename to data/scene/newhorizons/jupiter/europaprojection/textures/defaultProj.png diff --git a/data/scene/ganymedeprojection/ganymedeprojection.data b/data/scene/newhorizons/jupiter/ganymedeprojection/ganymedeprojection.data similarity index 100% rename from data/scene/ganymedeprojection/ganymedeprojection.data rename to data/scene/newhorizons/jupiter/ganymedeprojection/ganymedeprojection.data diff --git a/data/scene/ganymedeprojection/ganymedeprojection.mod b/data/scene/newhorizons/jupiter/ganymedeprojection/ganymedeprojection.mod similarity index 100% rename from data/scene/ganymedeprojection/ganymedeprojection.mod rename to data/scene/newhorizons/jupiter/ganymedeprojection/ganymedeprojection.mod diff --git a/data/scene/ganymedeprojection/textures/Ganymede-Text.png b/data/scene/newhorizons/jupiter/ganymedeprojection/textures/Ganymede-Text.png similarity index 100% rename from data/scene/ganymedeprojection/textures/Ganymede-Text.png rename to data/scene/newhorizons/jupiter/ganymedeprojection/textures/Ganymede-Text.png diff --git a/data/scene/ganymedeprojection/textures/defaultProj.png b/data/scene/newhorizons/jupiter/ganymedeprojection/textures/defaultProj.png similarity index 100% rename from data/scene/ganymedeprojection/textures/defaultProj.png rename to data/scene/newhorizons/jupiter/ganymedeprojection/textures/defaultProj.png diff --git a/data/scene/ioprojection/ioprojection.data b/data/scene/newhorizons/jupiter/ioprojection/ioprojection.data similarity index 100% rename from data/scene/ioprojection/ioprojection.data rename to data/scene/newhorizons/jupiter/ioprojection/ioprojection.data diff --git a/data/scene/ioprojection/ioprojection.mod b/data/scene/newhorizons/jupiter/ioprojection/ioprojection.mod similarity index 100% rename from data/scene/ioprojection/ioprojection.mod rename to data/scene/newhorizons/jupiter/ioprojection/ioprojection.mod diff --git a/data/scene/ioprojection/textures/Io-Text.png b/data/scene/newhorizons/jupiter/ioprojection/textures/Io-Text.png similarity index 100% rename from data/scene/ioprojection/textures/Io-Text.png rename to data/scene/newhorizons/jupiter/ioprojection/textures/Io-Text.png diff --git a/data/scene/ioprojection/textures/defaultProj.png b/data/scene/newhorizons/jupiter/ioprojection/textures/defaultProj.png similarity index 100% rename from data/scene/ioprojection/textures/defaultProj.png rename to data/scene/newhorizons/jupiter/ioprojection/textures/defaultProj.png diff --git a/data/scene/jupiterprojection/ProjectionsOfInterest.torrent b/data/scene/newhorizons/jupiter/jupiterprojection/ProjectionsOfInterest.torrent similarity index 100% rename from data/scene/jupiterprojection/ProjectionsOfInterest.torrent rename to data/scene/newhorizons/jupiter/jupiterprojection/ProjectionsOfInterest.torrent diff --git a/data/scene/jupiterprojection/jupiterprojection.data b/data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.data similarity index 100% rename from data/scene/jupiterprojection/jupiterprojection.data rename to data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.data diff --git a/data/scene/jupiterprojection/jupiterprojection.mod b/data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.mod similarity index 97% rename from data/scene/jupiterprojection/jupiterprojection.mod rename to data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.mod index e2f47aef77..706938f06b 100644 --- a/data/scene/jupiterprojection/jupiterprojection.mod +++ b/data/scene/newhorizons/jupiter/jupiterprojection/jupiterprojection.mod @@ -39,7 +39,7 @@ return { }, Projection = { --Sequence = "F:/JupiterFullSequence", - Sequence = "${OPENSPACE_DATA}/scene/jupiterprojection/ProjectionsOfInterest", + Sequence = "${OPENSPACE_DATA}/scene/newhorizons/jupiter/jupiterprojection/ProjectionsOfInterest", SequenceType = "image-sequence", Observer = "NEW HORIZONS", Target = "JUPITER", diff --git a/data/scene/jupiterprojection/textures/1.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/1.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/1.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/1.jpg diff --git a/data/scene/jupiterprojection/textures/2.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/2.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/2.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/2.jpg diff --git a/data/scene/jupiterprojection/textures/3.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/3.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/3.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/3.jpg diff --git a/data/scene/jupiterprojection/textures/Jupiter-text.png b/data/scene/newhorizons/jupiter/jupiterprojection/textures/Jupiter-text.png similarity index 100% rename from data/scene/jupiterprojection/textures/Jupiter-text.png rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/Jupiter-text.png diff --git a/data/scene/jupiterprojection/textures/defaultProj.png b/data/scene/newhorizons/jupiter/jupiterprojection/textures/defaultProj.png similarity index 100% rename from data/scene/jupiterprojection/textures/defaultProj.png rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/defaultProj.png diff --git a/data/scene/jupiterprojection/textures/defaultProj2.png b/data/scene/newhorizons/jupiter/jupiterprojection/textures/defaultProj2.png similarity index 100% rename from data/scene/jupiterprojection/textures/defaultProj2.png rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/defaultProj2.png diff --git a/data/scene/jupiterprojection/textures/europaRise1.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/europaRise1.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/europaRise1.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/europaRise1.jpg diff --git a/data/scene/jupiterprojection/textures/europaRise2.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/europaRise2.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/europaRise2.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/europaRise2.jpg diff --git a/data/scene/jupiterprojection/textures/grid.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/grid.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/grid.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/grid.jpg diff --git a/data/scene/jupiterprojection/textures/jupiter.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/jupiter.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/jupiter.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/jupiter.jpg diff --git a/data/scene/jupiterprojection/textures/jupiterFlipped.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/jupiterFlipped.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/jupiterFlipped.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/jupiterFlipped.jpg diff --git a/data/scene/jupiterprojection/textures/jupiterFlipped_low.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/jupiterFlipped_low.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/jupiterFlipped_low.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/jupiterFlipped_low.jpg diff --git a/data/scene/jupiterprojection/textures/lor_0034817584_0x630_sci_1.fit.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/lor_0034817584_0x630_sci_1.fit.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/lor_0034817584_0x630_sci_1.fit.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/lor_0034817584_0x630_sci_1.fit.jpg diff --git a/data/scene/jupiterprojection/textures/lor_0034817654_0x630_sci_1.fit.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/lor_0034817654_0x630_sci_1.fit.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/lor_0034817654_0x630_sci_1.fit.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/lor_0034817654_0x630_sci_1.fit.jpg diff --git a/data/scene/jupiterprojection/textures/lor_0034817724_0x630_sci_1.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/lor_0034817724_0x630_sci_1.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/lor_0034817724_0x630_sci_1.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/lor_0034817724_0x630_sci_1.jpg diff --git a/data/scene/jupiterprojection/textures/lor_0034817794_0x630_sci_1.fit.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/lor_0034817794_0x630_sci_1.fit.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/lor_0034817794_0x630_sci_1.fit.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/lor_0034817794_0x630_sci_1.fit.jpg diff --git a/data/scene/jupiterprojection/textures/lorriTest1.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/lorriTest1.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/lorriTest1.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/lorriTest1.jpg diff --git a/data/scene/jupiterprojection/textures/lorriTest2.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/lorriTest2.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/lorriTest2.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/lorriTest2.jpg diff --git a/data/scene/jupiterprojection/textures/scope.png b/data/scene/newhorizons/jupiter/jupiterprojection/textures/scope.png similarity index 100% rename from data/scene/jupiterprojection/textures/scope.png rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/scope.png diff --git a/data/scene/jupiterprojection/textures/show.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/show.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/show.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/show.jpg diff --git a/data/scene/jupiterprojection/textures/show_3072.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/show_3072.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/show_3072.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/show_3072.jpg diff --git a/data/scene/jupiterprojection/textures/small.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/small.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/small.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/small.jpg diff --git a/data/scene/jupiterprojection/textures/small.png b/data/scene/newhorizons/jupiter/jupiterprojection/textures/small.png similarity index 100% rename from data/scene/jupiterprojection/textures/small.png rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/small.png diff --git a/data/scene/jupiterprojection/textures/test.jpg b/data/scene/newhorizons/jupiter/jupiterprojection/textures/test.jpg similarity index 100% rename from data/scene/jupiterprojection/textures/test.jpg rename to data/scene/newhorizons/jupiter/jupiterprojection/textures/test.jpg diff --git a/data/scene/newhorizons/NewHorizonsKernels.torrent b/data/scene/newhorizons/newhorizons/NewHorizonsKernels.torrent similarity index 100% rename from data/scene/newhorizons/NewHorizonsKernels.torrent rename to data/scene/newhorizons/newhorizons/NewHorizonsKernels.torrent diff --git a/data/scene/newhorizons/jup260.bsp.torrent b/data/scene/newhorizons/newhorizons/jup260.bsp.torrent similarity index 100% rename from data/scene/newhorizons/jup260.bsp.torrent rename to data/scene/newhorizons/newhorizons/jup260.bsp.torrent diff --git a/data/scene/newhorizons/newhorizons.data b/data/scene/newhorizons/newhorizons/newhorizons.data similarity index 100% rename from data/scene/newhorizons/newhorizons.data rename to data/scene/newhorizons/newhorizons/newhorizons.data diff --git a/data/scene/newhorizons/newhorizons.mod b/data/scene/newhorizons/newhorizons/newhorizons.mod similarity index 58% rename from data/scene/newhorizons/newhorizons.mod rename to data/scene/newhorizons/newhorizons/newhorizons.mod index 8e38b010f5..61f9dae0cc 100644 --- a/data/scene/newhorizons/newhorizons.mod +++ b/data/scene/newhorizons/newhorizons/newhorizons.mod @@ -1,3 +1,82 @@ +if UseAccurateNewHorizonsKernels then + NewHorizonsKernels = { + -- SCLK + "${SPICE}/nh_kernels/sclk/new-horizons_0976.tsc", + -- "${SPICE}/NewHorizonsKernels/new_horizons_413.tsc", + + -- SPK + "${SPICE}/nh_kernels/spk/nh_pred_20141201_20190301_od122.bsp", + -- "${SPICE}/nh_kernels/spk/nh_pred_20120501_20160913_od093.bsp", + "${SPICE}/nh_kernels/spk/plu_all_mvi.spk", + "${SPICE}/jup260.bsp", + -- "${SPICE}/NewHorizonsKernels/de413.bsp", + + -- CK + "${SPICE}/nh_kernels/ck/nh_scispi_2015_pred.bc", + "${SPICE}/nh_kernels/ck/nh_scispi_2015_recon.bc", + "${SPICE}/nh_kernels/ck/nh_lorri_wcs.bc", + "${SPICE}/nh_kernels/ck/plutonet_PS104.bc", + + -- FK + "${SPICE}/nh_kernels/fk/nh_soc_misc_v001.tf", + "${SPICE}/nh_kernels/fk/nh_v220.tf", + + -- IK + "${SPICE}/nh_kernels/ik/nh_alice_v120.ti", + "${SPICE}/nh_kernels/ik/nh_allinstruments_v002.ti", + "${SPICE}/nh_kernels/ik/nh_astr_v000.ti", + "${SPICE}/nh_kernels/ik/nh_fss_v000.ti", + "${SPICE}/nh_kernels/ik/nh_lorri_v100.ti", + "${SPICE}/nh_kernels/ik/nh_pepssi_v110.ti", + "${SPICE}/nh_kernels/ik/nh_ralph_v100.ti", + "${SPICE}/nh_kernels/ik/nh_rex_v100.ti", + "${SPICE}/nh_kernels/ik/nh_sdc_v101.ti", + "${SPICE}/nh_kernels/ik/nh_swap_v100.ti", + + -- LSK + "${SPICE}/nh_kernels/lsk/naif0011.tls", + + -- PCK + "${SPICE}/nh_kernels/pck/nh_targets_v001.tpc", + "${SPICE}/nh_kernels/pck/pck00010.tpc", + "${SPICE}/nh_kernels/pck/nh_pcnh_002.tpc" + }; +else + NewHorizonsKernels = { + --SCLK + + "${SPICE}/NewHorizonsKernels/new_horizons_413.tsc", + + "${SPICE}/NewHorizonsKernels/nhops_CORE_v9g_cdh2.bc", + "${SPICE}/NewHorizonsKernels/nh_ref_20080710_20160101_od059B.bsp", + + "${SPICE}/de430_1850-2150.bsp", + -- CK + "${SPICE}/NewHorizonsKernels/merged_nhpc_2006_v011.bc", + "${SPICE}/NewHorizonsKernels/merged_nhpc_2007_v006.bc", + -- FK + "${SPICE}/NewHorizonsKernels/nh_v200.tf", + -- IK + "${SPICE}/NewHorizonsKernels/nh_alice_v110.ti", + "${SPICE}/NewHorizonsKernels/nh_lorri_v100.ti", + "${SPICE}/NewHorizonsKernels/nh_pepssi_v110.ti", + "${SPICE}/NewHorizonsKernels/nh_ralph_v100.ti", + "${SPICE}/NewHorizonsKernels/nh_rex_v100.ti", + "${SPICE}/NewHorizonsKernels/nh_sdc_v101.ti", + "${SPICE}/NewHorizonsKernels/nh_swap_v100.ti", + -- PCK + + -- SPK + "${SPICE}/jup260.bsp", + "${SPICE}/NewHorizonsKernels/de413.bsp", + "${SPICE}/NewHorizonsKernels/nh_nep_ura_000.bsp", + "${SPICE}/NewHorizonsKernels/nh_recon_e2j_v1.bsp", + "${SPICE}/NewHorizonsKernels/nh_recon_j2sep07_prelimv1.bsp", + "${SPICE}/NewHorizonsKernels/sb_2002jf56_2.bsp", + "${SPICE}/NewHorizonsKernels/nh_plu017.bsp", + } +end + return { -- New Horizons Body module { @@ -10,7 +89,7 @@ return { Body = "NEW HORIZONS", Geometry = { Type = "MultiModelGeometry", - GeometryFile = "${OPENSPACE_DATA}/scene/newhorizons/models/NewHorizonsCleanModel.obj", + GeometryFile = "models/NewHorizonsCleanModel.obj", Magnification = 4, }, Textures = { @@ -35,39 +114,7 @@ return { -- Observer = "PLUTO BARYCENTER", Observer = "SUN", -- Observer = "JUPITER BARYCENTER", - Kernels = { - --SCLK - - "${SPICE}/NewHorizonsKernels/new_horizons_413.tsc", - - "${SPICE}/NewHorizonsKernels/nhops_CORE_v9g_cdh2.bc", - "${SPICE}/NewHorizonsKernels/nh_ref_20080710_20160101_od059B.bsp", - - "${SPICE}/de430_1850-2150.bsp", - -- CK - "${SPICE}/NewHorizonsKernels/merged_nhpc_2006_v011.bc", - "${SPICE}/NewHorizonsKernels/merged_nhpc_2007_v006.bc", - -- FK - "${SPICE}/NewHorizonsKernels/nh_v200.tf", - -- IK - "${SPICE}/NewHorizonsKernels/nh_alice_v110.ti", - "${SPICE}/NewHorizonsKernels/nh_lorri_v100.ti", - "${SPICE}/NewHorizonsKernels/nh_pepssi_v110.ti", - "${SPICE}/NewHorizonsKernels/nh_ralph_v100.ti", - "${SPICE}/NewHorizonsKernels/nh_rex_v100.ti", - "${SPICE}/NewHorizonsKernels/nh_sdc_v101.ti", - "${SPICE}/NewHorizonsKernels/nh_swap_v100.ti", - -- PCK - - -- SPK - "${SPICE}/jup260.bsp", - "${SPICE}/NewHorizonsKernels/de413.bsp", - "${SPICE}/NewHorizonsKernels/nh_nep_ura_000.bsp", - "${SPICE}/NewHorizonsKernels/nh_recon_e2j_v1.bsp", - "${SPICE}/NewHorizonsKernels/nh_recon_j2sep07_prelimv1.bsp", - "${SPICE}/NewHorizonsKernels/sb_2002jf56_2.bsp", - "${SPICE}/NewHorizonsKernels/nh_plu017.bsp", - } + Kernels = NewHorizonsKernels }, GuiName = "/Solar/NewHorizons" }, @@ -104,7 +151,7 @@ return { Body = "NEW HORIZONS", Geometry = { Type = "MultiModelGeometry", - GeometryFile = "${OPENSPACE_DATA}/scene/newhorizons/models/Labels.obj", + GeometryFile = "models/Labels.obj", Magnification = 4, }, Textures = { diff --git a/data/scene/newhorizonsfov/newhorizonsfov.mod b/data/scene/newhorizons/newhorizonsfov/newhorizonsfov.mod similarity index 100% rename from data/scene/newhorizonsfov/newhorizonsfov.mod rename to data/scene/newhorizons/newhorizonsfov/newhorizonsfov.mod diff --git a/data/scene/newhorizonsfov/textures/glare.png b/data/scene/newhorizons/newhorizonsfov/textures/glare.png similarity index 100% rename from data/scene/newhorizonsfov/textures/glare.png rename to data/scene/newhorizons/newhorizonsfov/textures/glare.png diff --git a/data/scene/newhorizonsfov/textures/glare_blue.png b/data/scene/newhorizons/newhorizonsfov/textures/glare_blue.png similarity index 100% rename from data/scene/newhorizonsfov/textures/glare_blue.png rename to data/scene/newhorizons/newhorizonsfov/textures/glare_blue.png diff --git a/data/scene/newhorizonspath/newhorizonspath.mod b/data/scene/newhorizons/newhorizonspath/newhorizonspath.mod similarity index 100% rename from data/scene/newhorizonspath/newhorizonspath.mod rename to data/scene/newhorizons/newhorizonspath/newhorizonspath.mod diff --git a/data/scene/newhorizonspath/textures/glare.png b/data/scene/newhorizons/newhorizonspath/textures/glare.png similarity index 100% rename from data/scene/newhorizonspath/textures/glare.png rename to data/scene/newhorizons/newhorizonspath/textures/glare.png diff --git a/data/scene/newhorizonspath/textures/glare_blue.png b/data/scene/newhorizons/newhorizonspath/textures/glare_blue.png similarity index 100% rename from data/scene/newhorizonspath/textures/glare_blue.png rename to data/scene/newhorizons/newhorizonspath/textures/glare_blue.png diff --git a/data/scene/newhorizonstrail/newhorizonstrail.mod b/data/scene/newhorizons/newhorizonstrail/newhorizonstrail.mod similarity index 100% rename from data/scene/newhorizonstrail/newhorizonstrail.mod rename to data/scene/newhorizons/newhorizonstrail/newhorizonstrail.mod diff --git a/data/scene/newhorizonstrail/textures/glare.png b/data/scene/newhorizons/newhorizonstrail/textures/glare.png similarity index 100% rename from data/scene/newhorizonstrail/textures/glare.png rename to data/scene/newhorizons/newhorizonstrail/textures/glare.png diff --git a/data/scene/newhorizonstrail/textures/glare_blue.png b/data/scene/newhorizons/newhorizonstrail/textures/glare_blue.png similarity index 100% rename from data/scene/newhorizonstrail/textures/glare_blue.png rename to data/scene/newhorizons/newhorizonstrail/textures/glare_blue.png diff --git a/data/scene/charonprojection/charonprojection.data b/data/scene/newhorizons/pluto/charonprojection/charonprojection.data similarity index 100% rename from data/scene/charonprojection/charonprojection.data rename to data/scene/newhorizons/pluto/charonprojection/charonprojection.data diff --git a/data/scene/charonprojection/charonprojection.mod b/data/scene/newhorizons/pluto/charonprojection/charonprojection.mod similarity index 91% rename from data/scene/charonprojection/charonprojection.mod rename to data/scene/newhorizons/pluto/charonprojection/charonprojection.mod index 0e0cde02f8..5e1c3ad60c 100644 --- a/data/scene/charonprojection/charonprojection.mod +++ b/data/scene/newhorizons/pluto/charonprojection/charonprojection.mod @@ -1,3 +1,14 @@ +if UseAccurateNewHorizonsKernels then + NewHorizonsKernels = { + "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + } +else + NewHorizonsKernels = { + "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + } +end + + return { -- CharonProjection module { @@ -47,9 +58,7 @@ return { Body = "CHARON", Reference = "ECLIPJ2000", Observer = "PLUTO BARYCENTER", - Kernels = { - "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - } + Kernels = NewHorizonsKernels }, Rotation = { Type = "Spice", diff --git a/data/scene/hydra/hydra.mod b/data/scene/newhorizons/pluto/hydra/hydra.mod similarity index 88% rename from data/scene/hydra/hydra.mod rename to data/scene/newhorizons/pluto/hydra/hydra.mod index bf74b5d2e2..e6f27bbff5 100644 --- a/data/scene/hydra/hydra.mod +++ b/data/scene/newhorizons/pluto/hydra/hydra.mod @@ -1,3 +1,13 @@ +if UseAccurateNewHorizonsKernels then + NewHorizonsKernels = { + "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + } +else + NewHorizonsKernels = { + "${SPICE}/NewHorizonsKernels/nh_p4p5_revised.bsp" + } +end + return { -- Hydra module { @@ -27,9 +37,7 @@ return { Body = "Hydra", Reference = "ECLIPJ2000", Observer = "PLUTO BARYCENTER", - Kernels = { - "${SPICE}/NewHorizonsKernels/nh_p4p5_revised.bsp" - } + Kernels = NewHorizonsKernels }, Rotation = { Type = "Spice", diff --git a/data/scene/hydra/textures/Hydra-Text.png b/data/scene/newhorizons/pluto/hydra/textures/Hydra-Text.png similarity index 100% rename from data/scene/hydra/textures/Hydra-Text.png rename to data/scene/newhorizons/pluto/hydra/textures/Hydra-Text.png diff --git a/data/scene/hydra/textures/gray.jpg b/data/scene/newhorizons/pluto/hydra/textures/gray.jpg similarity index 100% rename from data/scene/hydra/textures/gray.jpg rename to data/scene/newhorizons/pluto/hydra/textures/gray.jpg diff --git a/data/scene/kerberos/kerberos.mod b/data/scene/newhorizons/pluto/kerberos/kerberos.mod similarity index 88% rename from data/scene/kerberos/kerberos.mod rename to data/scene/newhorizons/pluto/kerberos/kerberos.mod index e4f2773943..75720abde4 100644 --- a/data/scene/kerberos/kerberos.mod +++ b/data/scene/newhorizons/pluto/kerberos/kerberos.mod @@ -1,3 +1,13 @@ +if UseAccurateNewHorizonsKernels then + NewHorizonsKernels = { + "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + } +else + NewHorizonsKernels = { + "${SPICE}/NewHorizonsKernels/nh_p4p5_revised.bsp" + } +end + return { -- Styx module { @@ -27,9 +37,7 @@ return { Body = "KERBEROS", Reference = "ECLIPJ2000", Observer = "PLUTO BARYCENTER", - Kernels = { - "${SPICE}/NewHorizonsKernels/nh_p4p5_revised.bsp" - } + Kernels = NewHorizonsKernels }, Rotation = { Type = "Spice", diff --git a/data/scene/kerberos/textures/Kerberos-Text.png b/data/scene/newhorizons/pluto/kerberos/textures/Kerberos-Text.png similarity index 100% rename from data/scene/kerberos/textures/Kerberos-Text.png rename to data/scene/newhorizons/pluto/kerberos/textures/Kerberos-Text.png diff --git a/data/scene/kerberos/textures/gray.jpg b/data/scene/newhorizons/pluto/kerberos/textures/gray.jpg similarity index 100% rename from data/scene/kerberos/textures/gray.jpg rename to data/scene/newhorizons/pluto/kerberos/textures/gray.jpg diff --git a/data/scene/nix/nix.mod b/data/scene/newhorizons/pluto/nix/nix.mod similarity index 88% rename from data/scene/nix/nix.mod rename to data/scene/newhorizons/pluto/nix/nix.mod index 5b94f825b1..8e56474f56 100644 --- a/data/scene/nix/nix.mod +++ b/data/scene/newhorizons/pluto/nix/nix.mod @@ -1,3 +1,13 @@ +if UseAccurateNewHorizonsKernels then + NewHorizonsKernels = { + "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + } +else + NewHorizonsKernels = { + "${SPICE}/NewHorizonsKernels/nh_p4p5_revised.bsp" + } +end + return { -- Nix module { @@ -27,9 +37,7 @@ return { Body = "NIX", Reference = "ECLIPJ2000", Observer = "PLUTO BARYCENTER", - Kernels = { - "${SPICE}/NewHorizonsKernels/nh_p4p5_revised.bsp" - } + Kernels = NewHorizonsKernels }, Rotation = { Type = "Spice", diff --git a/data/scene/nix/textures/Nix-Text.png b/data/scene/newhorizons/pluto/nix/textures/Nix-Text.png similarity index 100% rename from data/scene/nix/textures/Nix-Text.png rename to data/scene/newhorizons/pluto/nix/textures/Nix-Text.png diff --git a/data/scene/nix/textures/gray.jpg b/data/scene/newhorizons/pluto/nix/textures/gray.jpg similarity index 100% rename from data/scene/nix/textures/gray.jpg rename to data/scene/newhorizons/pluto/nix/textures/gray.jpg diff --git a/data/scene/plutoprojection/plutoprojection.data b/data/scene/newhorizons/pluto/plutoprojection/plutoprojection.data similarity index 72% rename from data/scene/plutoprojection/plutoprojection.data rename to data/scene/newhorizons/pluto/plutoprojection/plutoprojection.data index 49e26de6dc..626f2eb2b5 100644 --- a/data/scene/plutoprojection/plutoprojection.data +++ b/data/scene/newhorizons/pluto/plutoprojection/plutoprojection.data @@ -2,6 +2,7 @@ return { FileRequest = { { Identifier = "newhorizons_plutoencounter_pluto_assets", Destination = "assets", Version = 1 }, { Identifier = "newhorizons_plutoencounter_pluto_textures", Destination = "textures", Version = 2 }, - { Identifier = "pluto_textures", Destination = "textures", Version = 2 } + { Identifier = "pluto_textures", Destination = "textures", Version = 2 }, + { Identifier = "newhorizons_plutoencounter_pluto_images", Destination = "images", Version = 1 } }, } \ No newline at end of file diff --git a/data/scene/plutoprojection/plutoprojection.mod b/data/scene/newhorizons/pluto/plutoprojection/plutoprojection.mod similarity index 80% rename from data/scene/plutoprojection/plutoprojection.mod rename to data/scene/newhorizons/pluto/plutoprojection/plutoprojection.mod index 9afc71086a..2338b3653d 100644 --- a/data/scene/plutoprojection/plutoprojection.mod +++ b/data/scene/newhorizons/pluto/plutoprojection/plutoprojection.mod @@ -1,3 +1,14 @@ +if UseAccurateNewHorizonsKernels then + NewHorizonsKernels = { + "${SPICE}/nh_kernels/spk/NavPE_de433_od122.bsp", + "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + } +else + NewHorizonsKernels = { + "${SPICE}/NewHorizonsKernels/nh_plu017.bsp" + } +end + return { -- Pluto barycenter module { @@ -8,9 +19,7 @@ return { Body = "PLUTO BARYCENTER", Reference = "ECLIPJ2000", Observer = "SUN", - Kernels = { - "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - } + Kernels = NewHorizonsKernels }, }, -- PlutoProjection module @@ -28,7 +37,10 @@ return { }, Textures = { Type = "simple", - Color = "textures/pluto_large.jpg", + -- Color = "textures/pluto_highres_180.jpg", + Color = "textures/Shenk_180.jpg", + -- Color = "textures/pluto_large.jpg", + -- Color = "textures/white.png", Project = "textures/3.jpg", Sequencing = "true", }, @@ -38,44 +50,14 @@ return { MieColor = {1.0, 1.0, 1.0} }, Projection = { - --Sequence = "${OPENSPACE_DATA}/scene/plutoprojection/assets/incomingImagery", - --SequenceType = "image-sequence", - Sequence = "${OPENSPACE_DATA}/scene/plutoprojection/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt", - SequenceType = "playbook", - Observer = "NEW HORIZONS", - Target = "PLUTO", - Aberration = "NONE", + Sequence = "${OPENSPACE_DATA}/scene/newhorizons/pluto/plutoprojection/images", + EventFile = "${OPENSPACE_DATA}/scene/newhorizons/pluto/plutoprojection/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt", + SequenceType = "hybrid", + Observer = "NEW HORIZONS", + Target = "PLUTO", + Aberration = "NONE", }, DataInputTranslation = { - --[[Instrument = { - LORRI = { - DetectorType = "Camera", - Spice = {"NH_LORRI"}, - }, - RALPH_MVIC_PAN_FRAME = { - DetectorType = "Scanner", - StopCommand = "RALPH_ABORT", - Spice = {"NH_RALPH_MVIC_FT"}, - }, - }, - Target ={ - Read = { - "TARGET_NAME", - "INSTRUMENT_HOST_NAME", - "INSTRUMENT_ID", - "START_TIME", - "STOP_TIME", - "DETECTOR_TYPE", - --"SEQUENCE_ID", - }, - Convert = { - PLUTO = {"PLUTO" }, - NEWHORIZONS = {"NEW HORIZONS"}, - CCD = {"CAMERA" }, - FRAMECCD = {"SCANNER" }, - }, - }, - --]] Instrument = { LORRI = { DetectorType = "Camera", @@ -134,6 +116,23 @@ return { StopCommand = "REX_MODE_OFF", Spice = { "NH_REX" }, } + }, + Target ={ + Read = { + "TARGET_NAME", + "INSTRUMENT_HOST_NAME", + "INSTRUMENT_ID", + "START_TIME", + "STOP_TIME", + "DETECTOR_TYPE", + --"SEQUENCE_ID", + }, + Convert = { + PLUTO = {"PLUTO" }, + NEWHORIZONS = {"NEW HORIZONS"}, + CCD = {"CAMERA" }, + FRAMECCD = {"SCANNER" }, + }, }, }, Instrument = { @@ -159,9 +158,7 @@ return { Body = "PLUTO", Reference = "GALACTIC", Observer = "PLUTO BARYCENTER", - Kernels = { - "${SPICE}/NewHorizonsKernels/nh_plu017.bsp" - } + Kernels = NewHorizonsKernels }, Rotation = { Type = "Spice", @@ -171,7 +168,7 @@ return { GuiName = "/Solar/Planets/Pluto" }, { - Name = "Barycenter", + Name = "PlutoBarycenterLabel", Parent = "PlutoBarycenter", Renderable = { Type = "RenderablePlane", @@ -185,14 +182,8 @@ return { } }, Ephemeris = { - Type = "Spice", - Body = "PLUTO BARYCENTER", - Reference = "ECLIPJ2000", - Observer = "SUN", - Kernels = { - --"${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - "${OPENSPACE_DATA}/spice/nh_plu017.bsp" - } + Type = "Static", + Position = {0, 0, 0, 1} }, }, { @@ -264,25 +255,6 @@ return { }, }, GuiName = "/Solar/CharonTrail" - }, - { - Name = "PlutoBarycenterLabel", - Parent = "PlutoBarycenter", - Renderable = { - Type = "RenderablePlane", - Billboard = true, - Size = { 5, 4 }, - Texture = "textures/barycenter.png", - Atmosphere = { - Type = "Nishita", -- for example, values missing etc etc - MieFactor = 1.0, - MieColor = {1.0, 1.0, 1.0} - } - }, - Ephemeris = { - Type = "Static", - Position = {0, 0, 0, 1} - }, }, -- PlutoTrail module { diff --git a/data/scene/styx/styx.mod b/data/scene/newhorizons/pluto/styx/styx.mod similarity index 88% rename from data/scene/styx/styx.mod rename to data/scene/newhorizons/pluto/styx/styx.mod index 2e4163373b..56523e95da 100644 --- a/data/scene/styx/styx.mod +++ b/data/scene/newhorizons/pluto/styx/styx.mod @@ -1,3 +1,13 @@ +if UseAccurateNewHorizonsKernels then + NewHorizonsKernels = { + "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + } +else + NewHorizonsKernels = { + "${SPICE}/NewHorizonsKernels/nh_p4p5_revised.bsp" + } +end + return { -- Styx module { @@ -27,9 +37,7 @@ return { Body = "STYX", Reference = "ECLIPJ2000", Observer = "PLUTO BARYCENTER", - Kernels = { - "${SPICE}/NewHorizonsKernels/nh_p4p5_revised.bsp" - } + Kernels = NewHorizonsKernels }, Rotation = { Type = "Spice", diff --git a/data/scene/styx/textures/Styx-Text.png b/data/scene/newhorizons/pluto/styx/textures/Styx-Text.png similarity index 100% rename from data/scene/styx/textures/Styx-Text.png rename to data/scene/newhorizons/pluto/styx/textures/Styx-Text.png diff --git a/data/scene/styx/textures/gray.jpg b/data/scene/newhorizons/pluto/styx/textures/gray.jpg similarity index 100% rename from data/scene/styx/textures/gray.jpg rename to data/scene/newhorizons/pluto/styx/textures/gray.jpg diff --git a/data/scene/plutoprojectionhybrid/plutoprojectionhybrid.data b/data/scene/plutoprojectionhybrid/plutoprojectionhybrid.data deleted file mode 100644 index 49e26de6dc..0000000000 --- a/data/scene/plutoprojectionhybrid/plutoprojectionhybrid.data +++ /dev/null @@ -1,7 +0,0 @@ -return { - FileRequest = { - { Identifier = "newhorizons_plutoencounter_pluto_assets", Destination = "assets", Version = 1 }, - { Identifier = "newhorizons_plutoencounter_pluto_textures", Destination = "textures", Version = 2 }, - { Identifier = "pluto_textures", Destination = "textures", Version = 2 } - }, -} \ No newline at end of file diff --git a/data/scene/plutoprojectionhybrid/plutoprojectionhybrid.mod b/data/scene/plutoprojectionhybrid/plutoprojectionhybrid.mod deleted file mode 100644 index 5adeb060ff..0000000000 --- a/data/scene/plutoprojectionhybrid/plutoprojectionhybrid.mod +++ /dev/null @@ -1,273 +0,0 @@ -return { - -- Pluto barycenter module - { - Name = "PlutoBarycenter", - Parent = "SolarSystemBarycenter", - Ephemeris = { - Type = "Spice", - Body = "PLUTO BARYCENTER", - Reference = "ECLIPJ2000", - Observer = "SUN", - Kernels = { - "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - } - }, - }, - -- PlutoProjection module - { - Name = "PlutoProjection", - Parent = "PlutoBarycenter", - Renderable = { - Type = "RenderablePlanetProjection", - Frame = "IAU_PLUTO", - Body = "PLUTO", - Geometry = { - Type = "SimpleSphereProjection", - Radius = { 1.173 , 6 }, - Segments = 100 - }, - Textures = { - Type = "simple", - -- Color = "textures/pluto_highres_180.jpg", - Color = "textures/Shenk_180.jpg", - -- Color = "textures/pluto_large.jpg", - -- Color = "textures/white.png", - Project = "textures/3.jpg", - Sequencing = "true", - }, - Atmosphere = { - Type = "Nishita", -- for example, values missing etc etc - MieFactor = 1.0, - MieColor = {1.0, 1.0, 1.0} - }, - Projection = { - Sequence = "${OPENSPACE_DATA}/scene/plutoprojectionhybrid/images", - EventFile = "${OPENSPACE_DATA}/scene/plutoprojectionhybrid/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt", - SequenceType = "hybrid", - Observer = "NEW HORIZONS", - Target = "PLUTO", - Aberration = "NONE", - }, - DataInputTranslation = { - Instrument = { - LORRI = { - DetectorType = "Camera", - Spice = {"NH_LORRI"}, - }, - RALPH_MVIC_PAN_FRAME = { - DetectorType = "Scanner", - StopCommand = "RALPH_ABORT", - Spice = {"NH_RALPH_MVIC_FT"}, - }, - RALPH_MVIC_COLOR = { - DetectorType = "Scanner", - StopCommand = "END_NOM", - Spice = { "NH_RALPH_MVIC_NIR", - "NH_RALPH_MVIC_METHANE", - "NH_RALPH_MVIC_RED", - "NH_RALPH_MVIC_BLUE" }, - }, - RALPH_LEISA = { - DetectorType = "Scanner", - StopCommand = "END_NOM", - Spice = {"NH_RALPH_LEISA"}, - }, - RALPH_MVIC_PAN1 = { - DetectorType = "Scanner", - StopCommand = "END_NOM", - Spice = {"NH_RALPH_MVIC_PAN1"}, - }, - RALPH_MVIC_PAN2 = { - DetectorType = "Scanner", - StopCommand = "END_NOM", - Spice = {"NH_RALPH_MVIC_PAN2"}, - }, - ALICE_Use_AIRGLOW = { - DetectorType = "Scanner", - StopCommand = "ALICE_END_PIXELLIST", - Spice = {"NH_ALICE_AIRGLOW"}, - }, - ALICE_Use_AIRGLOW = { - DetectorType = "Scanner", - StopCommand = "ALICE_END_HISTOGRAM", - Spice = {"NH_ALICE_AIRGLOW"}, - }, - ALICE_Use_SOCC = { - DetectorType = "Scanner", - StopCommand = "ALICE_END_PIXELLIST", - Spice = {"NH_ALICE_SOC"}, - }, - ALICE_Use_SOCC = { - DetectorType = "Scanner", - StopCommand = "ALICE_END_HISTOGRAM", - Spice = {"NH_ALICE_SOC"}, - }, - REX_START = { - DetectorType = "Scanner", - StopCommand = "REX_MODE_OFF", - Spice = { "NH_REX" }, - } - }, - Target ={ - Read = { - "TARGET_NAME", - "INSTRUMENT_HOST_NAME", - "INSTRUMENT_ID", - "START_TIME", - "STOP_TIME", - "DETECTOR_TYPE", - --"SEQUENCE_ID", - }, - Convert = { - PLUTO = {"PLUTO" }, - NEWHORIZONS = {"NEW HORIZONS"}, - CCD = {"CAMERA" }, - FRAMECCD = {"SCANNER" }, - }, - }, - }, - Instrument = { - Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.2907, - Aspect = 1, - Near = 0.2, - Far = 10000, - }, - PotentialTargets = { - "PLUTO", - "CHARON", - "NIX", - "HYDRA", - "P5", - "P4", - } - }, - Ephemeris = { - Type = "Spice", - Body = "PLUTO", - Reference = "GALACTIC", - Observer = "PLUTO BARYCENTER", - Kernels = { - "${SPICE}/NewHorizonsKernels/nh_plu017.bsp" - } - }, - Rotation = { - Type = "Spice", - Frame = "IAU_PLUTO", - Reference = "GALACTIC" - }, - GuiName = "/Solar/Planets/Pluto" - }, - { - Name = "PlutoBarycenterLabel", - Parent = "PlutoBarycenter", - Renderable = { - Type = "RenderablePlane", - Billboard = true, - Size = { 5, 4 }, - Texture = "textures/barycenter.png", - Atmosphere = { - Type = "Nishita", -- for example, values missing etc etc - MieFactor = 1.0, - MieColor = {1.0, 1.0, 1.0} - } - }, - Ephemeris = { - Type = "Static", - Position = {0, 0, 0, 1} - }, - }, - { - Name = "PlutoText", - Parent = "PlutoProjection", - Renderable = { - Type = "RenderablePlane", - Size = {1.0, 6.3}, - Origin = "Center", - Billboard = true, - Texture = "textures/Pluto-Text.png" - }, - Ephemeris = { - Type = "Static", - Position = {0, -20, 0, 5} - } - }, - { - Name = "PlutoTexture", - Parent = "PlutoProjection", - Renderable = { - Type = "RenderablePlane", - Size = {1.0, 6.4}, - Origin = "Center", - Billboard = true, - ProjectionListener = true, - Texture = "textures/Pluto-Text.png" - }, - Ephemeris = { - Type = "Static", - Position = {0, 0, 40, 5} - } - }, - { - Name = "PlutoShadow", - Parent = "PlutoProjection", - Renderable = { - Type = "RenderableShadowCylinder", - TerminatorType = "PENUMBRAL", - LightSource = "SUN", - Observer = "NEW HORIZONS", - Body = "PLUTO", - BodyFrame = "IAU_PLUTO", - MainFrame = "GALACTIC", - Aberration = "NONE", - }, - Ephemeris = { - Type = "Static", - Position = {0, 0, 0, 5} - } - }, - -- PlutoBarycentricTrail module - { - Name = "PlutoBarycentricTrail", - Parent = "PlutoBarycenter", - Renderable = { - Type = "RenderableTrail", - Body = "PLUTO", - Frame = "GALACTIC", - Observer = "PLUTO BARYCENTER", - RGB = {0.00,0.62,1.00}, - TropicalOrbitPeriod = 120 , - EarthOrbitRatio = 0.03, - DayLength = 1, - Textures = { - Type = "simple", - Color = "${COMMON_MODULE}/textures/glare_blue.png", - -- need to add different texture - }, - }, - GuiName = "/Solar/CharonTrail" - }, - -- PlutoTrail module - { - Name = "PlutoTrail", - Parent = "SolarSystemBarycenter", - Renderable = { - Type = "RenderableTrail", - Body = "PLUTO BARYCENTER", - Frame = "GALACTIC", - Observer = "SUN", - RGB = { 0.3, 0.7, 0.3 }, - TropicalOrbitPeriod = 90588 , - EarthOrbitRatio = 248.02, - DayLength = 9.9259, - Textures = { - Type = "simple", - Color = "${COMMON_MODULE}/textures/glare_blue.png", - -- need to add different texture - }, - }, - GuiName = "/Solar/PlutoTrail" - } -} diff --git a/ext/ghoul b/ext/ghoul index 849cc67bdc..fb0ce7bfbd 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 849cc67bdc2550a43d8174490d39b14ee148b795 +Subproject commit fb0ce7bfbd859efa02beab4c84b62991a25d1666 diff --git a/include/openspace/engine/configurationmanager.h b/include/openspace/engine/configurationmanager.h index 7b5ff621ae..c82ecb07fa 100644 --- a/include/openspace/engine/configurationmanager.h +++ b/include/openspace/engine/configurationmanager.h @@ -116,7 +116,7 @@ public: * configuration file * \pre \p filename must not be empty */ - void loadFromFile(const std::string& filename); + void loadFromFile(const std::string& filename); private: /** @@ -126,7 +126,7 @@ private: * \return true if the configuration file was complete; * false otherwise */ - bool checkCompleteness() const; + bool checkCompleteness() const; }; } // namespace openspace diff --git a/include/openspace/engine/downloadmanager.h b/include/openspace/engine/downloadmanager.h index 653dd1edd1..53b90cf683 100644 --- a/include/openspace/engine/downloadmanager.h +++ b/include/openspace/engine/downloadmanager.h @@ -63,20 +63,20 @@ public: using DownloadProgressCallback = std::function; using DownloadFinishedCallback = std::function; using AsyncDownloadFinishedCallback = - std::function&)>; + std::function>&)>; DownloadManager(std::string requestURL, int applicationVersion, bool useMultithreadedDownload = true); // callers responsibility to delete // callbacks happen on a different thread - FileFuture* downloadFile(const std::string& url, const ghoul::filesystem::File& file, + std::shared_ptr downloadFile(const std::string& url, const ghoul::filesystem::File& file, bool overrideFile = true, DownloadFinishedCallback finishedCallback = DownloadFinishedCallback(), DownloadProgressCallback progressCallback = DownloadProgressCallback() ); - std::vector downloadRequestFiles(const std::string& identifier, + std::vector> downloadRequestFiles(const std::string& identifier, const ghoul::filesystem::Directory& destination, int version, bool overrideFiles = true, DownloadFinishedCallback finishedCallback = DownloadFinishedCallback(), diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index f921b0ded9..891e8c795b 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -66,8 +66,8 @@ public: static bool isInitialized(); static OpenSpaceEngine& ref(); - bool isMaster(); - void setMaster(bool master); + bool isMaster(); + void setMaster(bool master); double runTime(); void setRunTime(double t); @@ -75,29 +75,29 @@ public: ConfigurationManager& configurationManager(); interaction::InteractionHandler& interactionHandler(); RenderEngine& renderEngine(); - scripting::ScriptEngine& scriptEngine(); + scripting::ScriptEngine& scriptEngine(); NetworkEngine& networkEngine(); - LuaConsole& console(); + LuaConsole& console(); ModuleEngine& moduleEngine(); network::ParallelConnection& parallelConnection(); properties::PropertyOwner& globalPropertyOwner(); WindowWrapper& windowWrapper(); ghoul::fontrendering::FontManager& fontManager(); - gui::GUI& gui(); + gui::GUI& gui(); // SGCT callbacks bool initialize(); bool initializeGL(); void preSynchronization(); void postSynchronizationPreDraw(); - void render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix); - void postDraw(); + void render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix); + void postDraw(); void keyboardCallback(Key key, KeyModifier mod, KeyAction action); - void charCallback(unsigned int codepoint, KeyModifier mod); + void charCallback(unsigned int codepoint, KeyModifier mod); void mouseButtonCallback(MouseButton button, MouseAction action); void mousePositionCallback(double x, double y); void mouseScrollWheelCallback(double pos); - void externalControlCallback(const char* receivedChars, int size, int clientId); + void externalControlCallback(const char* receivedChars, int size, int clientId); void encode(); void decode(); @@ -110,22 +110,22 @@ private: OpenSpaceEngine(std::string programName, std::unique_ptr windowWrapper); ~OpenSpaceEngine(); - void clearAllWindows(); - bool gatherCommandlineArguments(); - bool loadSpiceKernels(); + void clearAllWindows(); + bool gatherCommandlineArguments(); + bool loadSpiceKernels(); void loadFonts(); void runScripts(const ghoul::Dictionary& scripts); void runStartupScripts(); - void configureLogging(); + void configureLogging(); // Components std::unique_ptr _configurationManager; std::unique_ptr _interactionHandler; std::unique_ptr _renderEngine; - std::unique_ptr _scriptEngine; + std::unique_ptr _scriptEngine; std::unique_ptr _networkEngine; - std::unique_ptr _commandlineParser; - std::unique_ptr _console; + std::unique_ptr _commandlineParser; + std::unique_ptr _console; std::unique_ptr _moduleEngine; std::unique_ptr _gui; std::unique_ptr _parallelConnection; @@ -136,7 +136,7 @@ private: std::unique_ptr _globalPropertyNamespace; std::unique_ptr _syncBuffer; - bool _isMaster; + bool _isMaster; double _runTime; static OpenSpaceEngine* _engine; diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h index 6a6ce64dd3..d20f5339db 100644 --- a/include/openspace/engine/wrapper/windowwrapper.h +++ b/include/openspace/engine/wrapper/windowwrapper.h @@ -116,7 +116,7 @@ public: */ virtual int currentNumberOfAaSamples() const; - /** + /** * Returns true if the current rendering method is regular, i.e., it is * a flat projection without non-linear distortions. Returns false in * other cases, for example fisheye projections. On default, this method will return diff --git a/include/openspace/interaction/controller.h b/include/openspace/interaction/controller.h index a4349c248d..636b810ebe 100644 --- a/include/openspace/interaction/controller.h +++ b/include/openspace/interaction/controller.h @@ -37,14 +37,14 @@ class InteractionHandler; class Controller { public: - Controller() : - _handler(nullptr) - {} + Controller() : + _handler(nullptr) + {} - void setHandler(InteractionHandler* handler); + void setHandler(InteractionHandler* handler); protected: - InteractionHandler* _handler; + InteractionHandler* _handler; }; } // namespace interaction diff --git a/include/openspace/interaction/deviceidentifier.h b/include/openspace/interaction/deviceidentifier.h index c2174ab204..0497699149 100644 --- a/include/openspace/interaction/deviceidentifier.h +++ b/include/openspace/interaction/deviceidentifier.h @@ -14,39 +14,39 @@ enum class InputDevice {NONE, UNKNOWN, SPACENAVIGATOR, XBOX}; class DeviceIdentifier { public: - static DeviceIdentifier& ref(); - virtual ~DeviceIdentifier(); + static DeviceIdentifier& ref(); + virtual ~DeviceIdentifier(); - static void init(); - static void deinit(); - static bool isInitialized(); - - void scanDevices(); - const int numberOfDevices() const; - const InputDevice type(const int device) const; - - void update(); - void update(const int device); + static void init(); + static void deinit(); + static bool isInitialized(); + + void scanDevices(); + const int numberOfDevices() const; + const InputDevice type(const int device) const; + + void update(); + void update(const int device); - const int getButtons(const int device, unsigned char **buttons = nullptr) const; - const int getAxes(const int device, float **axespos = nullptr) const; - void get(const int device, unsigned char **buttons, float **axespos) const; - + const int getButtons(const int device, unsigned char **buttons = nullptr) const; + const int getAxes(const int device, float **axespos = nullptr) const; + void get(const int device, unsigned char **buttons, float **axespos) const; + private: - // singleton - static DeviceIdentifier* this_; + // singleton + static DeviceIdentifier* this_; DeviceIdentifier(void); DeviceIdentifier(const DeviceIdentifier& src); DeviceIdentifier& operator=(const DeviceIdentifier& rhs); - // member variables - int devices_; - std::array inputDevice_; - std::array numberOfAxes_; - std::array numberOfButtons_; - std::array axesPos_; - std::array buttons_; + // member variables + int devices_; + std::array inputDevice_; + std::array numberOfAxes_; + std::array numberOfButtons_; + std::array axesPos_; + std::array buttons_; }; diff --git a/include/openspace/interaction/externalcontrol/externalconnectioncontroller.h b/include/openspace/interaction/externalcontrol/externalconnectioncontroller.h index 4d45937c59..09e952e10e 100644 --- a/include/openspace/interaction/externalcontrol/externalconnectioncontroller.h +++ b/include/openspace/interaction/externalcontrol/externalconnectioncontroller.h @@ -9,14 +9,14 @@ namespace openspace { class ExternalConnectionController: public ExternalControl { public: - // constructors & destructor - ExternalConnectionController(); - ~ExternalConnectionController(); - + // constructors & destructor + ExternalConnectionController(); + ~ExternalConnectionController(); + private: - std::vector controllers; - + std::vector controllers; + }; } // namespace openspace diff --git a/include/openspace/interaction/externalcontrol/externalcontrol.h b/include/openspace/interaction/externalcontrol/externalcontrol.h index 4e36ed9ce5..986749135b 100644 --- a/include/openspace/interaction/externalcontrol/externalcontrol.h +++ b/include/openspace/interaction/externalcontrol/externalcontrol.h @@ -10,17 +10,17 @@ namespace openspace { class ExternalControl { public: - // constructors & destructor - ExternalControl(); - virtual ~ExternalControl(); - - virtual void update(); - - void rotate(const glm::quat &rotation); - void orbit(const glm::quat &rotation); - void distance(const PowerScaledScalar &distance); + // constructors & destructor + ExternalControl(); + virtual ~ExternalControl(); + + virtual void update(); + + void rotate(const glm::quat &rotation); + void orbit(const glm::quat &rotation); + void distance(const PowerScaledScalar &distance); - + protected: }; diff --git a/include/openspace/interaction/externalcontrol/joystickexternalcontrol.h b/include/openspace/interaction/externalcontrol/joystickexternalcontrol.h index 9416c6b202..4182d3c102 100644 --- a/include/openspace/interaction/externalcontrol/joystickexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/joystickexternalcontrol.h @@ -8,19 +8,19 @@ //class JoystickExternalControl: public PythonExternalControl { //public: // -// // constructors & destructor -// JoystickExternalControl(const char *filename); -// ~JoystickExternalControl(); -// -// void setInputDevice(const int device); -// void update(); +// // constructors & destructor +// JoystickExternalControl(const char *filename); +// ~JoystickExternalControl(); +// +// void setInputDevice(const int device); +// void update(); // //private: // -// // joystick -// int inputDevice_; -// int numberOfButtons_; -// int numberOfAxes_; +// // joystick +// int inputDevice_; +// int numberOfButtons_; +// int numberOfAxes_; //}; // //} // namespace openspace diff --git a/include/openspace/interaction/externalcontrol/keyboardexternalcontrol.h b/include/openspace/interaction/externalcontrol/keyboardexternalcontrol.h index 6e331e69b8..9a01732944 100644 --- a/include/openspace/interaction/externalcontrol/keyboardexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/keyboardexternalcontrol.h @@ -8,15 +8,15 @@ //class KeyboardExternalControl: public PythonExternalControl { //public: // -// // constructors & destructor -// KeyboardExternalControl(const char *filename); -// ~KeyboardExternalControl(); +// // constructors & destructor +// KeyboardExternalControl(const char *filename); +// ~KeyboardExternalControl(); // -// void update(); -// -// void keyboardCallback(int key, int action); +// void update(); +// +// void keyboardCallback(int key, int action); //private: -// int *keys_; +// int *keys_; // //}; // diff --git a/include/openspace/interaction/externalcontrol/mouseexternalcontrol.h b/include/openspace/interaction/externalcontrol/mouseexternalcontrol.h index 890a741733..cbd5cec7d3 100644 --- a/include/openspace/interaction/externalcontrol/mouseexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/mouseexternalcontrol.h @@ -8,18 +8,18 @@ //class MouseExternalControl: public PythonExternalControl { //public: // -// // constructors & destructor -// MouseExternalControl(const char *filename); -// ~MouseExternalControl(); +// // constructors & destructor +// MouseExternalControl(const char *filename); +// ~MouseExternalControl(); // -// void update(); -// -// void mouseButtonCallback(int key, int action); -// void mousePosCallback(int x, int y); -// void mouseScrollCallback(int pos); +// void update(); +// +// void mouseButtonCallback(int key, int action); +// void mousePosCallback(int x, int y); +// void mouseScrollCallback(int pos); //private: // -// int x_, y_, pos_, button1_, button2_, button3_; +// int x_, y_, pos_, button1_, button2_, button3_; // //}; // diff --git a/include/openspace/interaction/externalcontrol/pythonexternalcontrol.h b/include/openspace/interaction/externalcontrol/pythonexternalcontrol.h index 8a01d6f571..432f1c6d9a 100644 --- a/include/openspace/interaction/externalcontrol/pythonexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/pythonexternalcontrol.h @@ -12,22 +12,22 @@ //class PythonExternalControl: public ExternalControl { //public: // -// // constructors & destructor -// PythonExternalControl(const char *filename); -// ~PythonExternalControl(); +// // constructors & destructor +// PythonExternalControl(const char *filename); +// ~PythonExternalControl(); // -// static PyMethodDef* getMethodDef(); -// -// void message(const char *text); -// virtual void update(); -// void clear(); +// static PyMethodDef* getMethodDef(); +// +// void message(const char *text); +// virtual void update(); +// void clear(); //private: -// PythonScript ps_; +// PythonScript ps_; // //protected: -// void run(); -// int pyarrSize_; -// PyObject **pyarr_; +// void run(); +// int pyarrSize_; +// PyObject **pyarr_; //}; // //} // namespace openspace diff --git a/include/openspace/interaction/externalcontrol/randomexternalcontrol.h b/include/openspace/interaction/externalcontrol/randomexternalcontrol.h index 2cc189f4c5..171ab2c79a 100644 --- a/include/openspace/interaction/externalcontrol/randomexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/randomexternalcontrol.h @@ -11,14 +11,14 @@ namespace openspace { class RandomExternalControl: public ExternalControl { public: - // constructors & destructor - RandomExternalControl(); - ~RandomExternalControl(); - + // constructors & destructor + RandomExternalControl(); + ~RandomExternalControl(); + private: - std::mutex inputGuard; - bool *keepGoing_; - // std::thread *backgroundThread; + std::mutex inputGuard; + bool *keepGoing_; + // std::thread *backgroundThread; }; } // namespace openspace diff --git a/include/openspace/interaction/interactionhandler.h b/include/openspace/interaction/interactionhandler.h index 9a314d2dfe..2661603342 100644 --- a/include/openspace/interaction/interactionhandler.h +++ b/include/openspace/interaction/interactionhandler.h @@ -22,55 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -//<<<<<<< HEAD -//#ifndef INTERACTIONHANDLER_H -//#define INTERACTIONHANDLER_H -// -//#include -//#include -//#include -// -//// std includes -//#include -//#include -//#include -//#include -// -//namespace openspace { -// -//// Forward declare to minimize dependencies -//class Camera; -//class SceneGraphNode; -//class ExternalControl; -// -//class InteractionHandler { -//public: -// InteractionHandler(void); -// InteractionHandler(const InteractionHandler& src); -// InteractionHandler& operator=(const InteractionHandler& rhs); -// virtual ~InteractionHandler(); -// -// void enable(); -// void disable(); -// const bool isEnabled() const; -// -// void connectDevices(); -// void addExternalControl(ExternalControl* controller); -// -// void setCamera(Camera *camera = nullptr); -// void setOrigin(SceneGraphNode* node); -// -// Camera* getCamera() const; -// const psc getOrigin() const; -// void lockControls(); -// void unlockControls(); -// -// void setFocusNode(SceneGraphNode *node); -// -// void orbit(const glm::quat &rotation); -// void rotate(const glm::quat &rotation); -// void distance(const PowerScaledScalar &distance, size_t iterations = 0); -//======= #ifndef __INTERACTIONHANDLER_H__ #define __INTERACTIONHANDLER_H__ @@ -94,45 +45,45 @@ class InteractionHandler : public properties::PropertyOwner { public: InteractionHandler(); - ~InteractionHandler(); + ~InteractionHandler(); - void setKeyboardController(KeyboardController* controller); - void setMouseController(MouseController* controller); - void addController(Controller* controller); + void setKeyboardController(KeyboardController* controller); + void setMouseController(MouseController* controller); + void addController(Controller* controller); - void lockControls(); - void unlockControls(); + void lockControls(); + void unlockControls(); - void update(double deltaTime); + void update(double deltaTime); - void setFocusNode(SceneGraphNode* node); - const SceneGraphNode* const focusNode() const; - void setCamera(Camera* camera); - const Camera* const camera() const; + void setFocusNode(SceneGraphNode* node); + const SceneGraphNode* const focusNode() const; + void setCamera(Camera* camera); + const Camera* const camera() const; void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); - void mouseButtonCallback(MouseButton button, MouseAction action); - void mousePositionCallback(double x, double y); - void mouseScrollWheelCallback(double pos); + void mouseButtonCallback(MouseButton button, MouseAction action); + void mousePositionCallback(double x, double y); + void mouseScrollWheelCallback(double pos); - double deltaTime() const; + double deltaTime() const; - void orbitDelta(const glm::quat& rotation); + void orbitDelta(const glm::quat& rotation); - void orbit(const float &dx, const float &dy, const float &dz, const float &dist); + void orbit(const float &dx, const float &dy, const float &dz, const float &dist); - //void distance(const float &d); + //void distance(const float &d); - void rotateDelta(const glm::quat& rotation); + void rotateDelta(const glm::quat& rotation); - void distanceDelta(const PowerScaledScalar& distance, size_t iterations = 0); + void distanceDelta(const PowerScaledScalar& distance, size_t iterations = 0); - void lookAt(const glm::quat& rotation); + void lookAt(const glm::quat& rotation); - void setRotation(const glm::quat& rotation); + void setRotation(const glm::quat& rotation); - void resetKeyBindings(); - void bindKey(Key key, std::string lua); + void resetKeyBindings(); + void bindKey(Key key, KeyModifier modifier, std::string lua); void setInteractionSensitivity(float sensitivity); float interactionSensitivity() const; @@ -143,51 +94,51 @@ public: void setInvertRotation(bool invert); bool invertRotation() const; - void addKeyframe(const network::datamessagestructures::PositionKeyframe &kf); + void addKeyframe(const network::datamessagestructures::PositionKeyframe &kf); void clearKeyframes(); - /** - * Returns the Lua library that contains all Lua functions available to affect the - * interaction. The functions contained are - * - openspace::luascriptfunctions::setOrigin - * \return The Lua library that contains all Lua functions available to affect the - * interaction - */ - static scripting::ScriptEngine::LuaLibrary luaLibrary(); - -private: + /** + * Returns the Lua library that contains all Lua functions available to affect the + * interaction. The functions contained are + * - openspace::luascriptfunctions::setOrigin + * \return The Lua library that contains all Lua functions available to affect the + * interaction + */ + static scripting::ScriptEngine::LuaLibrary luaLibrary(); - friend class Controller; +private: + friend class Controller; InteractionHandler(const InteractionHandler&) = delete; InteractionHandler& operator=(const InteractionHandler&) = delete; - InteractionHandler(InteractionHandler&&) = delete; - InteractionHandler& operator=(InteractionHandler&&) = delete; + InteractionHandler(InteractionHandler&&) = delete; + InteractionHandler& operator=(InteractionHandler&&) = delete; - Camera* _camera; - SceneGraphNode* _focusNode; + Camera* _camera; + SceneGraphNode* _focusNode; - double _deltaTime; - std::mutex _mutex; + double _deltaTime; + std::mutex _mutex; - bool _validKeyLua; - std::multimap _keyLua; + bool _validKeyLua; + + std::multimap _keyLua; float _controllerSensitivity; bool _invertRoll; bool _invertRotation; - KeyboardController* _keyboardController; - MouseController* _mouseController; - std::vector _controllers; + KeyboardController* _keyboardController; + MouseController* _mouseController; + std::vector _controllers; properties::StringProperty _origin; properties::StringProperty _coordinateSystem; - //remote controller - std::vector _keyframes; - double _currentKeyframeTime; - std::mutex _keyframeMutex; + //remote controller + std::vector _keyframes; + double _currentKeyframeTime; + std::mutex _keyframeMutex; }; } // namespace interaction diff --git a/include/openspace/interaction/keyboardcontroller.h b/include/openspace/interaction/keyboardcontroller.h index d739d9b802..94550e2869 100644 --- a/include/openspace/interaction/keyboardcontroller.h +++ b/include/openspace/interaction/keyboardcontroller.h @@ -35,20 +35,20 @@ namespace interaction { class KeyboardController : public Controller { public: virtual ~KeyboardController() {}; - virtual void keyPressed(KeyAction action, Key key, KeyModifier modifier) = 0; + virtual void keyPressed(KeyAction action, Key key, KeyModifier modifier) = 0; }; class KeyboardControllerFixed : public KeyboardController { public: - void keyPressed(KeyAction action, Key key, KeyModifier modifier); + void keyPressed(KeyAction action, Key key, KeyModifier modifier); }; class KeyboardControllerLua : public KeyboardController { public: - void keyPressed(KeyAction action, Key key, KeyModifier modifier); + void keyPressed(KeyAction action, Key key, KeyModifier modifier); protected: - std::string keyToString(Key key, KeyModifier mod) const; + std::string keyToString(Key key, KeyModifier mod) const; }; } // namespace interaction diff --git a/include/openspace/interaction/luaconsole.h b/include/openspace/interaction/luaconsole.h index 547fe09c1e..d3e6aed595 100644 --- a/include/openspace/interaction/luaconsole.h +++ b/include/openspace/interaction/luaconsole.h @@ -36,35 +36,35 @@ namespace openspace { class LuaConsole { public: - LuaConsole(); + LuaConsole(); void initialize(); void deinitialize(); - void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); + void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); void charCallback(unsigned int codepoint, KeyModifier modifier); - void render(); + void render(); Key commandInputButton(); - bool isVisible() const; - void setVisible(bool visible); - void toggleVisibility(); - - static scripting::ScriptEngine::LuaLibrary luaLibrary(); + bool isVisible() const; + void setVisible(bool visible); + void toggleVisibility(); + + static scripting::ScriptEngine::LuaLibrary luaLibrary(); private: void addToCommand(std::string c); - std::string UnicodeToUTF8(unsigned int codepoint); + std::string UnicodeToUTF8(unsigned int codepoint); - size_t _inputPosition; - std::vector _commandsHistory; - size_t _activeCommand; - std::vector _commands; + size_t _inputPosition; + std::vector _commandsHistory; + size_t _activeCommand; + std::vector _commands; - std::string _filename; + std::string _filename; struct { int lastIndex; @@ -72,7 +72,7 @@ private: std::string initialValue; } _autoCompleteInfo; - bool _isVisible; + bool _isVisible; }; } // namespace openspace diff --git a/include/openspace/interaction/mousecontroller.h b/include/openspace/interaction/mousecontroller.h index bc247ec384..6df5c53165 100644 --- a/include/openspace/interaction/mousecontroller.h +++ b/include/openspace/interaction/mousecontroller.h @@ -36,66 +36,66 @@ namespace interaction { class MouseController : public Controller { public: - MouseController(); + MouseController(); virtual ~MouseController() {} - virtual void button(MouseButton button, MouseAction action) = 0; - virtual void move(float x, float y) = 0; - virtual void scrollWheel(int pos) = 0; - virtual void update(const double& dt) = 0; + virtual void button(MouseButton button, MouseAction action) = 0; + virtual void move(float x, float y) = 0; + virtual void scrollWheel(int pos) = 0; + virtual void update(const double& dt) = 0; protected: - glm::vec3 _lastTrackballPos; - bool _isMouseBeingPressedAndHeld; + glm::vec3 _lastTrackballPos; + bool _isMouseBeingPressedAndHeld; - glm::vec3 mapToTrackball(glm::vec2 mousePos); + glm::vec3 mapToTrackball(glm::vec2 mousePos); - glm::vec3 mapToCamera(glm::vec3 trackballPos); + glm::vec3 mapToCamera(glm::vec3 trackballPos); - void trackballRotate(int x, int y); + void trackballRotate(int x, int y); }; class TrackballMouseController : public MouseController { public: - TrackballMouseController(); + TrackballMouseController(); - void button(MouseButton button, MouseAction action) override; + void button(MouseButton button, MouseAction action) override; - void move(float x, float y) override; + void move(float x, float y) override; - void scrollWheel(int pos) override; + void scrollWheel(int pos) override; - void update(const double& dt) override; + void update(const double& dt) override; protected: - bool _leftMouseButtonDown; - glm::vec3 _previousTrackballPos; + bool _leftMouseButtonDown; + glm::vec3 _previousTrackballPos; }; class OrbitalMouseController : public MouseController { public: - OrbitalMouseController(); + OrbitalMouseController(); - void button(MouseButton button, MouseAction action) override; + void button(MouseButton button, MouseAction action) override; - void move(float x, float y) override; + void move(float x, float y) override; - void scrollWheel(int pos) override; + void scrollWheel(int pos) override; - void update(const double& dt) override; + void update(const double& dt) override; protected: - bool _leftMouseButtonDown; - bool _rightMouseButtonDown; - bool _middleMouseButtonDown; - glm::vec2 _previousCursorPos[3]; - glm::vec2 _currentCursorPos; - glm::vec2 _currentCursorDiff[3]; - float _rotationSpeed; - float _navigationSpeed; + bool _leftMouseButtonDown; + bool _rightMouseButtonDown; + bool _middleMouseButtonDown; + glm::vec2 _previousCursorPos[3]; + glm::vec2 _currentCursorPos; + glm::vec2 _currentCursorDiff[3]; + float _rotationSpeed; + float _navigationSpeed; private: - enum MouseButtons{ ButtonLeft = 0, ButtonRight, ButtonMiddle }; + enum MouseButtons{ ButtonLeft = 0, ButtonRight, ButtonMiddle }; }; } // namespace interaction diff --git a/include/openspace/network/parallelconnection.h b/include/openspace/network/parallelconnection.h index b4187c1c5b..caa9b3bdfb 100644 --- a/include/openspace/network/parallelconnection.h +++ b/include/openspace/network/parallelconnection.h @@ -82,7 +82,7 @@ namespace openspace{ void requestHostship(const std::string &password); - void setPassword(const std::string &password); + void setPassword(const std::string &password); void signalDisconnect(); @@ -113,23 +113,23 @@ namespace openspace{ protected: private: - //@TODO change this into the ghoul hasher for client AND server - uint32_t hash(const std::string &val){ - uint32_t hashVal = 0, i; - size_t len = val.length(); + //@TODO change this into the ghoul hasher for client AND server + uint32_t hash(const std::string &val){ + uint32_t hashVal = 0, i; + size_t len = val.length(); - for (hashVal = i = 0; i < len; ++i){ - hashVal += val.c_str()[i]; - hashVal += (hashVal << 10); - hashVal ^= (hashVal >> 6); - } + for (hashVal = i = 0; i < len; ++i){ + hashVal += val.c_str()[i]; + hashVal += (hashVal << 10); + hashVal ^= (hashVal >> 6); + } - hashVal += (hashVal << 3); - hashVal ^= (hashVal >> 11); - hashVal += (hashVal << 15); + hashVal += (hashVal << 3); + hashVal ^= (hashVal >> 11); + hashVal += (hashVal << 15); - return hashVal; - }; + return hashVal; + }; void queueMessage(std::vector message); @@ -137,27 +137,27 @@ namespace openspace{ void writeHeader(std::vector &buffer, uint32_t messageType); - void closeSocket(); + void closeSocket(); - bool initNetworkAPI(); + bool initNetworkAPI(); - void establishConnection(addrinfo *info); + void establishConnection(addrinfo *info); - void sendAuthentication(); + void sendAuthentication(); - void listenCommunication(); + void listenCommunication(); - void delegateDecoding(uint32_t type); + void delegateDecoding(uint32_t type); - void initializationMessageReceived(); + void initializationMessageReceived(); - void dataMessageReceived(); + void dataMessageReceived(); - void hostInfoMessageReceived(); - - void initializationRequestMessageReceived(); + void hostInfoMessageReceived(); + + void initializationRequestMessageReceived(); - void broadcast(); + void broadcast(); int headerSize(); @@ -171,15 +171,15 @@ namespace openspace{ std::string scriptFromPropertyAndValue(const std::string property, const std::string value); - uint32_t _passCode; + uint32_t _passCode; std::string _port; std::string _address; std::string _name; _SOCKET _clientSocket; std::thread *_connectionThread; - std::thread *_broadcastThread; + std::thread *_broadcastThread; std::thread *_sendThread; - std::thread *_listenThread; + std::thread *_listenThread; std::thread *_handlerThread; std::atomic _isHost; std::atomic _isConnected; diff --git a/include/openspace/openspace.h b/include/openspace/openspace.h new file mode 100644 index 0000000000..c6640e989d --- /dev/null +++ b/include/openspace/openspace.h @@ -0,0 +1,42 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_H__ +#define __OPENSPACE_H__ + +#include + +namespace openspace { + +std::string licenseText(); + +const int OPENSPACE_VERSION_MAJOR = 0; +const int OPENSPACE_VERSION_MINOR = 3; +const int OPENSPACE_VERSION_PATCH = 0; + +const std::string OPENSPACE_VERSION_STRING = "prerelease-8"; + +} // namespace openspace + +#endif // __OPENSPACE_H__ \ No newline at end of file diff --git a/include/openspace/properties/numericalproperty.h b/include/openspace/properties/numericalproperty.h index 09cf92b517..33a179b7fd 100644 --- a/include/openspace/properties/numericalproperty.h +++ b/include/openspace/properties/numericalproperty.h @@ -35,35 +35,35 @@ class NumericalProperty : public TemplateProperty { public: NumericalProperty(std::string identifier, std::string guiName); NumericalProperty(std::string identifier, std::string guiName, T value); - NumericalProperty(std::string identifier, std::string guiName, T value, - T minimumValue, T maximumValue); + NumericalProperty(std::string identifier, std::string guiName, T value, + T minimumValue, T maximumValue); NumericalProperty(std::string identifier, std::string guiName, T value, T minimumValue, T maximumValue, T steppingValue); - bool getLuaValue(lua_State* state) const override; - bool setLuaValue(lua_State* state) override; - int typeLua() const override; + bool getLuaValue(lua_State* state) const override; + bool setLuaValue(lua_State* state) override; + int typeLua() const override; bool getStringValue(std::string& value) const override; bool setStringValue(std::string value) override; - T minValue() const; - T maxValue() const; + T minValue() const; + T maxValue() const; virtual std::string className() const override; using TemplateProperty::operator=; protected: - static const std::string MinimumValueKey; - static const std::string MaximumValueKey; - static const std::string SteppingValueKey; + static const std::string MinimumValueKey; + static const std::string MaximumValueKey; + static const std::string SteppingValueKey; - std::string generateAdditionalDescription() const; + std::string generateAdditionalDescription() const; T _minimumValue; T _maximumValue; - T _stepping; + T _stepping; }; } // namespace properties diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index ef3f686d53..5366f2d6fd 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -48,9 +48,9 @@ namespace properties { template <> \ TYPE PropertyDelegate>::defaultMaximumValue(); \ \ - template <> \ - template <> \ - TYPE PropertyDelegate>::defaultSteppingValue(); \ + template <> \ + template <> \ + TYPE PropertyDelegate>::defaultSteppingValue(); \ \ template <> \ template <> \ @@ -104,41 +104,41 @@ namespace properties { std::string PropertyDelegate>::className() \ { \ return #CLASS_NAME; \ - } \ + } \ \ template <> \ std::string PropertyDelegate>::className() \ { \ return PropertyDelegate>::className(); \ - } \ + } \ \ template <> \ template <> \ TYPE PropertyDelegate>::defaultValue() \ { \ return DEFAULT_VALUE; \ - } \ + } \ \ template <> \ template <> \ TYPE PropertyDelegate>::defaultMinimumValue() \ { \ return DEFAULT_MIN_VALUE; \ - } \ + } \ \ template <> \ template <> \ TYPE PropertyDelegate>::defaultMaximumValue() \ { \ return DEFAULT_MAX_VALUE; \ - } \ + } \ \ - template <> \ - template <> \ - TYPE PropertyDelegate>::defaultSteppingValue() \ - { \ - return DEFAULT_STEPPING; \ - } \ + template <> \ + template <> \ + TYPE PropertyDelegate>::defaultSteppingValue() \ + { \ + return DEFAULT_STEPPING; \ + } \ \ template <> \ template <> \ @@ -146,7 +146,7 @@ namespace properties { bool& success) \ { \ return FROM_LUA_LAMBDA_EXPRESSION(state, success); \ - } \ + } \ \ template <> \ template <> \ @@ -155,7 +155,7 @@ namespace properties { { \ return PropertyDelegate>::fromLuaValue(state, \ success); \ - } \ + } \ \ template <> \ template <> \ @@ -235,33 +235,33 @@ const std::string NumericalProperty::SteppingValueKey = "SteppingValue"; template NumericalProperty::NumericalProperty(std::string identifier, std::string guiName) : NumericalProperty( - std::move(identifier), std::move(guiName), - PropertyDelegate>::template defaultValue(), - PropertyDelegate>::template defaultMinimumValue(), - PropertyDelegate>::template defaultMaximumValue(), - PropertyDelegate>::template defaultSteppingValue() - ) + std::move(identifier), std::move(guiName), + PropertyDelegate>::template defaultValue(), + PropertyDelegate>::template defaultMinimumValue(), + PropertyDelegate>::template defaultMaximumValue(), + PropertyDelegate>::template defaultSteppingValue() + ) {} template NumericalProperty::NumericalProperty(std::string identifier, std::string guiName, T value) : NumericalProperty( - std::move(identifier), std::move(guiName), std::move(value), - PropertyDelegate>::template defaultMinimumValue(), - PropertyDelegate>::template defaultMaximumValue(), - PropertyDelegate>::template defaultSteppingValue() - ) + std::move(identifier), std::move(guiName), std::move(value), + PropertyDelegate>::template defaultMinimumValue(), + PropertyDelegate>::template defaultMaximumValue(), + PropertyDelegate>::template defaultSteppingValue() + ) {} template NumericalProperty::NumericalProperty(std::string identifier, std::string guiName, - T value, T minimumValue, T maximumValue) - : NumericalProperty( - std::move(identifier) , std::move(guiName), std::move(value), - std::move(minimumValue), std::move(maximumValue), - PropertyDelegate>::template defaultSteppingValue() - ) + T value, T minimumValue, T maximumValue) + : NumericalProperty( + std::move(identifier) , std::move(guiName), std::move(value), + std::move(minimumValue), std::move(maximumValue), + PropertyDelegate>::template defaultSteppingValue() + ) {} template @@ -271,7 +271,7 @@ NumericalProperty::NumericalProperty(std::string identifier, : TemplateProperty(std::move(identifier), std::move(guiName), std::move(value)) , _minimumValue(std::move(minimumValue)) , _maximumValue(std::move(maximumValue)) - , _stepping(std::move(steppingValue)) + , _stepping(std::move(steppingValue)) {} template @@ -282,23 +282,23 @@ std::string NumericalProperty::className() const { template bool NumericalProperty::setLuaValue(lua_State* state) { - bool success = false; - T value = PropertyDelegate>::template fromLuaValue(state, success); - if (success) - TemplateProperty::setValue(value); - return success; + bool success = false; + T value = PropertyDelegate>::template fromLuaValue(state, success); + if (success) + TemplateProperty::setValue(value); + return success; } template bool NumericalProperty::getLuaValue(lua_State* state) const { - bool success = PropertyDelegate>::template toLuaValue(state, TemplateProperty::_value); - return success; + bool success = PropertyDelegate>::template toLuaValue(state, TemplateProperty::_value); + return success; } template int NumericalProperty::typeLua() const { - return PropertyDelegate>::typeLua(); + return PropertyDelegate>::typeLua(); } template @@ -318,21 +318,21 @@ bool NumericalProperty::setStringValue(std::string value) { template T NumericalProperty::minValue() const { - return _minimumValue; + return _minimumValue; } template T NumericalProperty::maxValue() const { - return _maximumValue; + return _maximumValue; } template std::string NumericalProperty::generateAdditionalDescription() const { - std::string result; - result += MinimumValueKey + " = " + std::to_string(_minimumValue) + ","; - result += MaximumValueKey + " = " + std::to_string(_maximumValue) + ","; - result += SteppingValueKey + " = " + std::to_string(_stepping); - return result; + std::string result; + result += MinimumValueKey + " = " + std::to_string(_minimumValue) + ","; + result += MaximumValueKey + " = " + std::to_string(_maximumValue) + ","; + result += SteppingValueKey + " = " + std::to_string(_stepping); + return result; } } // namespace properties diff --git a/include/openspace/properties/optionproperty.h b/include/openspace/properties/optionproperty.h index ef9a3f9f2e..cd248fe336 100644 --- a/include/openspace/properties/optionproperty.h +++ b/include/openspace/properties/optionproperty.h @@ -41,58 +41,58 @@ namespace properties { */ class OptionProperty : public IntProperty { public: - /** - * The struct storing a single option consisting of an integer value and - * a string description. - */ - struct Option { - int value; - std::string description; - }; + /** + * The struct storing a single option consisting of an integer value and + * a string description. + */ + struct Option { + int value; + std::string description; + }; - /** - * The constructor delegating the identifier and the guiName - * to its super class. - * \param identifier A unique identifier for this property - * \param guiName The GUI name that should be used to represent this property - */ - OptionProperty(std::string identifier, std::string guiName); + /** + * The constructor delegating the identifier and the guiName + * to its super class. + * \param identifier A unique identifier for this property + * \param guiName The GUI name that should be used to represent this property + */ + OptionProperty(std::string identifier, std::string guiName); - /** - * Returns the name of the class for reflection purposes. - * \return The name of this class for reflection purposes - */ - std::string className() const override; - using IntProperty::operator=; + /** + * Returns the name of the class for reflection purposes. + * \return The name of this class for reflection purposes + */ + std::string className() const override; + using IntProperty::operator=; - /** - * Adds the passed option to the list of available options. The value of - * the option must not have been registered previously, or a warning will - * be logged. - * \param value The option that will be added to the list of available options + /** + * Adds the passed option to the list of available options. The value of + * the option must not have been registered previously, or a warning will + * be logged. + * \param value The option that will be added to the list of available options * \param desc The description of the value that will be added - */ - void addOption(int value, std::string desc); + */ + void addOption(int value, std::string desc); - /** - * Returns the list of available options. - * /return The list of available options - */ - const std::vector