Adding documentation to StaticScale

This commit is contained in:
Alexander Bock
2016-09-15 13:47:52 +02:00
parent 43db84f620
commit 746a76e436
2 changed files with 26 additions and 15 deletions

View File

@@ -24,27 +24,36 @@
#include <modules/base/scale/staticscale.h>
#include <openspace/documentation/verifier.h>
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<double>(KeyValue);
if (hasValue) {
_scaleValue = dictionary.value<double>(KeyValue);
}
}
documentation::testSpecificationAndThrow(Documentation(), dictionary, "StaticScale");
StaticScale::~StaticScale() {}
_scaleValue = dictionary.value<double>(KeyValue);
}
double StaticScale::scaleValue() const {
return _scaleValue;
}
void StaticScale::update(const UpdateData&) {}
} // namespace openspace
} // namespace openspace

View File

@@ -27,15 +27,17 @@
#include <openspace/scene/scale.h>
#include <openspace/documentation/documentation.h>
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;
};