mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 04:30:09 -05:00
Add description to PropertyOwner
This commit is contained in:
@@ -85,7 +85,7 @@ std::unique_ptr<ModelGeometry> ModelGeometry::createFromDictionary(
|
||||
}
|
||||
|
||||
ModelGeometry::ModelGeometry(const ghoul::Dictionary& dictionary)
|
||||
: properties::PropertyOwner("ModelGeometry")
|
||||
: properties::PropertyOwner({ "ModelGeometry" })
|
||||
, _mode(GL_TRIANGLES)
|
||||
{
|
||||
documentation::testSpecificationAndThrow(
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ namespace {
|
||||
namespace openspace::globebrowsing::cache {
|
||||
|
||||
MemoryAwareTileCache::MemoryAwareTileCache()
|
||||
: PropertyOwner("TileCache")
|
||||
: PropertyOwner({ "TileCache" })
|
||||
, _numTextureBytesAllocatedOnCPU(0)
|
||||
, _cpuAllocatedTileData(CpuAllocatedDataInfo, 1024, 128, 2048, 1)
|
||||
, _gpuAllocatedTileData(GpuAllocatedDataInfo, 1024, 128, 2048, 1)
|
||||
|
||||
@@ -179,7 +179,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
|
||||
FloatProperty(CameraMinHeightInfo, 100.f, 0.f, 1000.f),
|
||||
FloatProperty(OrenNayarRoughnessInfo, 0.f, 0.f, 1.f)
|
||||
})
|
||||
, _debugPropertyOwner("Debug")
|
||||
, _debugPropertyOwner({ "Debug" })
|
||||
{
|
||||
setName("RenderableGlobe");
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace {
|
||||
const char* _loggerCat = "Layer";
|
||||
|
||||
const char* keyName = "Name";
|
||||
const char* keyDescription = "Description";
|
||||
const char* keyEnabled = "Enabled";
|
||||
const char* keyLayerGroupID = "LayerGroupID";
|
||||
const char* keySettings = "Settings";
|
||||
@@ -73,11 +74,13 @@ namespace {
|
||||
"If the 'Type' of this layer is a solid color, this value determines what this "
|
||||
"solid color is."
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict)
|
||||
: properties::PropertyOwner(layerDict.value<std::string>(keyName))
|
||||
: properties::PropertyOwner({
|
||||
layerDict.value<std::string>(keyName),
|
||||
layerDict.hasKey(keyDescription) ? layerDict.value<std::string>(keyDescription) : ""
|
||||
})
|
||||
, _typeOption(TypeInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _blendModeOption(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _enabled(EnabledInfo, false)
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace {
|
||||
namespace openspace::globebrowsing {
|
||||
|
||||
LayerAdjustment::LayerAdjustment()
|
||||
: properties::PropertyOwner("adjustment")
|
||||
: properties::PropertyOwner({ "adjustment" })
|
||||
, chromaKeyColor(ChromaKeyColorInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, chromaKeyTolerance(ChromaKeyToleranceInfo, 0.f, 0.f, 1.f)
|
||||
, _typeOption(TypeInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace {
|
||||
namespace openspace::globebrowsing {
|
||||
|
||||
LayerGroup::LayerGroup(layergroupid::GroupID id)
|
||||
: properties::PropertyOwner(std::move(layergroupid::LAYER_GROUP_NAMES[id]))
|
||||
: properties::PropertyOwner({ std::move(layergroupid::LAYER_GROUP_NAMES[id]) })
|
||||
, _groupId(id)
|
||||
, _levelBlendingEnabled(BlendTileInfo, true)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace {
|
||||
namespace openspace::globebrowsing {
|
||||
|
||||
LayerManager::LayerManager(const ghoul::Dictionary& layerGroupsDict)
|
||||
: properties::PropertyOwner("Layers")
|
||||
: properties::PropertyOwner({ "Layers" })
|
||||
{
|
||||
// First create empty layer groups in case not all are specified
|
||||
_layerGroups.resize(layergroupid::NUM_LAYER_GROUPS);
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace {
|
||||
namespace openspace::globebrowsing {
|
||||
|
||||
LayerRenderSettings::LayerRenderSettings()
|
||||
: properties::PropertyOwner("Settings")
|
||||
: properties::PropertyOwner({ "Settings" })
|
||||
, setDefault(SetDefaultInfo)
|
||||
, opacity(OpacityInfo, 1.f, 0.f, 1.f)
|
||||
, gamma(GammaInfo, 1.f, 0.f, 5.f)
|
||||
|
||||
@@ -157,12 +157,14 @@ openspace.globebrowsing.parseInfoFile = function (file)
|
||||
|
||||
local color = {
|
||||
Name = Name,
|
||||
Description = Description or "",
|
||||
FilePath = dir .. '/' .. ColorFile,
|
||||
BlendMode = "Color"
|
||||
}
|
||||
|
||||
local height = {
|
||||
Name = Name,
|
||||
Description = Description or "",
|
||||
FilePath = dir .. '/' .. HeightFile,
|
||||
TilePixelSize = 90
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ bool GdalWrapper::logGdalErrors() const {
|
||||
}
|
||||
|
||||
GdalWrapper::GdalWrapper(size_t maximumCacheSize, size_t maximumMaximumCacheSize)
|
||||
: PropertyOwner("GdalWrapper")
|
||||
: PropertyOwner({ "GdalWrapper" })
|
||||
, _logGdalErrors(LogGdalErrorInfo, true)
|
||||
, _gdalMaximumCacheSize (
|
||||
GdalMaximumCacheInfo,
|
||||
|
||||
@@ -52,7 +52,7 @@ std::unique_ptr<TileProvider> TileProvider::createFromDictionary(
|
||||
}
|
||||
|
||||
TileProvider::TileProvider()
|
||||
: properties::PropertyOwner("tileProvider")
|
||||
: properties::PropertyOwner({ "tileProvider" })
|
||||
, _initialized(false)
|
||||
, _defaultTile(nullptr, nullptr, Tile::Status::Unavailable)
|
||||
{
|
||||
@@ -60,7 +60,7 @@ TileProvider::TileProvider()
|
||||
}
|
||||
|
||||
TileProvider::TileProvider(const ghoul::Dictionary&)
|
||||
: properties::PropertyOwner("tileProvider")
|
||||
: properties::PropertyOwner({ "tileProvider" })
|
||||
, _initialized(false)
|
||||
, _defaultTile(nullptr, nullptr, Tile::Status::Unavailable)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
IswaBaseGroup::IswaBaseGroup(std::string name, std::string type)
|
||||
: properties::PropertyOwner(std::move(name))
|
||||
: properties::PropertyOwner({ std::move(name) })
|
||||
, _enabled(EnabledInfo, true)
|
||||
, _alpha(AlphaInfo, 0.9f, 0.f, 1.f)
|
||||
, _delete(DeleteInfo)
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
IswaManager::IswaManager()
|
||||
: properties::PropertyOwner("IswaManager")
|
||||
: properties::PropertyOwner({ "IswaManager" })
|
||||
, _iswaEvent()
|
||||
, _baseUrl("https://iswa-demo-server.herokuapp.com/")
|
||||
{
|
||||
|
||||
@@ -204,7 +204,7 @@ documentation::Documentation ProjectionComponent::Documentation() {
|
||||
}
|
||||
|
||||
ProjectionComponent::ProjectionComponent()
|
||||
: properties::PropertyOwner("ProjectionComponent")
|
||||
: properties::PropertyOwner({ "ProjectionComponent" })
|
||||
, _performProjection(ProjectionInfo, true)
|
||||
, _clearAllProjections(ClearProjectionInfo, false)
|
||||
, _projectionFading(FadingInfo, 1.f, 0.f, 1.f)
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace {
|
||||
namespace openspace::gui {
|
||||
|
||||
GuiComponent::GuiComponent(std::string name)
|
||||
: properties::PropertyOwner(std::move(name))
|
||||
: properties::PropertyOwner({ std::move(name) })
|
||||
, _isEnabled(EnabledInfo, false)
|
||||
{
|
||||
addProperty(_isEnabled);
|
||||
|
||||
@@ -49,6 +49,15 @@ namespace {
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
void renderTooltip(openspace::properties::PropertyOwner* propOwner) {
|
||||
const bool shouldDisplay =
|
||||
ImGui::IsItemHovered() && (!propOwner->description().empty());
|
||||
|
||||
if (shouldDisplay) {
|
||||
ImGui::SetTooltip(propOwner->description().c_str());
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace openspace::gui {
|
||||
@@ -87,7 +96,9 @@ void GuiPropertyComponent::renderPropertyOwner(properties::PropertyOwner* owner)
|
||||
renderPropertyOwner(subOwner);
|
||||
}
|
||||
else {
|
||||
if (ImGui::TreeNode(subOwner->name().c_str())) {
|
||||
bool opened = ImGui::TreeNode(subOwner->name().c_str());
|
||||
renderTooltip(subOwner);
|
||||
if (opened) {
|
||||
renderPropertyOwner(subOwner);
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ std::unique_ptr<PlanetGeometry> PlanetGeometry::createFromDictionary(
|
||||
}
|
||||
|
||||
PlanetGeometry::PlanetGeometry()
|
||||
: properties::PropertyOwner("PlanetGeometry")
|
||||
: properties::PropertyOwner({ "PlanetGeometry" })
|
||||
, _parent(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ using namespace TUIO;
|
||||
namespace openspace {
|
||||
|
||||
TouchInteraction::TouchInteraction()
|
||||
: properties::PropertyOwner("TouchInteraction")
|
||||
: properties::PropertyOwner({ "TouchInteraction" })
|
||||
, _origin({ "Origin", "Origin", "" }) // @TODO Missing documentation
|
||||
, _unitTest(
|
||||
{ "Click to take a unit test", "Take a unit test saving the LM data into file", "" }, // @TODO Missing documentation
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
TouchMarker::TouchMarker()
|
||||
: properties::PropertyOwner("TouchMarker")
|
||||
: properties::PropertyOwner({ "TouchMarker" })
|
||||
, _visible({ "TouchMarkers visible", "Toggle visibility of markers", "" }, true) // @TODO Missing documentation
|
||||
, _radiusSize({ "Marker size", "Marker radius", "" }, 30.f, 0.f, 100.f) // @TODO Missing documentation
|
||||
, _transparency({ "Transparency of marker", "Marker transparency", "" }, 0.8f, 0.f, 1.f) // @TODO Missing documentation
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
namespace openspace {
|
||||
|
||||
VolumeClipPlane::VolumeClipPlane(const ghoul::Dictionary& dictionary)
|
||||
: _normal(
|
||||
: properties::PropertyOwner({ "" }) // @TODO Missing name
|
||||
, _normal(
|
||||
{ "Normal", "Normal", "" }, // @TODO Missing documentation
|
||||
glm::vec3(1.f, 0.f, 0.f),
|
||||
glm::vec3(-1.f),
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
namespace openspace {
|
||||
|
||||
VolumeClipPlanes::VolumeClipPlanes(const ghoul::Dictionary& dictionary)
|
||||
: _nClipPlanes({ "nClipPlanes", "Number of clip planes", "" }, 0, 0, 10) // @TODO Missing documentation
|
||||
: properties::PropertyOwner({ "" }) // @TODO Missing name
|
||||
, _nClipPlanes({ "nClipPlanes", "Number of clip planes", "" }, 0, 0, 10) // @TODO Missing documentation
|
||||
{
|
||||
std::vector<std::string> keys = dictionary.keys();
|
||||
for (const std::string& key : keys) {
|
||||
|
||||
Reference in New Issue
Block a user