Added documentation to more classes

This commit is contained in:
Alexander Bock
2017-07-24 17:22:19 -04:00
parent 1a475ef570
commit 20e944f86f
17 changed files with 723 additions and 352 deletions

View File

@@ -44,11 +44,45 @@
namespace {
const char* KeyTranslation = "Translation";
const char* KeyStartTime = "StartTime";
const char* KeyEndTime = "EndTime";
const char* KeySampleInterval = "SampleInterval";
const char* KeyTimeStampSubsample = "TimeStampSubsampleFactor";
const char* KeyShowFullTrail = "ShowFullTrail";
static const openspace::properties::Property::PropertyInfo StartTimeInfo = {
"StartTime",
"Start Time",
"The start time for the range of this trajectory. The date must be in ISO 8601 "
"format: YYYY MM DD HH:mm:ss.xxx."
};
static const openspace::properties::Property::PropertyInfo EndTimeInfo = {
"EndTime",
"End Time",
"The end time for the range of this trajectory. The date must be in ISO 8601 "
"format: YYYY MM DD HH:mm:ss.xxx."
};
static const openspace::properties::Property::PropertyInfo SampleIntervalInfo = {
"SampleInterval",
"Sample Interval",
"The interval between samples of the trajectory. This value (together with "
"'TimeStampSubsampleFactor') determines how far apart (in time) the samples are "
"spaced along the trajectory. The time interval between 'StartTime' and "
"'EndTime' is split into 'SampleInterval' * 'TimeStampSubsampleFactor' segments."
};
static const openspace::properties::Property::PropertyInfo TimeSubSampleInfo = {
"TimeStampSubsampleFactor",
"Time Stamp Subsampling Factor",
"The factor that is used to create subsamples along the trajectory. This value "
"(together with 'SampleInterval') determines how far apart (in time) the samples "
"are spaced along the trajectory. The time interval between 'StartTime' and "
"'EndTime' is split into 'SampleInterval' * 'TimeStampSubsampleFactor' segments."
};
static const openspace::properties::Property::PropertyInfo RenderFullPathInfo = {
"ShowFullTrail",
"Render Full Trail",
"If this value is set to 'true', the entire trail will be rendered; if it is "
"'false', only the trail until the current time in the application will be shown."
};
} // namespace
namespace openspace {
@@ -61,56 +95,39 @@ documentation::Documentation RenderableTrailTrajectory::Documentation() {
"base_renderable_renderabletrailtrajectory",
{
{
"Type",
new StringEqualVerifier("RenderableTrailTrajectory"),
"",
StartTimeInfo.identifier,
new StringAnnotationVerifier("A valid date in ISO 8601 format"),
StartTimeInfo.description,
Optional::No
},
{
KeyStartTime,
new StringAnnotationVerifier("A valid date"),
"The start time for the range of this trajectory. The date must be in "
"ISO 8601 format: YYYY MM DD HH:mm:ss.xxx",
EndTimeInfo.identifier,
new StringAnnotationVerifier("A valid date in ISO 8601 format"),
EndTimeInfo.description,
Optional::No
},
{
KeyEndTime,
new StringAnnotationVerifier("A valid date"),
"The end time for the range of this trajectory. The date must be in "
"ISO 8601 format: YYYY MM DD HH:mm:ss.xxx",
Optional::No
},
{
KeySampleInterval,
SampleIntervalInfo.identifier,
new DoubleVerifier,
"The interval between samples of the trajectory. This value (together "
"with 'TimeStampSubsampleFactor') determines how far apart (in time) the "
"samples are spaced along the trajectory. The time interval between "
"'StartTime' and 'EndTime' is split into 'SampleInterval' * "
"'TimeStampSubsampleFactor' segments.",
SampleIntervalInfo.description,
Optional::No
},
{
KeyTimeStampSubsample,
TimeSubSampleInfo.identifier,
new IntVerifier,
"The factor that is used to create subsamples along the trajectory. This "
"value (together with 'SampleInterval') determines how far apart (in "
"time) the samples are spaced along the trajectory. The time interval "
"between 'StartTime' and 'EndTime' is split into 'SampleInterval' * "
"'TimeStampSubsampleFactor' segments. The default value for this is 1",
TimeSubSampleInfo.description,
Optional::Yes
},
{
KeyShowFullTrail,
RenderFullPathInfo.identifier,
new BoolVerifier,
"If this value is set to 'true', the entire trail will be rendered; if "
"it is 'false', only the trail until the current time in the application "
"will be shown. The default value for this setting is 'false'.",
RenderFullPathInfo.description,
Optional::Yes
}
}
};
// @TODO cleanup
// Insert the parents documentation entries until we have a verifier that can deal
// with class hierarchy
documentation::Documentation parentDoc = RenderableTrail::Documentation();
@@ -125,14 +142,11 @@ documentation::Documentation RenderableTrailTrajectory::Documentation() {
RenderableTrailTrajectory::RenderableTrailTrajectory(const ghoul::Dictionary& dictionary)
: RenderableTrail(dictionary)
, _startTime({ "StartTime", "Start Time", "" }) // @TODO Missing documentation
, _endTime({ "EndTime", "End Time", "" }) // @TODO Missing documentation
, _sampleInterval({ "SampleInterval", "Sample Interval", "" }, 2.0, 2.0, 1e6) // @TODO Missing documentation
, _timeStampSubsamplingFactor(
{ "SubSample", "Time Stamp Subsampling Factor", "" }, // @TODO Missing documentation
1, 1, 1000000000
)
, _renderFullTrail({ "RenderFullTrail", "Render Full Trail", "" }, false) // @TODO Missing documentation
, _startTime(StartTimeInfo)
, _endTime(EndTimeInfo)
, _sampleInterval(SampleIntervalInfo, 2.0, 2.0, 1e6)
, _timeStampSubsamplingFactor(TimeSubSampleInfo, 1, 1, 1e9)
, _renderFullTrail(RenderFullPathInfo, false)
, _needsFullSweep(true)
, _subsamplingIsDirty(true)
{
@@ -146,28 +160,28 @@ RenderableTrailTrajectory::RenderableTrailTrajectory(const ghoul::Dictionary& di
_needsFullSweep = true;
});
_startTime = dictionary.value<std::string>(KeyStartTime);
_startTime = dictionary.value<std::string>(StartTimeInfo.identifier);
_startTime.onChange([this] { _needsFullSweep = true; });
addProperty(_startTime);
_endTime = dictionary.value<std::string>(KeyEndTime);
_endTime = dictionary.value<std::string>(EndTimeInfo.identifier);
_endTime.onChange([this] { _needsFullSweep = true; });
addProperty(_endTime);
_sampleInterval = dictionary.value<double>(KeySampleInterval);
_sampleInterval = dictionary.value<double>(SampleIntervalInfo.identifier);
_sampleInterval.onChange([this] { _needsFullSweep = true; });
addProperty(_sampleInterval);
if (dictionary.hasKeyAndValue<double>(KeyTimeStampSubsample)) {
if (dictionary.hasKeyAndValue<double>(TimeSubSampleInfo.identifier)) {
_timeStampSubsamplingFactor = static_cast<int>(
dictionary.value<double>(KeyTimeStampSubsample)
dictionary.value<double>(TimeSubSampleInfo.identifier)
);
}
_timeStampSubsamplingFactor.onChange([this] { _subsamplingIsDirty = true; });
addProperty(_timeStampSubsamplingFactor);
if (dictionary.hasKeyAndValue<bool>(KeyShowFullTrail)) {
_renderFullTrail = dictionary.value<bool>(KeyShowFullTrail);
if (dictionary.hasKeyAndValue<bool>(RenderFullPathInfo.identifier)) {
_renderFullTrail = dictionary.value<bool>(RenderFullPathInfo.identifier);
}
addProperty(_renderFullTrail);