More work on documentation

This commit is contained in:
Alexander Bock
2017-07-25 18:06:55 -04:00
parent e93070504b
commit d95576077b
31 changed files with 1215 additions and 307 deletions
+8
View File
@@ -24,6 +24,7 @@
#include <modules/debugging/debuggingmodule.h>
#include <openspace/documentation/documentation.h>
#include <openspace/rendering/renderable.h>
#include <openspace/util/factorymanager.h>
@@ -42,4 +43,11 @@ void DebuggingModule::internalInitialize() {
fRenderable->registerClass<RenderableDebugPlane>("RenderableDebugPlane");
}
std::vector<documentation::Documentation> DebuggingModule::documentations() const {
return {
RenderableDebugPlane::Documentation()
};
}
} // namespace openspace
+2
View File
@@ -35,6 +35,8 @@ public:
DebuggingModule();
std::vector<documentation::Documentation> documentations() const override;
protected:
void internalInitialize() override;
};
@@ -70,22 +70,52 @@ namespace {
const int SeedPointSourceFile = 0;
const int SeedPointSourceTable = 1;
static const openspace::properties::Property::PropertyInfo StepSizeInfo = {
"StepSize",
"Fieldline Step Size",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo Classification = {
"Classification",
"Fieldline Classification",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo FieldlineColorInfo = {
"FieldlineColor",
"Fieldline Color",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo SeedPointSourceInfo = {
"Source",
"SeedPoint Source",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo SeedPointFileInfo = {
"SourceFile",
"SeedPoint File",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _stepSize({ "StepSize", "Fieldline Step Size", "" }, defaultFieldlineStepSize, 0.f, 10.f) // @TODO Missing documentation
, _classification({ "Classification", "Fieldline Classification", "" }, true) // @TODO Missing documentation
, _stepSize(StepSizeInfo, defaultFieldlineStepSize, 0.f, 10.f)
, _classification(Classification, true)
, _fieldlineColor(
{ "FieldlineColor", "Fieldline Color", "" }, // @TODO Missing documentation
FieldlineColorInfo,
defaultFieldlineColor,
glm::vec4(0.f),
glm::vec4(1.f)
)
, _seedPointSource({ "Source", "SeedPoint Source", "" }) // @TODO Missing documentation
, _seedPointSourceFile({ "SourceFile", "SeedPoint File", "" }) // @TODO Missing documentation
, _seedPointSource(SeedPointSourceInfo)
, _seedPointSourceFile(SeedPointFileInfo)
, _program(nullptr)
, _seedPointsAreDirty(true)
, _fieldLinesAreDirty(true)
+36 -6
View File
@@ -51,17 +51,47 @@ namespace {
const std::string GlslBoundsVsPath = "${MODULES}/toyvolume/shaders/boundsVs.glsl";
const std::string GlslBoundsFsPath = "${MODULES}/toyvolume/shaders/boundsFs.glsl";
const std::string _loggerCat = "Renderable Galaxy";
}
static const openspace::properties::Property::PropertyInfo StepSizeInfo = {
"StepSize",
"Step Size",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo PointStepSizeInfo = {
"PointStepSize",
"Point Step Size",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo TranslationInfo = {
"Translation",
"Translation",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo RotationInfo = {
"Rotation",
"Euler rotation",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo EnabledPointsRatioInfo = {
"NEnabledPointsRatio",
"Enabled points",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _stepSize({ "StepSize", "Step Size", "" }, 0.012, 0.0005, 0.05) // @TODO Missing documentation
, _pointStepSize({ "PointStepSize", "Point Step Size", "" }, 0.01, 0.01, 0.1) // @TODO Missing documentation
, _translation({ "Translation", "Translation", "" }, glm::vec3(0.0, 0.0, 0.0), glm::vec3(0.0), glm::vec3(10.0)) // @TODO Missing documentation
, _rotation({ "Rotation", "Euler rotation", "" }, glm::vec3(0.0, 0.0, 0.0), glm::vec3(0), glm::vec3(6.28)) // @TODO Missing documentation
, _enabledPointsRatio({ "NEnabledPointsRatio", "Enabled points", "" }, 0.2, 0, 1) // @TODO Missing documentation
, _stepSize(StepSizeInfo, 0.012f, 0.0005f, 0.05f)
, _pointStepSize(PointStepSizeInfo, 0.01f, 0.01f, 0.1f)
, _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f))
, _rotation(RotationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(6.28f))
, _enabledPointsRatio(EnabledPointsRatioInfo, 0.2f, 0.f, 1.f)
{
float stepSize;
glm::vec3 scaling, translation, rotation;
+16 -8
View File
@@ -33,19 +33,27 @@
#include <ghoul/opengl/programobject.h>
namespace {
static const openspace::properties::Property::PropertyInfo IntensityClampInfo = {
"IntensityClamp",
"Intensity clamp",
""
};
static const openspace::properties::Property::PropertyInfo LightIntensityInfo = {
"LightIntensity",
"Light intensity",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace::globebrowsing {
PointGlobe::PointGlobe(const RenderableGlobe& owner)
: Renderable({ { "Name", owner.name() } })
, _owner(owner)
, _intensityClamp(
{ "IntensityClamp", "Intensity clamp", ""}, // @TODO Missing documentation
1, 0, 1
)
, _lightIntensity(
{ "LightIntensity", "Light intensity", ""}, // @TODO Missing documentation
1, 0, 50
)
, _intensityClamp(IntensityClampInfo, 1.f, 0.f, 1.f)
, _lightIntensity(LightIntensityInfo, 1.f, 0.f, 50.f)
{
addProperty(_intensityClamp);
addProperty(_lightIntensity);
+133 -19
View File
@@ -34,6 +34,120 @@ namespace {
const char* keyRadii = "Radii";
const char* keySegmentsPerPatch = "SegmentsPerPatch";
const char* keyLayers = "Layers";
static const openspace::properties::Property::PropertyInfo SaveOrThrowInfo = {
"SaveOrThrowCamera",
"Save or throw camera",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo ShowChunkEdgeInfo = {
"ShowChunkEdges",
"Show chunk edges",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo ShowChunkBoundsInfo = {
"ShowChunkBounds",
"Show chunk bounds",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo ShowChunkAABBInfo = {
"ShowChunkAABB",
"Show chunk AABB",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo HeightResolutionInfo = {
"ShowHeightResolution",
"Show height resolution",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo HeightIntensityInfo = {
"ShowHeightIntensities",
"Show height intensities",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo FrustumCullingInfo = {
"PerformFrustumCulling",
"Perform frustum culling",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo HorizonCullingInfo = {
"PerformHorizonCulling",
"Perform horizon culling",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo LevelProjectedAreaInfo = {
"LevelByProjectedAreaElseDistance",
"Level by projected area (else distance)",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo ResetTileProviderInfo = {
"ResetTileProviders",
"Reset tile providers",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo CollectStatsInfo = {
"CollectStats",
"Collect stats",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo LimitLevelInfo = {
"LimitLevelByAvailableData",
"Limit level by available data",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo ModelSpaceRenderingInfo = {
"ModelSpaceRenderingCutoffLevel",
"Model Space Rendering Cutoff Level",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo PerformShadingInfo = {
"PerformShading",
"Perform shading",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo AtmosphereInfo = {
"Atmosphere",
"Atmosphere",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo AccurateNormalsInfo = {
"UseAccurateNormals",
"Use Accurate Normals",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo LodScaleFactorInfo = {
"LodScaleFactor",
"Level of Detail Scale Factor",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo CameraMinHeightInfo = {
"CameraMinHeight",
"Camera Minimum Height",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo OrenNayarRoughnessInfo = {
"OrenNayarRoughness",
"orenNayarRoughness",
"" // @TODO Missing documentation
};
} // namespace
using namespace openspace::properties;
@@ -43,27 +157,27 @@ namespace openspace::globebrowsing {
RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _debugProperties({
BoolProperty({ "SaveOrThrowCamera", "save or throw camera", "" }, false), // @TODO Missing documentation
BoolProperty({ "ShowChunkEdges", "show chunk edges", "" }, false), // @TODO Missing documentation
BoolProperty({ "ShowChunkBounds", "show chunk bounds", "" }, false), // @TODO Missing documentation
BoolProperty({ "ShowChunkAABB", "show chunk AABB", "" }, false), // @TODO Missing documentation
BoolProperty({ "ShowHeightResolution", "show height resolution", "" }, false), // @TODO Missing documentation
BoolProperty({ "ShowHeightIntensities", "show height intensities", "" }, false), // @TODO Missing documentation
BoolProperty({ "PerformFrustumCulling", "perform frustum culling", "" }, true), // @TODO Missing documentation
BoolProperty({ "PerformHorizonCulling", "perform horizon culling", "" }, true), // @TODO Missing documentation
BoolProperty({ "LevelByProjectedAreaElseDistance", "level by projected area (else distance)", "" }, true), // @TODO Missing documentation
BoolProperty({ "ResetTileProviders", "reset tile providers", "" }, false), // @TODO Missing documentation
BoolProperty({ "CollectStats", "collect stats", "" }, false), // @TODO Missing documentation
BoolProperty({ "LimitLevelByAvailableData", "Limit level by available data", "" }, true), // @TODO Missing documentation
IntProperty({ "ModelSpaceRenderingCutoffLevel", "Model Space Rendering Cutoff Level", "" }, 10, 1, 22) // @TODO Missing documentation
BoolProperty(SaveOrThrowInfo, false),
BoolProperty(ShowChunkEdgeInfo, false),
BoolProperty(ShowChunkBoundsInfo, false),
BoolProperty(ShowChunkAABBInfo, false),
BoolProperty(HeightResolutionInfo, false),
BoolProperty(HeightIntensityInfo, false),
BoolProperty(FrustumCullingInfo, true),
BoolProperty(HorizonCullingInfo, true),
BoolProperty(LevelProjectedAreaInfo, true),
BoolProperty(ResetTileProviderInfo, false),
BoolProperty(CollectStatsInfo, false),
BoolProperty(LimitLevelInfo, true),
IntProperty(ModelSpaceRenderingInfo, 10, 1, 22)
})
, _generalProperties({
BoolProperty({ "PerformShading", "perform shading", "" }, true), // @TODO Missing documentation
BoolProperty({ "Atmosphere", "atmosphere", "" }, false), // @TODO Missing documentation
BoolProperty({ "UseAccurateNormals", "useAccurateNormals", "" }, false), // @TODO Missing documentation
FloatProperty({ "LodScaleFactor", "lodScaleFactor", "" }, 10.0f, 1.0f, 50.0f), // @TODO Missing documentation
FloatProperty({ "CameraMinHeight", "cameraMinHeight", "" }, 100.0f, 0.0f, 1000.0f), // @TODO Missing documentation
FloatProperty({ "OrenNayarRoughness", "orenNayarRoughness", "" }, 0.0f, 0.0f, 1.0f) // @TODO Missing documentation
BoolProperty(PerformShadingInfo, true),
BoolProperty(AtmosphereInfo, false),
BoolProperty(AccurateNormalsInfo, false),
FloatProperty(LodScaleFactorInfo, 10.f, 1.f, 50.f),
FloatProperty(CameraMinHeightInfo, 100.f, 0.f, 1000.f),
FloatProperty(OrenNayarRoughnessInfo, 0.f, 0.f, 1.f)
})
, _debugPropertyOwner("Debug")
{
@@ -35,10 +35,6 @@ void GPULayerRenderSettings::setValue(ghoul::opengl::ProgramObject* programObjec
gpuGamma.setValue(programObject, layerSettings.gamma.value());
gpuMultiplier.setValue(programObject, layerSettings.multiplier.value());
gpuOffset.setValue(programObject, layerSettings.offset.value());
if (layerSettings.useValueBlending) {
gpuValueBlending.setValue(programObject, layerSettings.valueBlending.value());
}
}
void GPULayerRenderSettings::bind(const LayerRenderSettings& layerSettings,
@@ -49,10 +45,6 @@ void GPULayerRenderSettings::bind(const LayerRenderSettings& layerSettings,
gpuGamma.bind(programObject, nameBase + "gamma");
gpuMultiplier.bind(programObject, nameBase + "multiplier");
gpuOffset.bind(programObject, nameBase + "offset");
if (layerSettings.useValueBlending) {
gpuValueBlending.bind(programObject, nameBase + "valueBlending");
}
}
} // namespace openspace::globebrowsing
@@ -76,22 +76,23 @@ LayerRenderSettings::LayerRenderSettings()
, gamma(GammaInfo, 1.f, 0.f, 5.f)
, multiplier(MultiplierInfo, 1.f, 0.f, 20.f)
, offset(OffsetInfo, 0.f, -10000.f, 10000.f)
, valueBlending(properties::FloatProperty({ "ValueBlending", "Value Blending", "" }, // @TODO Missing documentation
1.f, 0.f, 1.f))
, useValueBlending(false)
{
// Implicitly added properties (other ones are not for all layer types)
addProperty(opacity);
addProperty(gamma);
addProperty(multiplier);
addProperty(offset);
addProperty(setDefault);
setDefault.onChange([this](){ setDefaultValues(); });
setDefault.onChange([this](){
opacity = 1.f;
gamma = 1.f;
multiplier = 1.f;
offset = 0.f;
});
}
void LayerRenderSettings::setValuesFromDictionary(
const ghoul::Dictionary& renderSettingsDict)
const ghoul::Dictionary& renderSettingsDict)
{
float dictOpacity;
float dictGamma;
@@ -99,22 +100,18 @@ void LayerRenderSettings::setValuesFromDictionary(
float dictOffset;
float dictValueBlending;
if(renderSettingsDict.getValue(keyOpacity, dictOpacity)) {
if (renderSettingsDict.getValue(keyOpacity, dictOpacity)) {
opacity = dictOpacity;
}
if(renderSettingsDict.getValue(keyGamma, dictGamma)) {
if (renderSettingsDict.getValue(keyGamma, dictGamma)) {
gamma = dictGamma;
}
if(renderSettingsDict.getValue(keyMultiplier, dictMultiplier)) {
if (renderSettingsDict.getValue(keyMultiplier, dictMultiplier)) {
multiplier = dictMultiplier;
}
if(renderSettingsDict.getValue(keyOffset, dictOffset)) {
if (renderSettingsDict.getValue(keyOffset, dictOffset)) {
multiplier = dictOffset;
}
if(renderSettingsDict.getValue(keyValueBlending, dictValueBlending)) {
valueBlending = dictValueBlending;
useValueBlending = true;
}
}
float LayerRenderSettings::performLayerSettings(float currentValue) const {
@@ -138,12 +135,4 @@ glm::vec4 LayerRenderSettings::performLayerSettings(glm::vec4 currentValue) cons
return newValue;
}
void LayerRenderSettings::setDefaultValues() {
opacity = 1.f;
gamma = 1.f;
multiplier = 1.f;
offset = 0.f;
valueBlending = 1.f;
}
} // namespace openspace::globebrowsing
@@ -42,10 +42,6 @@ struct LayerRenderSettings : public properties::PropertyOwner {
properties::FloatProperty multiplier;
properties::FloatProperty offset;
// Optional properties
properties::FloatProperty valueBlending;
bool useValueBlending = false;
void setValuesFromDictionary(const ghoul::Dictionary& renderSettingsDict);
/// This function matches the function with the same name in the
@@ -54,9 +50,6 @@ struct LayerRenderSettings : public properties::PropertyOwner {
/// This function matches the function with the same name in the
/// shader code
glm::vec4 performLayerSettings(glm::vec4 currentValue) const;
private:
void setDefaultValues();
};
} // namespace openspace::globebrowsing
@@ -42,6 +42,13 @@ namespace {
const char* KeyBasePath = "BasePath";
const char* KeyPreCacheStartTime = "PreCacheStartTime";
const char* KeyPreCacheEndTime = "PreCacheEndTime";
static const openspace::properties::Property::PropertyInfo FilePathInfo = {
"FilePath",
"File Path",
"This is the path to the XML configuration file that describes the temporal tile "
"information."
};
} // namespace
namespace openspace::globebrowsing::tileprovider {
@@ -56,7 +63,7 @@ const char* TemporalTileProvider::TemporalXMLTags::TIME_FORMAT = "OpenSpaceTimeI
TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary)
: _initDict(dictionary)
, _filePath({ "FilePath", "File Path", "" }, "") // @TODO Missing documentation
, _filePath(FilePathInfo)
, _successfulInitialization(false)
{
std::string filePath;
+50 -7
View File
@@ -34,6 +34,49 @@
namespace {
const char* _loggerCat = "DataCygnet";
static const openspace::properties::Property::PropertyInfo DataOptionsInfo = {
"DataOptions",
"Data Options",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo UseLogInfo = {
"UseLog",
"Use Logarithm",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo UseHistogramInfo = {
"UseHistogram",
"Auto Contrast",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo AutoFilterInfo = {
"AutoFilter",
"Auto Filter",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo NormalizeValuesInfo = {
"NormValues",
"Normalize Values",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo BackgroundInfo = {
"BackgroundValues",
"Background Values",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo TransferFunctionsFile = {
"Transferfunctions",
"Transfer Functions",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
@@ -41,13 +84,13 @@ namespace openspace {
DataCygnet::DataCygnet(const ghoul::Dictionary& dictionary)
: IswaCygnet(dictionary)
, _dataProcessor(nullptr)
, _dataOptions({ "DataOptions", "Data Options", "" }) // @TODO Missing documentation
, _useLog({ "UseLog","Use Logarithm", "" }, false) // @TODO Missing documentation
, _useHistogram({ "UseHistogram", "Auto Contrast", "" }, false) // @TODO Missing documentation
, _autoFilter({ "AutoFilter", "Auto Filter", "" }, true) // @TODO Missing documentation
, _normValues({ "NormValues", "Normalize Values", "" }, glm::vec2(1.0, 1.0), glm::vec2(0), glm::vec2(5.0)) // @TODO Missing documentation
, _backgroundValues({ "BackgroundValues", "Background Values", "" }, glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0)) // @TODO Missing documentation
, _transferFunctionsFile({ "Transferfunctions", "Transfer Functions", "" }, "${SCENE}/iswa/tfs/default.tf") // @TODO Missing documentation
, _dataOptions(DataOptionsInfo)
, _useLog(UseLogInfo, false)
, _useHistogram(UseHistogramInfo, false)
, _autoFilter(AutoFilterInfo, true)
, _normValues(NormalizeValuesInfo, glm::vec2(1.f), glm::vec2(0.f), glm::vec2(5.f))
, _backgroundValues(BackgroundInfo, glm::vec2(0.f), glm::vec2(0.f), glm::vec2(1.f))
, _transferFunctionsFile(TransferFunctionsFile, "${SCENE}/iswa/tfs/default.tf")
//FOR TESTING
, _numOfBenchmarks(0)
, _avgBenchmarkTime(0.0f)
+23 -4
View File
@@ -38,15 +38,34 @@
namespace {
const char* _loggerCat = "IswaBaseGroup";
using json = nlohmann::json;
static const openspace::properties::Property::PropertyInfo EnabledInfo = {
"Enabled",
"Enabled",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo AlphaInfo = {
"Alpha",
"Alpha",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo DeleteInfo = {
"Delete",
"Delete",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
IswaBaseGroup::IswaBaseGroup(std::string name, std::string type)
: properties::PropertyOwner(std::move(name))
, _enabled({ "Enabled", "Enabled", "" }, true) // @TODO Missing documentation
, _alpha({ "Alpha", "Alpha", "" }, 0.9f, 0.0f, 1.0f) // @TODO Missing documentation
, _delete({ "Delete", "Delete", "" }) // @TODO Missing documentation
, _enabled(EnabledInfo, true)
, _alpha(AlphaInfo, 0.9f, 0.f, 1.f)
, _delete(DeleteInfo)
, _registered(false)
, _type(type)
, _dataProcessor(nullptr)
@@ -55,7 +74,7 @@ IswaBaseGroup::IswaBaseGroup(std::string name, std::string type)
addProperty(_alpha);
addProperty(_delete);
_groupEvent = std::make_shared<ghoul::Event<ghoul::Dictionary> >();
_groupEvent = std::make_shared<ghoul::Event<ghoul::Dictionary>>();
registerProperties();
}
+13 -2
View File
@@ -35,14 +35,25 @@
namespace {
const char* _loggerCat = "IswaCygnet";
static const openspace::properties::Property::PropertyInfo DeleteInfo = {
"Delete",
"Delete",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo AlphaInfo = {
"Alpha",
"Alpha",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
IswaCygnet::IswaCygnet(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _delete({ "Delete", "Delete", "" }) // @TODO Missing documentation
, _alpha({ "Alpha", "Alpha", "" }, 0.9f, 0.0f, 1.0f) // @TODO Missing documentation
, _delete(DeleteInfo)
, _alpha(AlphaInfo, 0.9f, 0.f, 1.f)
, _shader(nullptr)
, _group(nullptr)
, _textureDirty(false)
+50 -7
View File
@@ -38,18 +38,61 @@
namespace {
const char* _loggerCat = "IswaDataGroup";
using json = nlohmann::json;
static const openspace::properties::Property::PropertyInfo UseLogInfo = {
"UseLog",
"Use Logarithm",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo UseHistogramInfo = {
"UseHistogram",
"Auto Contrast",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo AutoFilterInfo = {
"AutoFilter",
"Auto Filter",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo NormalizeValues = {
"NormValues",
"Normalize Values",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo BackgroundInfo = {
"BackgroundValues",
"Background Values",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo TransferFunctionInfo = {
"Transferfunctions",
"Transfer Functions",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo DataOptionsInfo = {
"DataOptions",
"Data Options",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace{
IswaDataGroup::IswaDataGroup(std::string name, std::string type)
: IswaBaseGroup(name, type)
, _useLog({ "UseLog","Use Logarithm", "" }, false) // @TODO Missing documentation
, _useHistogram({ "UseHistogram", "Auto Contrast", "" }, false) // @TODO Missing documentation
, _autoFilter({ "AutoFilter", "Auto Filter", "" }, true) // @TODO Missing documentation
, _normValues({ "NormValues", "Normalize Values", "" }, glm::vec2(1.0, 1.0), glm::vec2(0), glm::vec2(5.0)) // @TODO Missing documentation
, _backgroundValues({ "BackgroundValues", "Background Values", "" }, glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0)) // @TODO Missing documentation
, _transferFunctionsFile({ "Transferfunctions", "Transfer Functions", "" }, "${SCENE}/iswa/tfs/default.tf") // @TODO Missing documentation
, _dataOptions({ "DataOptions", "Data Options", "" }) // @TODO Missing documentation
, _useLog(UseLogInfo, false)
, _useHistogram(UseHistogramInfo, false)
, _autoFilter(AutoFilterInfo, true)
, _normValues(NormalizeValues, glm::vec2(1.f), glm::vec2(0.f), glm::vec2(5.f))
, _backgroundValues(BackgroundInfo, glm::vec2(0.f), glm::vec2(0.f), glm::vec2(1.f))
, _transferFunctionsFile(TransferFunctionInfo, "${SCENE}/iswa/tfs/default.tf")
, _dataOptions(DataOptionsInfo)
{
addProperty(_useLog);
addProperty(_useHistogram);
+15 -2
View File
@@ -38,13 +38,26 @@
namespace {
const char* _loggerCat = "IswaDataGroup";
using json = nlohmann::json;
static const openspace::properties::Property::PropertyInfo ResolutionInfo = {
"Resolution",
"Resolution%",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo FieldlineSeedInfo = {
"FieldlineSeedsIndexFile",
"Fieldline Seedpoints",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace{
IswaKameleonGroup::IswaKameleonGroup(std::string name, std::string type)
: IswaDataGroup(name, type)
, _resolution({ "Resolution", "Resolution%", "" }, 100.0f, 10.0f, 200.0f) // @TODO Missing documentation
, _fieldlines({ "FieldlineSeedsIndexFile", "Fieldline Seedpoints", "" }) // @TODO Missing documentation
, _resolution(ResolutionInfo, 100.f, 10.f, 200.f)
, _fieldlines(FieldlineSeedInfo)
, _fieldlineIndexFile("")
, _kameleonPath("")
{
+21 -3
View File
@@ -33,15 +33,33 @@
namespace {
using json = nlohmann::json;
const char* _loggerCat = "KameleonPlane";
static const openspace::properties::Property::PropertyInfo FieldLineSeedsInfo = {
"FieldlineSeedsIndexFile",
"Fieldline Seedpoints",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo ResolutionInfo = {
"Resolution",
"Resolution%",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo SliceInfo = {
"Slice",
"Slice",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
: DataCygnet(dictionary)
, _fieldlines({ "FieldlineSeedsIndexFile", "Fieldline Seedpoints", "" }) // @TODO Missing documentation
, _resolution({ "Resolution", "Resolution%", "" }, 100.0f, 10.0f, 200.0f) // @TODO Missing documentation
, _slice({ "Slice", "Slice", "" }, 0.0, 0.0, 1.0) // @TODO Missing documentation
, _fieldlines(FieldLineSeedsInfo)
, _resolution(ResolutionInfo, 100.f, 10.f, 200.f)
, _slice(SliceInfo, 0.f, 0.f, 1.f)
{
addProperty(_resolution);
addProperty(_slice);
@@ -58,30 +58,102 @@ namespace {
const char* KeyCache = "Cache";
const char* KeyGridType = "GridType";
const char* ValueSphericalGridType = "Spherical";
static const openspace::properties::Property::PropertyInfo DimensionsInfo = {
"Dimensions",
"Dimensions",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo VariableInfo = {
"Variable",
"Variable",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo LowerDomainBoundInfo = {
"LowerDomainBound",
"Lower Domain Bound",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo UpperDomainBoundInfo = {
"UpperDomainBound",
"Upper Domain Bound",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo DomainScaleInfo = {
"DomainScale",
"Domain scale",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo LowerValueBoundInfo = {
"LowerValueBound",
"Lower Value Bound",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo UpperValueBoundInfo = {
"UpperValueBound",
"Upper Value Bound",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo GridTypeInfo = {
"GridType",
"Grid Type",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo StepSizeInfo = {
"StepSize",
"Step Size",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo SourcePathInfo = {
"SourcePath",
"Source Path",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo TransferFunctionInfo = {
"TransferFunctionPath",
"Transfer Function Path",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo CacheInfo = {
"Cache",
"Cache",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _dimensions({ "Dimensions", "Dimensions", "" }) // @TODO Missing documentation
, _variable({ "Variable", "Variable", "" }) // @TODO Missing documentation
, _lowerDomainBound({ "LowerDomainBound", "Lower Domain Bound", "" }) // @TODO Missing documentation
, _upperDomainBound({ "UpperDomainBound", "Upper Domain Bound", "" }) // @TODO Missing documentation
, _domainScale({ "DomainScale", "Domain scale", "" }) // @TODO Missing documentation
, _dimensions(DimensionsInfo)
, _variable(VariableInfo)
, _lowerDomainBound(LowerDomainBoundInfo)
, _upperDomainBound(UpperDomainBoundInfo)
, _domainScale(DomainScaleInfo)
, _autoDomainBounds(false)
, _lowerValueBound({ "LowerValueBound", "Lower Value Bound", "" }, 0.f, 0.f, 1.f) // @TODO Missing documentation
, _upperValueBound({ "UpperValueBound", "Upper Value Bound", "" }, 1.f, 0.01f, 1.f) // @TODO Missing documentation
, _lowerValueBound(LowerValueBoundInfo, 0.f, 0.f, 1.f)
, _upperValueBound(UpperValueBoundInfo, 1.f, 0.01f, 1.f)
, _autoValueBounds(false)
, _gridType({ "GridType", "Grid Type", "" }, properties::OptionProperty::DisplayType::Dropdown) // @TODO Missing documentation
, _gridType(GridTypeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _autoGridType(false)
, _clipPlanes(nullptr)
, _stepSize({ "StepSize", "Step Size", "" }, 0.02f, 0.01f, 1.f) // @TODO Missing documentation
, _sourcePath({ "SourcePath", "Source Path", "" }) // @TODO Missing documentation
, _transferFunctionPath({ "TransferFunctionPath", "Transfer Function Path", "" }) // @TODO Missing documentation
, _stepSize(StepSizeInfo, 0.02f, 0.01f, 1.f)
, _sourcePath(SourcePathInfo)
, _transferFunctionPath(TransferFunctionInfo)
, _raycaster(nullptr)
, _transferFunction(nullptr)
, _cache({ "Cache", "Cache", "" }) // @TODO Missing documentation
, _cache(CacheInfo)
{
glm::vec3 dimensions;
@@ -80,6 +80,85 @@ namespace {
const char* GlslHelperPath = "${MODULES}/multiresvolume/shaders/helper.glsl";
const char* GlslHeaderPath = "${MODULES}/multiresvolume/shaders/header.glsl";
bool registeredGlslHelpers = false;
static const openspace::properties::Property::PropertyInfo StepSizeCoefficientInfo = {
"StepSizeCoefficient",
"Stepsize Coefficient",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo CurrentTimeInfo = {
"CurrentTime",
"Current Time",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo MemoryBudgetInfo = {
"MemoryBudget",
"Memory Budget",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo StreamingBudgetInfo = {
"StreamingBudget",
"Streaming Budget",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo UseGlobalTimeInfo = {
"UseGlobalTime",
"Global Time",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo LoopInfo = {
"Loop",
"Loop",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo SelectorNameInfo = {
"Selector",
"Brick Selector",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo StatsToFileInfo = {
"PrintStats",
"Print Stats",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo StatsToFileNameInfo = {
"PrintStatsFileName",
"Stats Filename",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo ScalingExponentInfo = {
"ScalingExponent",
"Scaling Exponent",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo ScalingInfo = {
"Scaling",
"Scaling",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo TranslationInfo = {
"Translation",
"Translation",
"" // @TODO Missing documentation
};
static const openspace::properties::Property::PropertyInfo RotationInfo = {
"Rotation",
"Euler rotation",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
@@ -95,20 +174,20 @@ RenderableMultiresVolume::RenderableMultiresVolume (const ghoul::Dictionary& dic
, _errorHistogramManager(nullptr)
, _histogramManager(nullptr)
, _localErrorHistogramManager(nullptr)
, _stepSizeCoefficient({ "StepSizeCoefficient", "Stepsize Coefficient", "" }, 1.f, 0.01f, 10.f) // @TODO Missing documentation
, _currentTime({ "CurrentTime", "Current Time", "" }, 0, 0, 0) // @TODO Missing documentation
, _memoryBudget({ "MemoryBudget", "Memory Budget", "" }, 0, 0, 0) // @TODO Missing documentation
, _streamingBudget({ "StreamingBudget", "Streaming Budget", "" }, 0, 0, 0) // @TODO Missing documentation
, _useGlobalTime({ "UseGlobalTime", "Global Time", "" }, false) // @TODO Missing documentation
, _loop({ "Loop", "Loop", "" }, false) // @TODO Missing documentation
, _selectorName({ "Selector", "Brick Selector", "" }) // @TODO Missing documentation
, _stepSizeCoefficient(StepSizeCoefficientInfo, 1.f, 0.01f, 10.f)
, _currentTime(CurrentTimeInfo, 0, 0, 0)
, _memoryBudget(MemoryBudgetInfo, 0, 0, 0)
, _streamingBudget(StreamingBudgetInfo, 0, 0, 0)
, _useGlobalTime(UseGlobalTimeInfo, false)
, _loop(LoopInfo, false)
, _selectorName(SelectorNameInfo)
, _gatheringStats(false)
, _statsToFile({ "PrintStats", "Print Stats", "" }, false) // @TODO Missing documentation
, _statsToFileName({ "PrintStatsFileName", "Stats Filename", "" }) // @TODO Missing documentation
, _scalingExponent({ "ScalingExponent", "Scaling Exponent", "" }, 1, -10, 20) // @TODO Missing documentation
, _scaling({ "Scaling", "Scaling", "" }, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(10.f)) // @TODO Missing documentation
, _translation({ "Translation", "Translation", "" }, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f)) // @TODO Missing documentation
, _rotation({ "Rotation", "Euler rotation", "" }, glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(6.28f)) // @TODO Missing documentation
, _statsToFile(StatsToFileInfo, false)
, _statsToFileName(StatsToFileNameInfo)
, _scalingExponent(ScalingExponentInfo, 1, -10, 20)
, _scaling(ScalingInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(10.f))
, _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f))
, _rotation(RotationInfo, glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(6.28f))
{
std::string name;
//bool success = dictionary.getValue(constants::scenegraphnode::keyName, name);
@@ -349,9 +428,24 @@ bool RenderableMultiresVolume::initialize() {
unsigned int maxInitialBudget = 2048;
int initialBudget = std::min(maxInitialBudget, maxNumBricks);
_currentTime = properties::IntProperty({ "currentTime", "Current Time", "" }, 0, 0, _tsp->header().numTimesteps_ - 1); // @TODO Missing documentation
_memoryBudget = properties::IntProperty({ "memoryBudget", "Memory Budget", "" }, initialBudget, 0, maxNumBricks); // @TODO Missing documentation
_streamingBudget = properties::IntProperty({ "streamingBudget", "Streaming Budget", "" }, initialBudget, 0, maxNumBricks); // @TODO Missing documentation
_currentTime = properties::IntProperty(
CurrentTimeInfo,
0,
0,
_tsp->header().numTimesteps_ - 1
);
_memoryBudget = properties::IntProperty(
MemoryBudgetInfo,
initialBudget,
0,
maxNumBricks
);
_streamingBudget = properties::IntProperty(
StreamingBudgetInfo,
initialBudget,
0,
maxNumBricks
);
addProperty(_currentTime);
addProperty(_memoryBudget);
addProperty(_streamingBudget);
+62 -28
View File
@@ -75,6 +75,61 @@ namespace {
"value of smaller than 1, the field of view will hover of ther surface, thus "
"making it more visible."
};
static const openspace::properties::Property::PropertyInfo DefaultStartColorInfo = {
"Colors.DefaultStart",
"Start of default color",
"This value determines the color of the field of view frustum close to the "
"instrument. The final colors are interpolated between this value and the end "
"color."
};
static const openspace::properties::Property::PropertyInfo DefaultEndColorInfo = {
"Colors.DefaultEnd",
"End of default color",
"This value determines the color of the field of view frustum close to the "
"target. The final colors are interpolated between this value and the start "
"color."
};
static const openspace::properties::Property::PropertyInfo ActiveColorInfo = {
"Colors.Active",
"Active Color",
"This value determines the color that is used when the instrument's field of "
"view is active."
};
static const openspace::properties::Property::PropertyInfo TargetInFovInfo = {
"Colors.TargetInFieldOfView",
"Target in field-of-view Color",
"This value determines the color that is used if the target is inside the field "
"of view of the instrument but the instrument is not yet active."
};
static const openspace::properties::Property::PropertyInfo IntersectionStartInfo = {
"Colors.IntersectionStart",
"Start of the intersection",
"This value determines the color that is used close to the instrument if one of "
"the field of view corners is intersecting the target object. The final color is "
"retrieved by interpolating between this color and the intersection end color."
};
static const openspace::properties::Property::PropertyInfo IntersectionEndInfo = {
"Colors.IntersectionEnd",
"End of the intersection",
"This value determines the color that is used close to the target if one of the "
"field of view corners is intersecting the target object. The final color is "
"retrieved by interpolating between this color and the intersection begin color."
};
static const openspace::properties::Property::PropertyInfo SquareColorInfo = {
"Colors.Square",
"Orthogonal Square",
"This value determines the color that is used for the field of view square in "
"the case that there is no intersection and that the instrument is not currently "
"active."
};
} // namespace
namespace openspace {
@@ -171,34 +226,13 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
, _programObject(nullptr)
, _drawFOV(false)
, _colors({
{
{ "Colors.DefaultStart", "Start of default color", "" }, // @TODO Missing documentation
glm::vec4(0.4f)
},
{
{ "Colors.DefaultEnd", "End of default color", "" }, // @TODO Missing documentation
glm::vec4(0.85f, 0.85f, 0.85f, 1.f)
},
{
{ "Colors.Active", "Active Color", "" }, // @TODO Missing documentation
glm::vec4(0.f, 1.f, 0.f, 1.f)
},
{
{ "Colors.TargetInFieldOfView", "Target-in-field-of-view Color", "" }, // @TODO Missing documentation
glm::vec4(0.f, 0.5f, 0.7f, 1.f)
},
{
{ "Colors.IntersectionStart", "Start of the intersection", "" }, // @TODO Missing documentation
glm::vec4(1.f, 0.89f, 0.f, 1.f)
},
{
{ "Colors.IntersectionEnd", "End of the intersection", "" }, // @TODO Missing documentation
glm::vec4(1.f, 0.29f, 0.f, 1.f)
},
{
{ "Colors.Square", "Orthogonal Square", "" }, // @TODO Missing documentation
glm::vec4(0.85f, 0.85f, 0.85f, 1.f)
}
{ DefaultStartColorInfo, glm::vec4(0.4f) },
{ DefaultEndColorInfo, glm::vec4(0.85f, 0.85f, 0.85f, 1.f) },
{ ActiveColorInfo, glm::vec4(0.f, 1.f, 0.f, 1.f) },
{ TargetInFovInfo, glm::vec4(0.f, 0.5f, 0.7f, 1.f) },
{ IntersectionStartInfo, glm::vec4(1.f, 0.89f, 0.f, 1.f) },
{ IntersectionEndInfo, glm::vec4(1.f, 0.29f, 0.f, 1.f) },
{ SquareColorInfo, glm::vec4(0.85f, 0.85f, 0.85f, 1.f) }
})
{
documentation::testSpecificationAndThrow(
@@ -53,6 +53,21 @@ namespace {
const char* keyTextureColor = "Textures.Color";
const char* _destination = "GALACTIC";
static const openspace::properties::Property::PropertyInfo ColorTextureInfo = {
"ColorTexture",
"Color Base Texture",
"This is the path to a local image file that is used as the base texture for "
"the model on which the image projections are layered."
};
static const openspace::properties::Property::PropertyInfo PerformShadingInfo = {
"PerformShading",
"Perform Shading",
"If this value is enabled, the model will be shaded based on the relative "
"location to the Sun. If this value is disabled, shading is disabled and the "
"entire model is rendered brightly."
};
} // namespace
namespace openspace {
@@ -83,12 +98,17 @@ documentation::Documentation RenderableModelProjection::Documentation() {
Optional::No
},
{
keyTextureColor,
keyTextureColor, // @TODO Change to ColorTextureInfo.identifier
new StringVerifier,
"The base texture for the model that is shown before any projection "
"occurred.",
ColorTextureInfo.description,
Optional::No
},
{
PerformShadingInfo.identifier,
new BoolVerifier,
PerformShadingInfo.description,
Optional::Yes
},
{
keyBoundingSphereRadius,
new DoubleVerifier,
@@ -104,13 +124,13 @@ documentation::Documentation RenderableModelProjection::Documentation() {
RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _colorTexturePath({ "ColorTexture", "Color Texture", "" }) // @TODO Missing documentation
, _rotation({ "Rotation", "Rotation", "" }, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(360.f)) // @TODO Missing documentation
, _colorTexturePath(ColorTextureInfo)
, _rotation({ "Rotation", "Rotation", "" }, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(360.f)) // @TODO Remove this property
, _programObject(nullptr)
, _fboProgramObject(nullptr)
, _baseTexture(nullptr)
, _geometry(nullptr)
, _performShading({ "PerformShading", "Perform Shading", "" }, true) // @TODO Missing documentation
, _performShading(PerformShadingInfo, true)
{
documentation::testSpecificationAndThrow(
Documentation(),
@@ -146,6 +166,10 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di
dictionary.getValue(keyBoundingSphereRadius, boundingSphereRadius);
setBoundingSphere(boundingSphereRadius);
if (dictionary.hasKey(PerformShadingInfo.identifier)) {
_performShading = dictionary.value<bool>(PerformShadingInfo.identifier);
}
Renderable::addProperty(_performShading);
Renderable::addProperty(_rotation);
}
@@ -63,6 +63,34 @@ namespace {
const char* keyRadius = "Geometry.Radius";
// const char* keyShading = "PerformShading";
const char* _mainFrame = "GALACTIC";
static const openspace::properties::Property::PropertyInfo ColorTextureInfo = {
"PlanetTexture",
"Color Base Texture",
"The path to the base color texture that is used on the planet prior to any "
"image projection."
};
static const openspace::properties::Property::PropertyInfo HeightTextureInfo = {
"HeightMap",
"Heightmap Texture",
"The path to the height map texture that is used for the planet. If no height "
"map is specified the planet does not use a height field."
};
static const openspace::properties::Property::PropertyInfo ShiftMeridianInfo = {
"ShiftMeridian",
"Shift Meridian by 180 deg",
"Shift the position of the meridian by 180 degrees. This value "
};
static const openspace::properties::Property::PropertyInfo HeightExaggerationInfo = {
"HeightExaggeration",
"Height Exaggeration",
"This value determines the level of height exaggeration that is applied to a "
"potential height field. A value of '0' inhibits the height field, whereas a "
"value of '1' uses the measured height field."
};
} // namespace
namespace openspace {
@@ -99,20 +127,21 @@ documentation::Documentation RenderablePlanetProjection::Documentation() {
Optional::Yes
},
{
keyColorTexture,
keyColorTexture, // @TODO This should be ColorTextureInfo.identifier
new StringVerifier,
"The path to the base color texture that is used on the planet prior to "
"any image projection. The path can use tokens of the form '${...}' or "
"be specified relative to the directory of the mod file.",
ColorTextureInfo.description,
Optional::No
},
{
keyHeightTexture,
keyHeightTexture, // @TODO This should be HeightTextureInfo.identifier
new StringVerifier,
"The path to the height map texture that is used on the planet. The path "
"can use tokens of the form '${...}' or be specified relative to the "
"directory of the mod file. If no height map is specified the planet "
"does not use a height field.",
HeightTextureInfo.description,
Optional::Yes
},
{
HeightExaggerationInfo.identifier,
new DoubleVerifier,
HeightExaggerationInfo.description,
Optional::Yes
}
}
@@ -121,16 +150,15 @@ documentation::Documentation RenderablePlanetProjection::Documentation() {
RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _colorTexturePath({ "PlanetTexture", "RGB Texture", "" }) // @TODO Missing documentation
, _heightMapTexturePath({ "HeightMap", "Heightmap Texture", "" }) // @TODO Missing documentation
, _colorTexturePath(ColorTextureInfo)
, _heightMapTexturePath(HeightTextureInfo)
, _rotation({ "Rotation", "Rotation", "" }, 0, 0, 360) // @TODO Missing documentation
, _programObject(nullptr)
, _fboProgramObject(nullptr)
, _baseTexture(nullptr)
, _heightMapTexture(nullptr)
, _shiftMeridianBy180({ "ShiftMeiridian", "Shift Meridian by 180 deg", "" }, false) // @TODO Missing documentation
, _heightExaggeration({ "HeightExaggeration", "Height Exaggeration", "" }, 1.f, 0.f, 100.f) // @TODO Missing documentation
, _debugProjectionTextureRotation({ "Debug.ProjectionTextureRotation", "Projection Texture Rotation", "" }, 0.f, 0.f, 360.f) // @TODO Missing documentation
, _shiftMeridianBy180({"asd", "", "" }, false) // @TODO Missing documentation
, _heightExaggeration(HeightExaggerationInfo, 1.f, 0.f, 100.f)
, _capture(false)
{
documentation::testSpecificationAndThrow(
@@ -187,8 +215,13 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
addProperty(_heightMapTexturePath);
_heightMapTexturePath.onChange(std::bind(&RenderablePlanetProjection::loadTextures, this));
if (dictionary.hasKey(HeightExaggerationInfo.identifier)) {
_heightExaggeration = static_cast<float>(
dictionary.value<double>(HeightExaggerationInfo.identifier)
);
}
addProperty(_heightExaggeration);
addProperty(_debugProjectionTextureRotation);
addProperty(_shiftMeridianBy180);
}
@@ -78,7 +78,6 @@ private:
properties::BoolProperty _shiftMeridianBy180;
properties::FloatProperty _heightExaggeration;
properties::FloatProperty _debugProjectionTextureRotation;
std::unique_ptr<planetgeometry::PlanetGeometry> _geometry;
@@ -24,6 +24,7 @@
#include <modules/newhorizons/rendering/renderableshadowcylinder.h>
#include <openspace/documentation/verifier.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/util/powerscaledcoordinate.h>
@@ -33,39 +34,234 @@
#include <ghoul/opengl/programobject.h>
namespace {
const char* KeyType = "TerminatorType";
const char* KeyLightSource = "LightSource";
const char* KeyObserver = "Observer";
const char* KeyBody = "Body";
const char* KeyBodyFrame = "BodyFrame";
const char* KeyMainFrame = "MainFrame";
const char* KeyAberration = "Aberration";
static const openspace::properties::Property::PropertyInfo NumberPointsInfo = {
"AmountOfPoints",
"Points",
"This value determines the number of control points that is used to construct "
"the shadow geometry. The higher this number, the more detailed the shadow is, "
"but it will have a negative impact on the performance."
};
static const openspace::properties::Property::PropertyInfo ShadowLengthInfo = {
"ShadowLength",
"Shadow Length",
"This value determines the length of the shadow that is cast by the target "
"object. The total distance of the shadow is equal to the distance from the "
"target to the Sun multiplied with this value."
};
static const openspace::properties::Property::PropertyInfo ShadowColorInfo = {
"ShadowColor",
"Shadow Color",
"This value determines the color that is used for the shadow cylinder."
};
static const openspace::properties::Property::PropertyInfo TerminatorTypeInfo = {
"TerminatorType",
"Terminator Type",
"This value determines the type of the terminator that is used to calculate the "
"shadow eclipse."
};
static const openspace::properties::Property::PropertyInfo LightSourceInfo = {
"LightSource",
"Light Source",
"This value determines the SPICE name of the object that is used as the "
"illuminator for computing the shadow cylinder."
};
static const openspace::properties::Property::PropertyInfo ObserverInfo = {
"Observer",
"Observer",
"This value specifies the SPICE name of the object that is the observer of the "
"shadow cylinder."
};
static const openspace::properties::Property::PropertyInfo BodyInfo = {
"Body",
"Target Body",
"This value is the SPICE name of target body that is used as the shadow caster "
"for the shadow cylinder."
};
static const openspace::properties::Property::PropertyInfo BodyFrameInfo = {
"BodyFrame",
"Body Frame",
"This value is the SPICE name of the reference frame in which the shadow "
"cylinder is expressed."
};
static const openspace::properties::Property::PropertyInfo AberrationInfo = {
"Aberration",
"Aberration",
"This value determines the aberration method that is used to compute the shadow "
"cylinder."
};
} // namespace
namespace openspace {
documentation::Documentation RenderableShadowCylinder::Documentation() {
using namespace documentation;
return {
"RenderableShadowCylinder",
"newhorizons_renderable_shadowcylinder",
{
{
"Type",
new StringEqualVerifier("RenderableShadowCylinder"),
"",
Optional::No
},
{
NumberPointsInfo.identifier,
new IntVerifier,
NumberPointsInfo.description,
Optional::Yes
},
{
ShadowLengthInfo.identifier,
new DoubleVerifier,
ShadowLengthInfo.description,
Optional::Yes
},
{
ShadowColorInfo.identifier,
new DoubleVector4Verifier,
ShadowColorInfo.description,
Optional::Yes
},
{
TerminatorTypeInfo.identifier,
new StringInListVerifier({
// Synchronized with SpiceManager::terminatorTypeFromString
"UMBRAL", "PENUMBRAL"
}),
TerminatorTypeInfo.description,
Optional::No
},
{
LightSourceInfo.identifier,
new StringVerifier,
LightSourceInfo.description,
Optional::No
},
{
ObserverInfo.identifier,
new StringVerifier,
ObserverInfo.description,
Optional::No
},
{
BodyInfo.identifier,
new StringVerifier,
BodyInfo.description,
Optional::No
},
{
BodyFrameInfo.identifier,
new StringVerifier,
BodyFrameInfo.description,
Optional::No
},
{
AberrationInfo.identifier,
new StringInListVerifier({
// SpiceManager::AberrationCorrection::AberrationCorrection
"NONE", "LT", "LT+S", "CN", "CN+S"
}),
AberrationInfo.description,
Optional::No
},
},
Exhaustive::Yes
};
}
RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _numberOfPoints({ "AmountOfPoints", "Points", "" }, 190, 1, 300) // @TODO Missing documentation
, _shadowLength({ "ShadowLength", "Shadow Length", "" }, 0.1f, 0.0f, 0.5f) // @TODO Missing documentation
, _shadowColor({ "ShadowColor", "Shadow Color", "" }, // @TODO Missing documentation
glm::vec4(1.f, 1.f, 1.f, 0.25f), glm::vec4(0.f), glm::vec4(1.f))
, _numberOfPoints(NumberPointsInfo, 190, 1, 300)
, _shadowLength(ShadowLengthInfo, 0.1f, 0.f, 0.5f)
, _shadowColor(
ShadowColorInfo,
glm::vec4(1.f, 1.f, 1.f, 0.25f),
glm::vec4(0.f), glm::vec4(1.f)
)
, _terminatorType(
TerminatorTypeInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, _lightSource(LightSourceInfo)
, _observer(ObserverInfo)
, _body(BodyInfo)
, _bodyFrame(BodyFrameInfo)
, _mainFrame({"mainFrame", "Main Frame", ""}) // @TODO Remove this
, _aberration(AberrationInfo)
, _shader(nullptr)
, _vao(0)
, _vbo(0)
{
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
"RenderableShadowCylinder"
);
if (dictionary.hasKey(NumberPointsInfo.identifier)) {
_numberOfPoints = static_cast<int>(
dictionary.value<double>(NumberPointsInfo.identifier)
);
}
addProperty(_numberOfPoints);
if (dictionary.hasKey(ShadowLengthInfo.identifier)) {
_shadowLength = static_cast<float>(
dictionary.value<double>(ShadowLengthInfo.identifier)
);
}
addProperty(_shadowLength);
if (dictionary.hasKey(ShadowColorInfo.identifier)) {
_shadowColor = dictionary.value<glm::vec4>(ShadowLengthInfo.identifier);
}
_shadowColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_shadowColor);
_terminatorType = dictionary.value<std::string>(KeyType);
_lightSource = dictionary.value<std::string>(KeyLightSource);
_observer = dictionary.value<std::string>(KeyObserver);
_body = dictionary.value<std::string>(KeyBody);
_bodyFrame = dictionary.value<std::string>(KeyBodyFrame);
_terminatorType.addOptions({
{ static_cast<int>(SpiceManager::TerminatorType::Umbral), "Umbral" },
{ static_cast<int>(SpiceManager::TerminatorType::Penumbral), "Penumbral" }
});
_terminatorType = static_cast<int>(SpiceManager::terminatorTypeFromString(
dictionary.value<std::string>(TerminatorTypeInfo.identifier)
));
addProperty(_terminatorType);
_lightSource = dictionary.value<std::string>(LightSourceInfo.identifier);
_observer = dictionary.value<std::string>(ObserverInfo.identifier);
_body = dictionary.value<std::string>(BodyInfo.identifier);
_bodyFrame = dictionary.value<std::string>(BodyFrameInfo.identifier);
_mainFrame = dictionary.value<std::string>(KeyMainFrame);
_aberration = SpiceManager::AberrationCorrection(dictionary.value<std::string>(KeyAberration));
using T = SpiceManager::AberrationCorrection::Type;
_aberration.addOptions({
{ static_cast<int>(T::None), "None" },
{ static_cast<int>(T::ConvergedNewtonian), "Converged Newtonian" },
{ static_cast<int>(T::ConvergedNewtonianStellar), "Converged Newtonian Stellar" },
{ static_cast<int>(T::LightTime), "Light Time" },
{ static_cast<int>(T::LightTimeStellar), "Light Time Stellar" },
});
SpiceManager::AberrationCorrection aberration = SpiceManager::AberrationCorrection(
dictionary.value<std::string>(AberrationInfo.identifier)
);
_aberration = static_cast<int>(aberration.type);
}
bool RenderableShadowCylinder::initialize() {
@@ -79,10 +275,6 @@ bool RenderableShadowCylinder::initialize() {
"${MODULE_NEWHORIZONS}/shaders/terminatorshadow_fs.glsl"
);
if (!_shader)
return false;
return true;
}
@@ -136,7 +328,11 @@ void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) {
}
void RenderableShadowCylinder::update(const UpdateData& data) {
_stateMatrix = SpiceManager::ref().positionTransformMatrix(_bodyFrame, _mainFrame, data.time.j2000Seconds());
_stateMatrix = SpiceManager::ref().positionTransformMatrix(
_bodyFrame,
_mainFrame,
data.time.j2000Seconds()
);
if (_shader->isDirty()) {
_shader->rebuildFromFile();
}
@@ -162,8 +358,11 @@ void RenderableShadowCylinder::createCylinder(double time) {
_observer,
_bodyFrame,
_lightSource,
SpiceManager::terminatorTypeFromString(_terminatorType),
_aberration,
static_cast<SpiceManager::TerminatorType>(_terminatorType.value()),
{
SpiceManager::AberrationCorrection::Type(_aberration.value()),
SpiceManager::AberrationCorrection::Direction::Reception
},
time,
_numberOfPoints
);
@@ -181,8 +380,17 @@ void RenderableShadowCylinder::createCylinder(double time) {
);
double lt;
glm::dvec3 vecLightSource =
SpiceManager::ref().targetPosition(_body, _lightSource, _mainFrame, _aberration, time, lt);
glm::dvec3 vecLightSource = SpiceManager::ref().targetPosition(
_body,
_lightSource,
_mainFrame,
{
SpiceManager::AberrationCorrection::Type(_aberration.value()),
SpiceManager::AberrationCorrection::Direction::Reception
},
time,
lt
);
vecLightSource = glm::inverse(_stateMatrix) * vecLightSource;
@@ -27,6 +27,8 @@
#include <openspace/rendering/renderable.h>
#include <openspace/properties/optionproperty.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec4property.h>
@@ -37,6 +39,8 @@
namespace ghoul::opengl { class ProgramObject; }
namespace documentation { struct Documentation; }
namespace openspace {
struct RenderData;
@@ -53,15 +57,26 @@ public:
void render(const RenderData& data, RendererTasks& rendererTask) override;
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
private:
struct CylinderVBOLayout {
float x, y, z, e;
};
void createCylinder(double time);
properties::IntProperty _numberOfPoints;
properties::FloatProperty _shadowLength;
properties::Vec4Property _shadowColor;
properties::OptionProperty _terminatorType;
properties::StringProperty _lightSource;
properties::StringProperty _observer;
properties::StringProperty _body;
properties::StringProperty _bodyFrame;
properties::StringProperty _mainFrame;
properties::OptionProperty _aberration;
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
@@ -71,14 +86,7 @@ private:
GLuint _vbo;
std::vector<CylinderVBOLayout> _vertices;
std::string _terminatorType;
std::string _lightSource;
std::string _observer;
std::string _body;
std::string _bodyFrame;
std::string _mainFrame;
SpiceManager::AberrationCorrection _aberration;
// SpiceManager::AberrationCorrection
};
} // namespace openspace
@@ -210,7 +210,7 @@ ProjectionComponent::ProjectionComponent()
, _clearAllProjections(ClearProjectionInfo, false)
, _projectionFading(FadingInfo, 1.f, 0.f, 1.f)
, _textureSize(TextureSizeInfo, ivec2(16), ivec2(16), ivec2(32768))
, _applyTextureSize(ApplyTextureSizeInfo) // @TODO Missing documentation
, _applyTextureSize(ApplyTextureSizeInfo)
, _textureSizeDirty(false)
, _projectionTexture(nullptr)
{
+9 -1
View File
@@ -24,11 +24,19 @@
#include <modules/onscreengui/include/guicomponent.h>
namespace {
static const openspace::properties::Property::PropertyInfo EnabledInfo = {
"Enabled",
"Is Enabled",
"This setting determines whether this object will be visible or not."
};
} // namespace
namespace openspace::gui {
GuiComponent::GuiComponent(std::string name)
: properties::PropertyOwner(std::move(name))
, _isEnabled({ "Enabled", "Is Enabled", "" }, false) // @TODO Missing documentation
, _isEnabled(EnabledInfo, false)
{
addProperty(_isEnabled);
}
@@ -49,16 +49,43 @@ namespace {
Render = 4,
Total = 5
};
static const openspace::properties::Property::PropertyInfo SortingSelectionInfo = {
"SortingSelection",
"Sorting",
"This value determines the sorting order of the performance measurements."
};
static const openspace::properties::Property::PropertyInfo SceneGraphEnabledInfo = {
"ShowSceneGraph",
"Show Scene Graph Measurements",
"If this value is enabled, the window showing the measurements for the scene "
"graph values is visible."
};
static const openspace::properties::Property::PropertyInfo FunctionsEnabledInfo = {
"ShowFunctions",
"Show Function Measurements",
"If this value is enabled, the window showing the measurements for the "
"individual functions is visible."
};
static const openspace::properties::Property::PropertyInfo OutputLogsInfo = {
"OutputLogs",
"Output Logs",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace::gui {
GuiPerformanceComponent::GuiPerformanceComponent()
: GuiComponent("PerformanceComponent")
, _sortingSelection({ "SortingSelection", "Sorting", "" }, -1, -1, 6) // @TODO Missing documentation
, _sceneGraphIsEnabled({ "ShowSceneGraph", "Show Scene Graph Measurements", "" }, false) // @TODO Missing documentation
, _functionsIsEnabled({ "ShowFunctions", "Show Function Measurements", "" }, false) // @TODO Missing documentation
, _outputLogs({ "OutputLogs", "Output Logs", "" }, false) // @TODO Missing documentation
, _sortingSelection(SortingSelectionInfo, -1, -1, 6)
, _sceneGraphIsEnabled(SceneGraphEnabledInfo, false)
, _functionsIsEnabled(FunctionsEnabledInfo, false)
, _outputLogs(OutputLogsInfo, false)
{
addProperty(_sortingSelection);
@@ -41,11 +41,8 @@
#include "SpiceZpr.h"
namespace {
const char* KeyVertexFile = "File";
const char* KeyConstellationFile = "ConstellationFile";
const char* KeyReferenceFrame = "ReferenceFrame";
const char* DefaultReferenceFrame = "J2000";
float deg2rad(float deg) {
@@ -55,6 +52,35 @@ namespace {
// 360 degrees / 24h = 15 degrees/h
return deg2rad(rightAscension * 15);
}
static const openspace::properties::Property::PropertyInfo VertexInfo = {
"File",
"Vertex File Path",
"The file pointed to with this value contains the vertex locations of the "
"constellations."
};
static const openspace::properties::Property::PropertyInfo ConstellationInfo = {
"ConstellationFile",
"Constellation File Path",
"Specifies the file that contains the mapping between constellation "
"abbreviations and full name of the constellation. If this value is empty, the "
"abbreviations are used as the full names."
};
static const openspace::properties::Property::PropertyInfo DistanceInfo = {
"Distance",
"Distance to the celestial sphere",
"This value specifies the value to the celestial sphere in kilometers at which "
"the constellations are projected."
};
static const openspace::properties::Property::PropertyInfo SelectionInfo = {
"ConstellationSelection",
"Constellation Selection",
"The constellations that are selected are displayed on the celestial sphere."
};
} // namespace
namespace openspace {
@@ -66,19 +92,30 @@ documentation::Documentation RenderableConstellationBounds::Documentation() {
"space_renderable_constellationbounds",
{
{
KeyVertexFile,
VertexInfo.identifier,
new StringVerifier,
"Specifies the file containing the bounds information about the "
"constellation locations.",
VertexInfo.description,
Optional::No
},
{
KeyConstellationFile,
ConstellationInfo.identifier,
new StringVerifier,
"Specifies the file that contains the mapping between constellation "
"abbreviations and full name of the constellation. If the file is "
"omitted, the abbreviations are used as the full names.",
Optional::Yes
},
{
DistanceInfo.identifier,
new DoubleVerifier,
DistanceInfo.description,
Optional::Yes
},
{
SelectionInfo.identifier,
new StringListVerifier,
SelectionInfo.description,
Optional::Yes
}
}
};
@@ -88,10 +125,10 @@ documentation::Documentation RenderableConstellationBounds::Documentation() {
RenderableConstellationBounds::RenderableConstellationBounds(
const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _vertexFilename("")
, _constellationFilename("")
, _distance({ "Distance", "Distance to the celestial Sphere", "" }, 15.f, 0.f, 30.f) // @TODO Missing documentation
, _constellationSelection({ "ConstellationSelection", "Constellation Selection", "" }) // @TODO Missing documentation
, _vertexFilename(VertexInfo)
, _constellationFilename(ConstellationInfo)
, _distance(DistanceInfo, 15.f, 0.f, 30.f)
, _constellationSelection(SelectionInfo)
, _vao(0)
, _vbo(0)
{
@@ -101,13 +138,26 @@ RenderableConstellationBounds::RenderableConstellationBounds(
"RenderableConstellationBounds"
);
_vertexFilename = dictionary.value<std::string>(KeyVertexFile);
_vertexFilename.onChange([&](){
loadVertexFile();
});
addProperty(_vertexFilename);
_vertexFilename = dictionary.value<std::string>(VertexInfo.identifier);
if (dictionary.hasKey(KeyConstellationFile)) {
_constellationFilename = dictionary.value<std::string>(KeyConstellationFile);
_constellationFilename.onChange([&](){
loadConstellationFile();
});
addProperty(_constellationFilename);
if (dictionary.hasKey(ConstellationInfo.identifier)) {
_constellationFilename = dictionary.value<std::string>(ConstellationInfo.identifier);
}
if (dictionary.hasKey(DistanceInfo.identifier)) {
_distance = static_cast<float>(dictionary.value<double>(DistanceInfo.identifier));
}
addProperty(_distance);
fillSelectionProperty();
addProperty(_constellationSelection);
_constellationSelection.onChange(
[this]() { selectionPropertyHasChanged(); }
@@ -115,20 +165,12 @@ RenderableConstellationBounds::RenderableConstellationBounds(
}
bool RenderableConstellationBounds::initialize() {
_program = OsEng.renderEngine().buildRenderProgram("ConstellationBounds",
_program = OsEng.renderEngine().buildRenderProgram(
"ConstellationBounds",
"${MODULE_SPACE}/shaders/constellationbounds_vs.glsl",
"${MODULE_SPACE}/shaders/constellationbounds_fs.glsl");
"${MODULE_SPACE}/shaders/constellationbounds_fs.glsl"
);
bool loadSuccess = loadVertexFile();
if (!loadSuccess) {
return false;
}
loadSuccess = loadConstellationFile();
if (!loadSuccess) {
return false;
}
fillSelectionProperty();
glGenVertexArrays(1, &_vao);
glBindVertexArray(_vao);
@@ -199,7 +241,7 @@ void RenderableConstellationBounds::render(const RenderData& data, RendererTasks
}
bool RenderableConstellationBounds::loadVertexFile() {
if (_vertexFilename.empty()) {
if (_vertexFilename.value().empty()) {
return false;
}
@@ -292,7 +334,7 @@ bool RenderableConstellationBounds::loadVertexFile() {
}
bool RenderableConstellationBounds::loadConstellationFile() {
if (_constellationFilename.empty()) {
if (_constellationFilename.value().empty()) {
return true;
}
@@ -29,6 +29,7 @@
#include <openspace/properties/scalarproperty.h>
#include <openspace/properties/selectionproperty.h>
#include <openspace/properties/stringproperty.h>
#include <ghoul/opengl/programobject.h>
#include <array>
@@ -93,8 +94,11 @@ private:
*/
void selectionPropertyHasChanged();
std::string _vertexFilename; ///< The filename containing the constellation bounds
std::string _constellationFilename; ///< The file containing constellation names
/// The filename containing the constellation bounds
properties::StringProperty _vertexFilename;
/// The file containing constellation names
properties::StringProperty _constellationFilename;
std::unique_ptr<ghoul::opengl::ProgramObject> _program;
+93 -58
View File
@@ -34,15 +34,6 @@
#include <math.h>
namespace {
const char* KeyEccentricity = "Eccentricity";
const char* KeySemiMajorAxis = "SemiMajorAxis";
const char* KeyInclination = "Inclination";
const char* KeyAscendingNode = "AscendingNode";
const char* KeyArgumentOfPeriapsis = "ArgumentOfPeriapsis";
const char* KeyMeanAnomaly = "MeanAnomaly";
const char* KeyEpoch = "Epoch";
const char* KeyPeriod = "Period";
template <typename T, typename Func>
T solveIteration(Func function, T x0, const T& err = 0.0, int maxIterations = 100) {
@@ -59,6 +50,67 @@ T solveIteration(Func function, T x0, const T& err = 0.0, int maxIterations = 10
return x2;
}
static const openspace::properties::Property::PropertyInfo EccentricityInfo = {
"Eccentricity",
"Eccentricity",
"This value determines the eccentricity, that is the deviation from a perfect "
"sphere, for this orbit. Currently, hyperbolic orbits using Keplerian elements "
"are not supported."
};
static const openspace::properties::Property::PropertyInfo SemiMajorAxisInfo = {
"SemiMajorAxis",
"Semi-major axis",
"This value determines the semi-major axis, that is the distance of the object "
"from the central body in kilometers (semi-major axis = average of periapsis and "
"apoapsis)."
};
static const openspace::properties::Property::PropertyInfo InclinationInfo = {
"Inclination",
"Inclination",
"This value determines the degrees of inclination, or the angle of the orbital "
"plane, relative to the reference plane, on which the object orbits around the "
"central body."
};
static const openspace::properties::Property::PropertyInfo AscendingNodeInfo = {
"AscendingNode",
"Right ascension of ascending Node",
"This value determines the right ascension of the ascending node in degrees, "
"that is the location of position along the orbit where the inclined plane and "
"the horizonal reference plane intersect."
};
static const openspace::properties::Property::PropertyInfo ArgumentOfPeriapsisInfo = {
"ArgumentOfPeriapsis",
"Argument of Periapsis",
"This value determines the argument of periapsis in degrees, that is the "
"position on the orbit that is closest to the orbiting body."
};
static const openspace::properties::Property::PropertyInfo MeanAnomalyAtEpochInfo = {
"MeanAnomaly",
"Mean anomaly at epoch",
"This value determines the mean anomaly at the epoch in degrees, which "
"determines the initial location of the object along the orbit at epoch."
};
static const openspace::properties::Property::PropertyInfo EpochInfo = {
"Epoch",
"Epoch",
"This value determines the epoch for which the initial location is defined in "
"the form of YYYY MM DD HH:mm:ss."
};
static const openspace::properties::Property::PropertyInfo PeriodInfo = {
"Period",
"Orbit period",
"Specifies the orbital period (in seconds)."
};
} // namespace
namespace openspace {
@@ -81,58 +133,51 @@ documentation::Documentation KeplerTranslation::Documentation() {
Optional::No
},
{
KeyEccentricity,
EccentricityInfo.identifier,
new DoubleInRangeVerifier(0.0, 1.0),
"Specifies the eccentricity of the orbit; currently, OpenSpace does not "
"support hyperbolic orbits using Keplerian elements.",
EccentricityInfo.description,
Optional::No
},
{
KeySemiMajorAxis,
SemiMajorAxisInfo.identifier,
new DoubleVerifier,
"Specifies the semi-major axis of the orbit in kilometers (semi-major "
"axis = average of periapsis and apoapsis).",
SemiMajorAxisInfo.description,
Optional::No
},
{
KeyInclination,
InclinationInfo.identifier,
new DoubleInRangeVerifier(0.0, 360.0),
"Specifies the inclination angle (degrees) of the orbit relative to the "
"reference plane (in the case of Earth, the equatorial plane.",
InclinationInfo.description,
Optional::No
},
{
KeyAscendingNode,
AscendingNodeInfo.identifier,
new DoubleInRangeVerifier(0.0, 360.0),
"Specifies the right ascension of the ascending node (in degrees!) "
"relative to the vernal equinox.",
AscendingNodeInfo.description,
Optional::No
},
{
KeyArgumentOfPeriapsis,
ArgumentOfPeriapsisInfo.identifier,
new DoubleInRangeVerifier(0.0, 360.0),
"Specifies the argument of periapsis as angle (in degrees) from the "
"ascending.",
ArgumentOfPeriapsisInfo.description,
Optional::No
},
{
KeyMeanAnomaly,
MeanAnomalyAtEpochInfo.identifier,
new DoubleInRangeVerifier(0.0, 360.0),
"Specifies the position of the orbiting body (in degrees) along the "
"elliptical orbit at epoch time.",
MeanAnomalyAtEpochInfo.description,
Optional::No
},
{
KeyEpoch,
EpochInfo.identifier,
new StringVerifier,
"Specifies the epoch time used for position as a string of the form: "
"YYYY MM DD HH:mm:ss",
EpochInfo.description,
Optional::No
},
{
KeyPeriod,
PeriodInfo.identifier,
new DoubleGreaterVerifier(0.0),
"Specifies the orbital period (in seconds).",
PeriodInfo.description,
Optional::No
},
},
@@ -142,24 +187,14 @@ documentation::Documentation KeplerTranslation::Documentation() {
KeplerTranslation::KeplerTranslation()
: Translation()
, _eccentricity({ "Eccentricity", "Eccentricity", "" }, 0.0, 0.0, 1.0) // @TODO Missing documentation
, _semiMajorAxis({ "SemimajorAxis", "Semi-major axis", "" }, 0.0, 0.0, 1e6) // @TODO Missing documentation
, _inclination({ "Inclination", "Inclination", "" }, 0.0, 0.0, 360.0) // @TODO Missing documentation
, _ascendingNode(
{ "AscendingNode", "Right ascension of ascending Node", "" }, // @TODO Missing documentation
0.0,
0.0,
360.0
)
, _argumentOfPeriapsis(
{ "ArgumentOfPeriapsis", "Argument of Periapsis", "" }, // @TODO Missing documentation
0.0,
0.0,
360.0
)
, _meanAnomalyAtEpoch({ "MeanAnomalyAtEpoch", "Mean anomaly at epoch", "" }, 0.0, 0.0, 360.0) // @TODO Missing documentation
, _epoch({ "Epoch", "Epoch", "" }, 0.0, 0.0, 1e9) // @TODO Missing documentation
, _period({ "Period", "Orbit period", "" }, 0.0, 0.0, 1e6) // @TODO Missing documentation
, _eccentricity(EccentricityInfo, 0.0, 0.0, 1.0)
, _semiMajorAxis(SemiMajorAxisInfo, 0.0, 0.0, 1e6)
, _inclination(InclinationInfo, 0.0, 0.0, 360.0)
, _ascendingNode(AscendingNodeInfo, 0.0, 0.0, 360.0)
, _argumentOfPeriapsis(ArgumentOfPeriapsisInfo, 0.0, 0.0, 360.0)
, _meanAnomalyAtEpoch(MeanAnomalyAtEpochInfo, 0.0, 0.0, 360.0)
, _epoch(EpochInfo, 0.0, 0.0, 1e9)
, _period(PeriodInfo, 0.0, 0.0, 1e6)
, _orbitPlaneDirty(true)
{
auto update = [this]() {
@@ -199,14 +234,14 @@ KeplerTranslation::KeplerTranslation(const ghoul::Dictionary& dictionary)
);
setKeplerElements(
dictionary.value<double>(KeyEccentricity),
dictionary.value<double>(KeySemiMajorAxis),
dictionary.value<double>(KeyInclination),
dictionary.value<double>(KeyAscendingNode),
dictionary.value<double>(KeyArgumentOfPeriapsis),
dictionary.value<double>(KeyMeanAnomaly),
dictionary.value<double>(KeyPeriod),
dictionary.value<std::string>(KeyEpoch)
dictionary.value<double>(EccentricityInfo.identifier),
dictionary.value<double>(SemiMajorAxisInfo.identifier),
dictionary.value<double>(InclinationInfo.identifier),
dictionary.value<double>(AscendingNodeInfo.identifier),
dictionary.value<double>(ArgumentOfPeriapsisInfo.identifier),
dictionary.value<double>(MeanAnomalyAtEpochInfo.identifier),
dictionary.value<double>(PeriodInfo.identifier),
dictionary.value<std::string>(EpochInfo.identifier)
);
}