mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 12:10:52 -06:00
Adding documentation to StaticScale
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user