Adding more documentation

This commit is contained in:
Alexander Bock
2017-07-24 18:05:59 -04:00
parent 20e944f86f
commit e148cf28d0
2 changed files with 94 additions and 8 deletions
@@ -51,6 +51,30 @@ namespace {
const char* KeyFrameConversions = "FrameConversions";
const int InterpolationSteps = 5;
static const openspace::properties::Property::PropertyInfo LineWidthInfo = {
"LineWidth",
"Line Width",
"This value determines width of the lines connecting the instrument to the "
"corners of the field of view."
};
static const openspace::properties::Property::PropertyInfo DrawSolidInfo = {
"SolidDraw",
"Solid Draw",
"This value determines whether the field of view should be rendered as a solid "
"or as lines only."
};
static const openspace::properties::Property::PropertyInfo StandoffDistanceInfo = {
"StandOffDistance",
"Standoff Distance Factor",
"This value determines the standoff distance factor which influences the "
"distance of the plane to the focus object. If this value is '1', the field of "
"view will be rendered exactly on the surface of, for example, a planet. With a "
"value of smaller than 1, the field of view will hover of ther surface, thus "
"making it more visible."
};
} // namespace
namespace openspace {
@@ -121,6 +145,18 @@ documentation::Documentation RenderableFov::Documentation() {
"A list of frame conversions that should be registered with the "
"SpiceManager.",
Optional::Yes
},
{
LineWidthInfo.identifier,
new DoubleVerifier,
LineWidthInfo.description,
Optional::Yes
},
{
StandoffDistanceInfo.identifier,
new DoubleVerifier,
StandoffDistanceInfo.description,
Optional::Yes
}
}
};
@@ -129,9 +165,9 @@ documentation::Documentation RenderableFov::Documentation() {
RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _lineWidth({ "LineWidth", "Line Width", "" }, 1.f, 1.f, 20.f) // @TODO Missing documentation
, _drawSolid({ "SolidDraw", "Draw as Quads", "" }, false) // @TODO Missing documentation
, _standOffDistance({ "StandOffDistance", "Standoff Distance", "" }, 0.9999, 0.99, 1.0, 0.000001) // @TODO Missing documentation
, _lineWidth(LineWidthInfo, 1.f, 1.f, 20.f)
, _drawSolid(DrawSolidInfo, false)
, _standOffDistance(StandoffDistanceInfo, 0.9999, 0.99, 1.0, 0.000001)
, _programObject(nullptr)
, _drawFOV(false)
, _colors({
@@ -201,6 +237,18 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
}
}
if (dictionary.hasKey(LineWidthInfo.identifier)) {
_lineWidth = static_cast<float>(dictionary.value<double>(
LineWidthInfo.identifier
));
}
if (dictionary.hasKey(StandoffDistanceInfo.identifier)) {
_standOffDistance = static_cast<float>(dictionary.value<double>(
StandoffDistanceInfo.identifier
));
}
addProperty(_lineWidth);
addProperty(_drawSolid);
addProperty(_standOffDistance);
@@ -71,6 +71,44 @@ namespace {
"${OPENSPACE_DATA}/scene/common/textures/placeholder.png";
const char* _loggerCat = "ProjectionComponent";
static const openspace::properties::Property::PropertyInfo ProjectionInfo = {
"PerformProjection",
"Perform Projections",
"If this value is enabled, this ProjectionComponent will perform projections. If "
"it is disabled, projections will be ignored."
};
static const openspace::properties::Property::PropertyInfo ClearProjectionInfo = {
"ClearAllProjections",
"Clear Projections",
"If this property is triggered, it will remove all the projections that have "
"already been applied."
};
static const openspace::properties::Property::PropertyInfo FadingInfo = {
"ProjectionFading",
"Projection Fading",
"This value fades the previously performed projections in or out. If this value "
"is equal to '1', the projections are fully visible, if the value is equal to "
"'0', the performed projections are completely invisible."
};
static const openspace::properties::Property::PropertyInfo TextureSizeInfo = {
"TextureSize",
"Texture Size",
"This value determines the size of the texture into which the images are "
"projected and thus provides the limit to the resolution of projections that can "
"be applied. Changing this value will not cause the texture to be automatically "
"updated, but triggering the 'ApplyTextureSize' property is required."
};
static const openspace::properties::Property::PropertyInfo ApplyTextureSizeInfo = {
"ApplyTextureSize",
"Apply Texture Size",
"Triggering this property applies a new size to the underlying projection "
"texture. The old texture is resized and interpolated to fit the new size."
};
} // namespace
namespace openspace {
@@ -168,11 +206,11 @@ documentation::Documentation ProjectionComponent::Documentation() {
ProjectionComponent::ProjectionComponent()
: properties::PropertyOwner("ProjectionComponent")
, _performProjection({ "PerformProjection", "Perform Projections", "" }, true) // @TODO Missing documentation
, _clearAllProjections({ "ClearAllProjections", "Clear Projections", "" }, false) // @TODO Missing documentation
, _projectionFading({ "ProjectionFading", "Projection Fading", "" }, 1.f, 0.f, 1.f) // @TODO Missing documentation
, _textureSize({ "TextureSize", "Texture Size", "" }, ivec2(16), ivec2(16), ivec2(32768)) // @TODO Missing documentation
, _applyTextureSize({ "ApplyTextureSize", "Apply Texture Size", "" }) // @TODO Missing documentation
, _performProjection(ProjectionInfo, true)
, _clearAllProjections(ClearProjectionInfo, false)
, _projectionFading(FadingInfo, 1.f, 0.f, 1.f)
, _textureSize(TextureSizeInfo, ivec2(16), ivec2(16), ivec2(32768))
, _applyTextureSize(ApplyTextureSizeInfo) // @TODO Missing documentation
, _textureSizeDirty(false)
, _projectionTexture(nullptr)
{