diff --git a/modules/debugging/debuggingmodule.cpp b/modules/debugging/debuggingmodule.cpp index 4e89c43622..4b009b91d4 100644 --- a/modules/debugging/debuggingmodule.cpp +++ b/modules/debugging/debuggingmodule.cpp @@ -24,6 +24,7 @@ #include +#include #include #include @@ -42,4 +43,11 @@ void DebuggingModule::internalInitialize() { fRenderable->registerClass("RenderableDebugPlane"); } +std::vector DebuggingModule::documentations() const { + return { + RenderableDebugPlane::Documentation() + }; +} + + } // namespace openspace diff --git a/modules/debugging/debuggingmodule.h b/modules/debugging/debuggingmodule.h index a030471b21..525aec54a8 100644 --- a/modules/debugging/debuggingmodule.h +++ b/modules/debugging/debuggingmodule.h @@ -35,6 +35,8 @@ public: DebuggingModule(); + std::vector documentations() const override; + protected: void internalInitialize() override; }; diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index e6fb08f376..0813f76ae1 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -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) diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index f98c73b749..94b86c6671 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -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; diff --git a/modules/globebrowsing/globes/pointglobe.cpp b/modules/globebrowsing/globes/pointglobe.cpp index 04c474c306..3514648d18 100644 --- a/modules/globebrowsing/globes/pointglobe.cpp +++ b/modules/globebrowsing/globes/pointglobe.cpp @@ -33,19 +33,27 @@ #include +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); diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index e11286978d..01045b9611 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -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") { diff --git a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp index 256e08f8c7..450f6708cf 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp @@ -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 diff --git a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp index 8c8d4c7fba..37902658f5 100644 --- a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp +++ b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp @@ -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 diff --git a/modules/globebrowsing/rendering/layer/layerrendersettings.h b/modules/globebrowsing/rendering/layer/layerrendersettings.h index 3128556f1e..f46d648e5f 100644 --- a/modules/globebrowsing/rendering/layer/layerrendersettings.h +++ b/modules/globebrowsing/rendering/layer/layerrendersettings.h @@ -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 diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp index 5867c00cf5..2982fe0496 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp @@ -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; diff --git a/modules/iswa/rendering/datacygnet.cpp b/modules/iswa/rendering/datacygnet.cpp index f6ec1c6a6d..21ad6984aa 100644 --- a/modules/iswa/rendering/datacygnet.cpp +++ b/modules/iswa/rendering/datacygnet.cpp @@ -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) diff --git a/modules/iswa/rendering/iswabasegroup.cpp b/modules/iswa/rendering/iswabasegroup.cpp index b92cca6db1..db2c08d102 100644 --- a/modules/iswa/rendering/iswabasegroup.cpp +++ b/modules/iswa/rendering/iswabasegroup.cpp @@ -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 >(); + _groupEvent = std::make_shared>(); registerProperties(); } diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp index 09ec2bd9a1..4ad94a72e4 100644 --- a/modules/iswa/rendering/iswacygnet.cpp +++ b/modules/iswa/rendering/iswacygnet.cpp @@ -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) diff --git a/modules/iswa/rendering/iswadatagroup.cpp b/modules/iswa/rendering/iswadatagroup.cpp index 62578eabcb..6048b9873b 100644 --- a/modules/iswa/rendering/iswadatagroup.cpp +++ b/modules/iswa/rendering/iswadatagroup.cpp @@ -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); diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index 201a2a537f..926f7c3ca0 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -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("") { diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index 98a875716e..03d25aea2b 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -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); diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index ec0780afbb..9b0a27c389 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -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; diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index a2e48b63ab..090e5c4b70 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -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); diff --git a/modules/newhorizons/rendering/renderablefov.cpp b/modules/newhorizons/rendering/renderablefov.cpp index d53621991c..e830715a20 100644 --- a/modules/newhorizons/rendering/renderablefov.cpp +++ b/modules/newhorizons/rendering/renderablefov.cpp @@ -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( diff --git a/modules/newhorizons/rendering/renderablemodelprojection.cpp b/modules/newhorizons/rendering/renderablemodelprojection.cpp index 127042eb0a..459dc5c918 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.cpp +++ b/modules/newhorizons/rendering/renderablemodelprojection.cpp @@ -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(PerformShadingInfo.identifier); + } + Renderable::addProperty(_performShading); Renderable::addProperty(_rotation); } diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index 6726b36e28..62450baa15 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -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( + dictionary.value(HeightExaggerationInfo.identifier) + ); + } + addProperty(_heightExaggeration); - addProperty(_debugProjectionTextureRotation); addProperty(_shiftMeridianBy180); } diff --git a/modules/newhorizons/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h index 3571edb979..ee131fdcb4 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.h +++ b/modules/newhorizons/rendering/renderableplanetprojection.h @@ -78,7 +78,6 @@ private: properties::BoolProperty _shiftMeridianBy180; properties::FloatProperty _heightExaggeration; - properties::FloatProperty _debugProjectionTextureRotation; std::unique_ptr _geometry; diff --git a/modules/newhorizons/rendering/renderableshadowcylinder.cpp b/modules/newhorizons/rendering/renderableshadowcylinder.cpp index b49e14619d..60fa854b48 100644 --- a/modules/newhorizons/rendering/renderableshadowcylinder.cpp +++ b/modules/newhorizons/rendering/renderableshadowcylinder.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -33,39 +34,234 @@ #include 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( + dictionary.value(NumberPointsInfo.identifier) + ); + } addProperty(_numberOfPoints); + + + if (dictionary.hasKey(ShadowLengthInfo.identifier)) { + _shadowLength = static_cast( + dictionary.value(ShadowLengthInfo.identifier) + ); + } addProperty(_shadowLength); + + + if (dictionary.hasKey(ShadowColorInfo.identifier)) { + _shadowColor = dictionary.value(ShadowLengthInfo.identifier); + } + _shadowColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_shadowColor); - _terminatorType = dictionary.value(KeyType); - _lightSource = dictionary.value(KeyLightSource); - _observer = dictionary.value(KeyObserver); - _body = dictionary.value(KeyBody); - _bodyFrame = dictionary.value(KeyBodyFrame); + + _terminatorType.addOptions({ + { static_cast(SpiceManager::TerminatorType::Umbral), "Umbral" }, + { static_cast(SpiceManager::TerminatorType::Penumbral), "Penumbral" } + }); + _terminatorType = static_cast(SpiceManager::terminatorTypeFromString( + dictionary.value(TerminatorTypeInfo.identifier) + )); + addProperty(_terminatorType); + + + _lightSource = dictionary.value(LightSourceInfo.identifier); + _observer = dictionary.value(ObserverInfo.identifier); + _body = dictionary.value(BodyInfo.identifier); + _bodyFrame = dictionary.value(BodyFrameInfo.identifier); _mainFrame = dictionary.value(KeyMainFrame); - _aberration = SpiceManager::AberrationCorrection(dictionary.value(KeyAberration)); + + using T = SpiceManager::AberrationCorrection::Type; + _aberration.addOptions({ + { static_cast(T::None), "None" }, + { static_cast(T::ConvergedNewtonian), "Converged Newtonian" }, + { static_cast(T::ConvergedNewtonianStellar), "Converged Newtonian Stellar" }, + { static_cast(T::LightTime), "Light Time" }, + { static_cast(T::LightTimeStellar), "Light Time Stellar" }, + + }); + SpiceManager::AberrationCorrection aberration = SpiceManager::AberrationCorrection( + dictionary.value(AberrationInfo.identifier) + ); + _aberration = static_cast(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(_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; diff --git a/modules/newhorizons/rendering/renderableshadowcylinder.h b/modules/newhorizons/rendering/renderableshadowcylinder.h index 6f32334a5b..cebe3a4bdc 100644 --- a/modules/newhorizons/rendering/renderableshadowcylinder.h +++ b/modules/newhorizons/rendering/renderableshadowcylinder.h @@ -27,6 +27,8 @@ #include +#include +#include #include #include #include @@ -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 _shader; @@ -71,14 +86,7 @@ private: GLuint _vbo; std::vector _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 diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index 0bc5c3fefa..06b19c6141 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -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) { diff --git a/modules/onscreengui/src/guicomponent.cpp b/modules/onscreengui/src/guicomponent.cpp index 21a8f8d741..d915aa918c 100644 --- a/modules/onscreengui/src/guicomponent.cpp +++ b/modules/onscreengui/src/guicomponent.cpp @@ -24,11 +24,19 @@ #include +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); } diff --git a/modules/onscreengui/src/guiperformancecomponent.cpp b/modules/onscreengui/src/guiperformancecomponent.cpp index 40bbab94cd..82bb28405f 100644 --- a/modules/onscreengui/src/guiperformancecomponent.cpp +++ b/modules/onscreengui/src/guiperformancecomponent.cpp @@ -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); diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp index 79f9ff1aa8..0e8d96366a 100644 --- a/modules/space/rendering/renderableconstellationbounds.cpp +++ b/modules/space/rendering/renderableconstellationbounds.cpp @@ -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(KeyVertexFile); + _vertexFilename.onChange([&](){ + loadVertexFile(); + }); + addProperty(_vertexFilename); + _vertexFilename = dictionary.value(VertexInfo.identifier); - if (dictionary.hasKey(KeyConstellationFile)) { - _constellationFilename = dictionary.value(KeyConstellationFile); + _constellationFilename.onChange([&](){ + loadConstellationFile(); + }); + addProperty(_constellationFilename); + if (dictionary.hasKey(ConstellationInfo.identifier)) { + _constellationFilename = dictionary.value(ConstellationInfo.identifier); } + if (dictionary.hasKey(DistanceInfo.identifier)) { + _distance = static_cast(dictionary.value(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; } diff --git a/modules/space/rendering/renderableconstellationbounds.h b/modules/space/rendering/renderableconstellationbounds.h index ec88c5eb71..200e2d8359 100644 --- a/modules/space/rendering/renderableconstellationbounds.h +++ b/modules/space/rendering/renderableconstellationbounds.h @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -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 _program; diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp index 3ad84c468b..765c2e86f7 100644 --- a/modules/space/translation/keplertranslation.cpp +++ b/modules/space/translation/keplertranslation.cpp @@ -34,15 +34,6 @@ #include 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 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(KeyEccentricity), - dictionary.value(KeySemiMajorAxis), - dictionary.value(KeyInclination), - dictionary.value(KeyAscendingNode), - dictionary.value(KeyArgumentOfPeriapsis), - dictionary.value(KeyMeanAnomaly), - dictionary.value(KeyPeriod), - dictionary.value(KeyEpoch) + dictionary.value(EccentricityInfo.identifier), + dictionary.value(SemiMajorAxisInfo.identifier), + dictionary.value(InclinationInfo.identifier), + dictionary.value(AscendingNodeInfo.identifier), + dictionary.value(ArgumentOfPeriapsisInfo.identifier), + dictionary.value(MeanAnomalyAtEpochInfo.identifier), + dictionary.value(PeriodInfo.identifier), + dictionary.value(EpochInfo.identifier) ); } diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index 9f6021650e..df19529c41 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -85,7 +85,7 @@ namespace { "MinimumAllowedDistance", "Minimum allowed distance", "" // @TODO Missing documentation - } + }; } // namespace namespace openspace::interaction {