diff --git a/include/openspace/scene/rotation.h b/include/openspace/scene/rotation.h index 140f95d9df..18d1f0a7c1 100644 --- a/include/openspace/scene/rotation.h +++ b/include/openspace/scene/rotation.h @@ -27,7 +27,7 @@ #include -#include +#include #include @@ -35,6 +35,8 @@ namespace ghoul { class Dictionary; } namespace openspace { +struct UpdateData; + namespace documentation { struct Documentation; } class Rotation : public properties::PropertyOwner { @@ -42,7 +44,7 @@ public: static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); Rotation(const ghoul::Dictionary& dictionary); - virtual ~Rotation(); + virtual ~Rotation() = default; virtual bool initialize(); const glm::dmat3& matrix() const; virtual void update(const UpdateData& data); diff --git a/include/openspace/scene/scale.h b/include/openspace/scene/scale.h index b6c0f27a1a..147fed31f1 100644 --- a/include/openspace/scene/scale.h +++ b/include/openspace/scene/scale.h @@ -27,11 +27,16 @@ #include -#include +#include + +#include namespace ghoul { class Dictionary; } + namespace openspace { +struct UpdateData; + namespace documentation { struct Documentation; }; class Scale : public properties::PropertyOwner { @@ -39,7 +44,7 @@ public: static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); Scale(); - virtual ~Scale(); + virtual ~Scale() = default; virtual bool initialize(); virtual double scaleValue() const = 0; virtual void update(const UpdateData& data); diff --git a/include/openspace/scene/translation.h b/include/openspace/scene/translation.h index 3cc355be03..21ce0515b4 100644 --- a/include/openspace/scene/translation.h +++ b/include/openspace/scene/translation.h @@ -27,14 +27,17 @@ #include -#include +#include +#include #include namespace ghoul { class Dictionary; } namespace openspace { +struct UpdateData; + namespace documentation { struct Documentation; } class Translation : public properties::PropertyOwner { @@ -42,7 +45,7 @@ public: static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); Translation(); - virtual ~Translation(); + virtual ~Translation() = default; virtual bool initialize(); virtual glm::dvec3 position() const = 0; diff --git a/src/openspace.cpp b/src/openspace.cpp index 6bfda13b32..e749cad4f7 100644 --- a/src/openspace.cpp +++ b/src/openspace.cpp @@ -29,7 +29,7 @@ namespace openspace { std::string licenseText() { return "OpenSpace\n\ \n\ -Copyright (c) 2014-2016\n\ +Copyright (c) 2014-2017\n\ \n\ Permission is hereby granted, free of charge, to any person obtaining a copy of this\n\ software and associated documentation files (the \"Software\"), to deal in the Software\n\ diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index 413a41354e..8bfc62c6f6 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -28,13 +28,12 @@ #include #include -#include #include +#include namespace { - const char* _loggerCat = "Rotation"; const char* KeyType = "Type"; -} +} // namespace namespace openspace { @@ -64,11 +63,6 @@ std::unique_ptr Rotation::createFromDictionary(const ghoul::Dictionary std::string rotationType = dictionary.value(KeyType); auto factory = FactoryManager::ref().factory(); std::unique_ptr result = factory->create(rotationType, dictionary); - if (result == nullptr) { - LERROR("Failed creating Rotation object of type '" << rotationType << "'"); - return nullptr; - } - return result; } @@ -80,8 +74,6 @@ Rotation::Rotation(const ghoul::Dictionary& dictionary) : properties::PropertyOwner("Rotation") {} -Rotation::~Rotation() {} - bool Rotation::initialize() { return true; } diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index 868499f3b8..866aabbb1c 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -27,14 +27,14 @@ #include #include #include +#include #include #include namespace { - const char* _loggerCat = "Scale"; const char* KeyType = "Type"; -} +} // namespace namespace openspace { @@ -68,11 +68,6 @@ std::unique_ptr Scale::createFromDictionary(const ghoul::Dictionary& dict auto factory = FactoryManager::ref().factory(); std::unique_ptr result = factory->create(scaleType, dictionary); result->setName("Scale"); - if (result == nullptr) { - LERROR("Failed creating Scale object of type '" << scaleType << "'"); - return nullptr; - } - return result; } @@ -80,8 +75,6 @@ Scale::Scale() : properties::PropertyOwner("Scale") {} -Scale::~Scale() {} - bool Scale::initialize() { return true; } diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index 2272f5bb40..89b8bf1c29 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -24,16 +24,16 @@ #include +#include #include +#include + #include #include -#include - namespace { - const char* _loggerCat = "Translation"; const char* KeyType = "Type"; -} +} // namespace namespace openspace { @@ -61,10 +61,7 @@ documentation::Documentation Translation::Documentation() { std::unique_ptr Translation::createFromDictionary( const ghoul::Dictionary& dictionary) { - if (!dictionary.hasValue(KeyType)) { - LERROR("Translation did not have key '" << KeyType << "'"); - return nullptr; - } + documentation::testSpecificationAndThrow(Documentation(), dictionary, "Translation"); std::string translationType; dictionary.getValue(KeyType, translationType); @@ -72,11 +69,6 @@ std::unique_ptr Translation::createFromDictionary( = FactoryManager::ref().factory(); std::unique_ptr result = factory->create(translationType, dictionary); result->setName("Translation"); - if (result == nullptr) { - LERROR("Failed creating Translation object of type '" << translationType << "'"); - return nullptr; - } - return result; } @@ -84,8 +76,6 @@ Translation::Translation() : properties::PropertyOwner("Translation") {} -Translation::~Translation() {} - bool Translation::initialize() { return true; }