diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp index ed9fddd71c..426a4c7e91 100644 --- a/modules/base/scale/staticscale.cpp +++ b/modules/base/scale/staticscale.cpp @@ -24,27 +24,36 @@ #include +#include + namespace { const std::string KeyValue = "Scale"; } namespace openspace { +Documentation StaticScale::Documentation() { + using namespace openspace::documentation; + return { + "Static Scaling", + {{ + KeyValue, + new DoubleVerifier, + "The scaling factor by which the scenegraph node is scaled." + }} + }; +} + StaticScale::StaticScale(const ghoul::Dictionary& dictionary) : _scaleValue(1.0) { - bool hasValue = dictionary.hasKeyAndValue(KeyValue); - if (hasValue) { - _scaleValue = dictionary.value(KeyValue); - } -} + documentation::testSpecificationAndThrow(Documentation(), dictionary, "StaticScale"); -StaticScale::~StaticScale() {} + _scaleValue = dictionary.value(KeyValue); +} double StaticScale::scaleValue() const { return _scaleValue; } -void StaticScale::update(const UpdateData&) {} - -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/modules/base/scale/staticscale.h b/modules/base/scale/staticscale.h index 68f2d65c1b..67388d3147 100644 --- a/modules/base/scale/staticscale.h +++ b/modules/base/scale/staticscale.h @@ -27,15 +27,17 @@ #include +#include + namespace openspace { -class StaticScale: public Scale { +class StaticScale : public Scale { public: - StaticScale(const ghoul::Dictionary& dictionary - = ghoul::Dictionary()); - virtual ~StaticScale(); - virtual double scaleValue() const; - virtual void update(const UpdateData& data) override; + StaticScale(const ghoul::Dictionary& dictionary = ghoul::Dictionary()); + double scaleValue() const; + + static Documentation Documentation(); + private: double _scaleValue; };