Merge branch 'master' of github.com:OpenSpace/OpenSpace

This commit is contained in:
Emil Axelsson
2018-11-05 21:29:45 -05:00
5 changed files with 33 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ Matthew Territo
Gene Payne
Kalle Bladin
Erik Sundén
Micah Acinapura
Jonas Strandstedt
Hans-Christian Helltegen

View File

@@ -94,6 +94,8 @@ namespace {
namespace openspace {
IswaManager* IswaManager::_instance = nullptr;
IswaManager::IswaManager()
: properties::PropertyOwner({ "IswaManager" })
, _baseUrl("https://iswa-demo-server.herokuapp.com/")
@@ -118,6 +120,27 @@ IswaManager::~IswaManager() {
_cygnetInformation.clear();
}
void IswaManager::initialize() {
ghoul_assert(!isInitialized(), "IswaManager is already initialized");
_instance = new IswaManager;
}
void IswaManager::deinitialize() {
ghoul_assert(isInitialized(), "IswaManager is not initialized");
delete _instance;
_instance = nullptr;
}
bool IswaManager::isInitialized() {
return _instance != nullptr;
}
IswaManager& IswaManager::ref() {
ghoul_assert(isInitialized(), "IswaManager is not initialized");
return *_instance;
}
void IswaManager::addIswaCygnet(int id, const std::string& type, std::string group) {
if (id > 0) {
createScreenSpace(id);

View File

@@ -26,7 +26,6 @@
#define __OPENSPACE_MODULE_ISWA___ISWAMANAGER___H__
#include <openspace/properties/propertyowner.h>
#include <ghoul/designpattern/singleton.h>
#include <openspace/engine/downloadmanager.h>
#include <ghoul/designpattern/event.h>
@@ -68,10 +67,7 @@ struct MetadataFuture {
bool isFinished;
};
class IswaManager : public ghoul::Singleton<IswaManager>, public properties::PropertyOwner
{
friend class ghoul::Singleton<IswaManager>;
class IswaManager : public properties::PropertyOwner {
public:
enum CygnetType { Texture, Data, Kameleon, NoType };
enum CygnetGeometry { Plane, Sphere };
@@ -79,6 +75,11 @@ public:
IswaManager();
~IswaManager();
static void initialize();
static void deinitialize();
static bool isInitialized();
static IswaManager& ref();
void addIswaCygnet(int id, const std::string& type = "Texture",
std::string group = "");
void addKameleonCdf(std::string group, int pos);
@@ -127,6 +128,8 @@ private:
ghoul::Event<> _iswaEvent;
std::string _baseUrl;
static IswaManager* _instance;
};
} //namespace openspace

View File

@@ -29,6 +29,7 @@
#include <ghoul/logging/logmanager.h>
#include <ghoul/fmt.h>
#include <ghoul/glm.h>
#include <ghoul/misc/assert.h>
#include <ghoul/misc/misc.h>
#ifdef WIN32

View File

@@ -90,7 +90,6 @@ namespace openspace {
SpiceManager* SpiceManager::_instance = nullptr;
SpiceManager::SpiceException::SpiceException(std::string msg)
: ghoul::RuntimeError(std::move(msg), "Spice")
{
@@ -207,7 +206,6 @@ SpiceManager& SpiceManager::ref() {
return *_instance;
}
SpiceManager::KernelHandle SpiceManager::loadKernel(std::string filePath) {
ghoul_assert(!filePath.empty(), "Empty file path");
ghoul_assert(