mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-09 06:48:35 -05:00
Add support for converting and rendering volumetric data in the cdf format. Replace DataConverter by a more general purpose TaskRunner.
Conflicts: modules/volume/CMakeLists.txt modules/volume/linearlrucache.h src/engine/openspaceengine.cpp
This commit is contained in:
@@ -68,6 +68,8 @@ public:
|
||||
static const std::string KeyFactoryDocumentation;
|
||||
/// The key that stores the location of the scene file that is initially loaded
|
||||
static const std::string KeyConfigScene;
|
||||
/// The key that stores the location of the tasks file that is initially loaded
|
||||
static const std::string KeyConfigTask;
|
||||
/// The key that stores the subdirectory containing a list of all startup scripts to
|
||||
/// be executed on application start before the scene file is loaded
|
||||
static const std::string KeyStartupScript;
|
||||
|
||||
34
include/openspace/util/distanceconstants.h
Normal file
34
include/openspace/util/distanceconstants.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* 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. *
|
||||
****************************************************************************************/
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace distanceconstants {
|
||||
const float EarthRadius = 6371;
|
||||
const float LightYear = 9.4607304725808E15;
|
||||
const float AstronomicalUnit = 1.495978707E11;
|
||||
const float Parsec = 3.0856776E16;
|
||||
}
|
||||
|
||||
}
|
||||
23
include/openspace/util/task.h
Normal file
23
include/openspace/util/task.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef __CONVERSIONTASK_H__
|
||||
#define __CONVERSIONTASK_H__
|
||||
|
||||
#include <functional>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class Task {
|
||||
public:
|
||||
using ProgressCallback = std::function<void(float)>;
|
||||
|
||||
virtual ~Task() = default;
|
||||
virtual void perform(const ProgressCallback& onProgress) = 0;
|
||||
virtual std::string description() = 0;
|
||||
static std::unique_ptr<Task> createFromDictionary(const ghoul::Dictionary& dictionary);
|
||||
static openspace::Documentation documentation();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
17
include/openspace/util/taskloader.h
Normal file
17
include/openspace/util/taskloader.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef __TASKRUNNER_H__
|
||||
#define __TASKRUNNER_H__
|
||||
|
||||
#include <string>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <openspace/util/task.h>
|
||||
|
||||
namespace openspace {
|
||||
class TaskLoader {
|
||||
public:
|
||||
std::vector<std::unique_ptr<Task>> tasksFromDictionary(const ghoul::Dictionary& dictionary);
|
||||
std::vector<std::unique_ptr<Task>> tasksFromFile(const std::string& path);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user