mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 11:18:22 -05:00
Merge branch 'feature/NewAtmosphere' of https://github.com/OpenSpace/OpenSpace into feature/NewAtmosphere
This commit is contained in:
@@ -88,6 +88,7 @@ public:
|
||||
bool _showInternals;
|
||||
|
||||
properties::BoolProperty _showHelpText;
|
||||
properties::FloatProperty _helpTextDelay;
|
||||
|
||||
private:
|
||||
void renderAndUpdatePropertyVisibility();
|
||||
|
||||
@@ -69,12 +69,18 @@ public:
|
||||
/// Renders the individual subcomponents to the screen
|
||||
virtual void render() = 0;
|
||||
|
||||
void setShowHelpTooltip(bool showHelpTooltip);
|
||||
void setShowHelpTooltipDelay(double delay);
|
||||
|
||||
protected:
|
||||
/// <code>true</code> if this component is enabled and visible on the screen
|
||||
properties::BoolProperty _isEnabled;
|
||||
/// if <code>true</code> this window is currently collapsed. This setting mirrors the
|
||||
/// ImGui internal state of the window
|
||||
properties::BoolProperty _isCollapsed;
|
||||
|
||||
bool _showHelpTooltip;
|
||||
double _tooltipDelay;
|
||||
};
|
||||
|
||||
} // namespace openspace::gui
|
||||
|
||||
@@ -59,7 +59,6 @@ public:
|
||||
|
||||
void setVisibility(properties::Property::Visibility visibility);
|
||||
void setHasRegularProperties(bool hasOnlyRegularProperties);
|
||||
void setShowHelpTooltip(bool showHelpTooltip);
|
||||
|
||||
void render() override;
|
||||
|
||||
@@ -77,8 +76,6 @@ protected:
|
||||
|
||||
properties::BoolProperty _useTreeLayout;
|
||||
properties::StringListProperty _treeOrdering;
|
||||
|
||||
bool _showHelpTooltip;
|
||||
};
|
||||
|
||||
} // namespace openspace::gui
|
||||
|
||||
@@ -43,87 +43,87 @@ void executeScript(const std::string& id, const std::string& value,
|
||||
|
||||
void renderBoolProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderOptionProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderSelectionProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderStringProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderStringListProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDoubleProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderIntProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderIVec2Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderIVec3Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderIVec4Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderFloatProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderVec2Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderVec3Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderVec4Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDVec2Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDVec3Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDVec4Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDMat2Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDMat3Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDMat4Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderTriggerProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
|
||||
@@ -253,6 +253,12 @@ static const openspace::properties::Property::PropertyInfo ShowHelpInfo = {
|
||||
"explaining what impact they have on the visuals."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo HelpTextDelayInfo = {
|
||||
"HelpTextDelay",
|
||||
"Tooltip Delay (in s)",
|
||||
"This value determines the delay in seconds after which the tooltip is shown."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo HiddenInfo = {
|
||||
"IsHidden",
|
||||
"Is Hidden",
|
||||
@@ -282,6 +288,7 @@ GUI::GUI()
|
||||
, _featuredProperties("Featured Properties", GuiPropertyComponent::UseTreeLayout::No)
|
||||
, _showInternals(false)
|
||||
, _showHelpText(ShowHelpInfo, true)
|
||||
, _helpTextDelay(HelpTextDelayInfo, 1.0, 0.0, 10.0)
|
||||
, _currentVisibility(properties::Property::Visibility::Developer)
|
||||
, _allHidden(HiddenInfo, true)
|
||||
{
|
||||
@@ -304,13 +311,55 @@ GUI::GUI()
|
||||
addPropertySubOwner(_iswa);
|
||||
#endif // OPENSPACE_MODULE_ISWA_ENABLED
|
||||
|
||||
addProperty(_showHelpText);
|
||||
_showHelpText.onChange([this](){
|
||||
_globalProperty.setShowHelpTooltip(_showHelpText);
|
||||
_property.setShowHelpTooltip(_showHelpText);
|
||||
_screenSpaceProperty.setShowHelpTooltip(_showHelpText);
|
||||
_virtualProperty.setShowHelpTooltip(_showHelpText);
|
||||
});
|
||||
{
|
||||
auto showHelpTextFunc = [this](){
|
||||
_help.setShowHelpTooltip(_showHelpText);
|
||||
_filePath.setShowHelpTooltip(_showHelpText);
|
||||
#ifdef GLOBEBROWSING_USE_GDAL
|
||||
_globeBrowsing.setShowHelpTooltip(_showHelpText);
|
||||
#endif // GLOBEBROWSING_USE_GDAL
|
||||
_performance.setShowHelpTooltip(_showHelpText);
|
||||
_globalProperty.setShowHelpTooltip(_showHelpText);
|
||||
_property.setShowHelpTooltip(_showHelpText);
|
||||
_screenSpaceProperty.setShowHelpTooltip(_showHelpText);
|
||||
_virtualProperty.setShowHelpTooltip(_showHelpText);
|
||||
_spaceTime.setShowHelpTooltip(_showHelpText);
|
||||
_mission.setShowHelpTooltip(_showHelpText);
|
||||
#ifdef OPENSPACE_MODULE_ISWA_ENABLED
|
||||
_iswa.setShowHelpTooltip(_showHelpText);
|
||||
#endif // OPENSPACE_MODULE_ISWA_ENABLED
|
||||
_parallel.setShowHelpTooltip(_showHelpText);
|
||||
_featuredProperties.setShowHelpTooltip(_showHelpText);
|
||||
};
|
||||
showHelpTextFunc();
|
||||
_showHelpText.onChange(std::move(showHelpTextFunc));
|
||||
addProperty(_showHelpText);
|
||||
}
|
||||
|
||||
{
|
||||
auto helpTextDelayFunc = [this](){
|
||||
_help.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_filePath.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
#ifdef GLOBEBROWSING_USE_GDAL
|
||||
_globeBrowsing.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
#endif // GLOBEBROWSING_USE_GDAL
|
||||
_performance.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_globalProperty.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_property.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_screenSpaceProperty.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_virtualProperty.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_spaceTime.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_mission.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
#ifdef OPENSPACE_MODULE_ISWA_ENABLED
|
||||
_iswa.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
#endif // OPENSPACE_MODULE_ISWA_ENABLED
|
||||
_parallel.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_featuredProperties.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
};
|
||||
helpTextDelayFunc();
|
||||
_helpTextDelay.onChange(std::move(helpTextDelayFunc));
|
||||
addProperty(_helpTextDelay);
|
||||
}
|
||||
|
||||
addProperty(_allHidden);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,14 @@ void GuiComponent::setEnabled(bool enabled) {
|
||||
_isEnabled = enabled;
|
||||
}
|
||||
|
||||
void GuiComponent::setShowHelpTooltip(bool showHelpTooltip) {
|
||||
_showHelpTooltip = showHelpTooltip;
|
||||
}
|
||||
|
||||
void GuiComponent::setShowHelpTooltipDelay(double delay) {
|
||||
_tooltipDelay = delay;
|
||||
}
|
||||
|
||||
void GuiComponent::initialize() {}
|
||||
|
||||
void GuiComponent::initializeGL() {}
|
||||
|
||||
@@ -183,10 +183,6 @@ void GuiPropertyComponent::setHasRegularProperties(bool hasOnlyRegularProperties
|
||||
_hasOnlyRegularProperties = hasOnlyRegularProperties;
|
||||
}
|
||||
|
||||
void GuiPropertyComponent::setShowHelpTooltip(bool showHelpTooltip) {
|
||||
_showHelpTooltip = showHelpTooltip;
|
||||
}
|
||||
|
||||
void GuiPropertyComponent::renderPropertyOwner(properties::PropertyOwner* owner) {
|
||||
if (owner->propertiesRecursive().empty()) {
|
||||
return;
|
||||
@@ -425,7 +421,8 @@ void GuiPropertyComponent::renderProperty(properties::Property* prop,
|
||||
properties::PropertyOwner* owner)
|
||||
{
|
||||
using Func = std::function<
|
||||
void(properties::Property*, const std::string&, IsRegularProperty, ShowToolTip)
|
||||
void(properties::Property*, const std::string&, IsRegularProperty, ShowToolTip,
|
||||
double)
|
||||
>;
|
||||
static const std::map<std::string, Func> FunctionMapping = {
|
||||
{ "BoolProperty", &renderBoolProperty },
|
||||
@@ -463,7 +460,8 @@ void GuiPropertyComponent::renderProperty(properties::Property* prop,
|
||||
prop,
|
||||
owner->name(),
|
||||
IsRegularProperty(_hasOnlyRegularProperties),
|
||||
ShowToolTip(_showHelpTooltip)
|
||||
ShowToolTip(_showHelpTooltip),
|
||||
_tooltipDelay
|
||||
);
|
||||
}
|
||||
else {
|
||||
@@ -471,7 +469,8 @@ void GuiPropertyComponent::renderProperty(properties::Property* prop,
|
||||
prop,
|
||||
"",
|
||||
IsRegularProperty(_hasOnlyRegularProperties),
|
||||
ShowToolTip(_showHelpTooltip)
|
||||
ShowToolTip(_showHelpTooltip),
|
||||
_tooltipDelay
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <modules/imgui/include/gui.h>
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
#include <openspace/util/time.h>
|
||||
@@ -36,6 +35,8 @@
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
namespace {
|
||||
static const ImVec2 Size = ImVec2(350, 500);
|
||||
|
||||
@@ -45,6 +46,27 @@ namespace {
|
||||
"This value determines the minimum and maximum value for the delta time slider."
|
||||
};
|
||||
|
||||
void showTooltip(const std::string& message, double delay) {
|
||||
// Hackish way to enfore a window size for TextWrapped (SetNextWindowSize did not
|
||||
// do the trick)
|
||||
constexpr std::string::size_type FirstLineLength = 64;
|
||||
if (ImGui::IsItemHovered() && GImGui->HoveredIdTimer > delay) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text(
|
||||
"%s",
|
||||
message.substr(0, std::min(message.size() - 1, FirstLineLength)).c_str()
|
||||
);
|
||||
if (message.size() > FirstLineLength) {
|
||||
ImGui::TextWrapped(
|
||||
"%s",
|
||||
message.substr(std::min(message.size() - 1, FirstLineLength)).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace openspace::gui {
|
||||
@@ -82,8 +104,6 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
|
||||
|
||||
ImGui::Text("%s", "Focus on:");
|
||||
ImGui::SameLine();
|
||||
// Buttons for important SceneGraphNodes
|
||||
for (SceneGraphNode* n : nodes) {
|
||||
const std::vector<std::string>& tags = n->tags();
|
||||
@@ -119,7 +139,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
}
|
||||
int currentPosition = static_cast<int>(std::distance(nodes.begin(), iCurrentFocus));
|
||||
|
||||
bool hasChanged = ImGui::Combo("Focus Node", ¤tPosition, nodeNames.c_str());
|
||||
bool hasChanged = ImGui::Combo("", ¤tPosition, nodeNames.c_str());
|
||||
if (hasChanged) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.setPropertyValue('NavigationHandler.Origin', '" +
|
||||
@@ -155,15 +175,14 @@ void GuiSpaceTimeComponent::render() {
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(
|
||||
"%s",
|
||||
"Entering a date here and confirming with ENTER sets the current simulation "
|
||||
"time to the entered date. The format of the date has to be either ISO 8601 "
|
||||
"YYYY-MM-DDThh:mm:ss (2017-08-27T04:00:00) or YYYY MMM DD hh:mm:ss "
|
||||
"(2017 MAY 01 12:00:00). The hours are in 24h and specified as UTC."
|
||||
);
|
||||
}
|
||||
|
||||
showTooltip(
|
||||
"Entering a date here and confirming with ENTER sets the current simulation time "
|
||||
"to the entered date. The format of the date has to be either ISO 8601 "
|
||||
"YYYY-MM-DDThh:mm:ss (2017-08-27T04:00:00) or YYYY MMM DD hh:mm:ss "
|
||||
"(2017 MAY 01 12:00:00). The hours are in 24h and specified as UTC.",
|
||||
_tooltipDelay
|
||||
);
|
||||
|
||||
auto incrementTime = [](int days) {
|
||||
using namespace std::chrono;
|
||||
@@ -189,12 +208,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
};
|
||||
|
||||
bool minusMonth = ImGui::Button("-Month");
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(
|
||||
"%s",
|
||||
"OBS: A month here equals 30 days."
|
||||
);
|
||||
}
|
||||
showTooltip("OBS: A month here equals 30 days.", _tooltipDelay);
|
||||
if (minusMonth) {
|
||||
incrementTime(-30);
|
||||
}
|
||||
@@ -244,12 +258,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
if (plusMonth) {
|
||||
incrementTime(30);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(
|
||||
"%s",
|
||||
"OBS: A month here equals 30 days."
|
||||
);
|
||||
}
|
||||
showTooltip("OBS: A month here equals 30 days.", _tooltipDelay);
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 20.f);
|
||||
|
||||
@@ -276,14 +285,12 @@ void GuiSpaceTimeComponent::render() {
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(
|
||||
"%s",
|
||||
"This determines the simulation time increment, that is the passage "
|
||||
"of time in OpenSpace relative to a wall clock. Times are expressed as "
|
||||
"simulation time / real world time."
|
||||
);
|
||||
}
|
||||
showTooltip(
|
||||
"This determines the simulation time increment, that is the passage of time in "
|
||||
"OpenSpace relative to a wall clock. Times are expressed as simulation time / "
|
||||
"real world time.",
|
||||
_tooltipDelay
|
||||
);
|
||||
|
||||
bool isPaused = OsEng.timeManager().time().paused();
|
||||
|
||||
|
||||
@@ -41,13 +41,14 @@
|
||||
#include <ghoul/misc/misc.h>
|
||||
|
||||
#include <glm/ext.hpp>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
using namespace properties;
|
||||
|
||||
void renderTooltip(Property* prop) {
|
||||
if (ImGui::IsItemHovered()) {
|
||||
void renderTooltip(Property* prop, double delay) {
|
||||
if (ImGui::IsItemHovered() && (GImGui->HoveredIdTimer > delay)) {
|
||||
ImGui::BeginTooltip();
|
||||
if (!prop->description().empty()) {
|
||||
ImGui::TextWrapped("%s", prop->description().c_str());
|
||||
@@ -91,7 +92,8 @@ void executeScript(const std::string& id, const std::string& value,
|
||||
}
|
||||
|
||||
void renderBoolProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
BoolProperty* p = static_cast<BoolProperty*>(prop);
|
||||
@@ -101,7 +103,7 @@ void renderBoolProperty(Property* prop, const std::string& ownerName,
|
||||
BoolProperty::ValueType value = *p;
|
||||
ImGui::Checkbox(name.c_str(), &value);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -111,7 +113,8 @@ void renderBoolProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderOptionProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
OptionProperty* p = static_cast<OptionProperty*>(prop);
|
||||
@@ -129,7 +132,7 @@ void renderOptionProperty(Property* prop, const std::string& ownerName,
|
||||
for (const OptionProperty::Option& o : options) {
|
||||
ImGui::RadioButton(o.description.c_str(), &value, o.value);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
}
|
||||
ImGui::Separator();
|
||||
@@ -154,6 +157,9 @@ void renderOptionProperty(Property* prop, const std::string& ownerName,
|
||||
|
||||
int oldIdx = idx;
|
||||
ImGui::Combo(name.c_str(), &idx, nodeNames.c_str());
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (idx != oldIdx) {
|
||||
value = options[idx].value;
|
||||
@@ -169,7 +175,8 @@ void renderOptionProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderSelectionProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
SelectionProperty* p = static_cast<SelectionProperty*>(prop);
|
||||
@@ -190,7 +197,7 @@ void renderSelectionProperty(Property* prop, const std::string& ownerName,
|
||||
|
||||
ImGui::Checkbox(description.c_str(), &selected);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (selected) {
|
||||
@@ -212,7 +219,8 @@ void renderSelectionProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderStringProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
StringProperty* p = static_cast<StringProperty*>(prop);
|
||||
@@ -235,7 +243,7 @@ void renderStringProperty(Property* prop, const std::string& ownerName,
|
||||
ImGuiInputTextFlags_EnterReturnsTrue
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (hasNewValue) {
|
||||
@@ -250,7 +258,8 @@ void renderStringProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderStringListProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
StringListProperty* p = static_cast<StringListProperty*>(prop);
|
||||
@@ -275,7 +284,7 @@ void renderStringListProperty(Property* prop, const std::string& ownerName,
|
||||
ImGuiInputTextFlags_EnterReturnsTrue
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (hasNewValue) {
|
||||
@@ -300,7 +309,8 @@ void renderStringListProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDoubleProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DoubleProperty* p = static_cast<DoubleProperty*>(prop);
|
||||
@@ -313,7 +323,7 @@ void renderDoubleProperty(properties::Property* prop, const std::string& ownerNa
|
||||
|
||||
ImGui::SliderFloat(name.c_str(), &value, min, max, "%.5f", p->exponent());
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != static_cast<float>(p->value())) {
|
||||
@@ -324,7 +334,8 @@ void renderDoubleProperty(properties::Property* prop, const std::string& ownerNa
|
||||
}
|
||||
|
||||
void renderIntProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
IntProperty* p = static_cast<IntProperty*>(prop);
|
||||
@@ -337,7 +348,7 @@ void renderIntProperty(Property* prop, const std::string& ownerName,
|
||||
|
||||
ImGui::SliderInt(name.c_str(), &value, min, max);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -348,7 +359,8 @@ void renderIntProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderIVec2Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
IVec2Property* p = static_cast<IVec2Property*>(prop);
|
||||
@@ -365,7 +377,7 @@ void renderIVec2Property(Property* prop, const std::string& ownerName,
|
||||
max
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -380,7 +392,8 @@ void renderIVec2Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderIVec3Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
IVec3Property* p = static_cast<IVec3Property*>(prop);
|
||||
@@ -398,7 +411,7 @@ void renderIVec3Property(Property* prop, const std::string& ownerName,
|
||||
max
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -412,7 +425,8 @@ void renderIVec3Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderIVec4Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
IVec4Property* p = static_cast<IVec4Property*>(prop);
|
||||
@@ -430,7 +444,7 @@ void renderIVec4Property(Property* prop, const std::string& ownerName,
|
||||
max
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -444,7 +458,8 @@ void renderIVec4Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderFloatProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
FloatProperty* p = static_cast<FloatProperty*>(prop);
|
||||
@@ -456,7 +471,7 @@ void renderFloatProperty(Property* prop, const std::string& ownerName,
|
||||
float max = p->maxValue();
|
||||
ImGui::SliderFloat(name.c_str(), &value, min, max, "%.5f", p->exponent());
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -467,7 +482,8 @@ void renderFloatProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderVec2Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
Vec2Property* p = static_cast<Vec2Property*>(prop);
|
||||
@@ -487,7 +503,7 @@ void renderVec2Property(Property* prop, const std::string& ownerName,
|
||||
p->exponent()
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -502,7 +518,8 @@ void renderVec2Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderVec3Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
Vec3Property* p = static_cast<Vec3Property*>(prop);
|
||||
@@ -530,7 +547,7 @@ void renderVec3Property(Property* prop, const std::string& ownerName,
|
||||
);
|
||||
}
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -545,7 +562,8 @@ void renderVec3Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderVec4Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
Vec4Property* p = static_cast<Vec4Property*>(prop);
|
||||
@@ -573,7 +591,7 @@ void renderVec4Property(Property* prop, const std::string& ownerName,
|
||||
);
|
||||
}
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -588,7 +606,8 @@ void renderVec4Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDVec2Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DVec2Property* p = static_cast<DVec2Property*>(prop);
|
||||
@@ -607,7 +626,7 @@ void renderDVec2Property(Property* prop, const std::string& ownerName,
|
||||
p->exponent()
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dvec2(value) != p->value()) {
|
||||
@@ -622,7 +641,8 @@ void renderDVec2Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDVec3Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DVec3Property* p = static_cast<DVec3Property*>(prop);
|
||||
@@ -642,7 +662,7 @@ void renderDVec3Property(Property* prop, const std::string& ownerName,
|
||||
p->exponent()
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
@@ -657,7 +677,8 @@ void renderDVec3Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDVec4Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DVec4Property* p = static_cast<DVec4Property*>(prop);
|
||||
@@ -677,7 +698,7 @@ void renderDVec4Property(Property* prop, const std::string& ownerName,
|
||||
p->exponent()
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dvec4(value) != p->value()) {
|
||||
@@ -692,7 +713,8 @@ void renderDVec4Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDMat2Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DMat2Property* p = static_cast<DMat2Property*>(prop);
|
||||
@@ -718,7 +740,7 @@ void renderDMat2Property(Property* prop, const std::string& ownerName,
|
||||
ImGui::SliderFloat2("[1]", glm::value_ptr(value[1]), min, max, "%.5f", p->exponent());
|
||||
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dmat2(value) != p->value()) {
|
||||
@@ -733,7 +755,8 @@ void renderDMat2Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDMat3Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DMat3Property* p = static_cast<DMat3Property*>(prop);
|
||||
@@ -763,7 +786,7 @@ void renderDMat3Property(Property* prop, const std::string& ownerName,
|
||||
ImGui::SliderFloat3("[2]", glm::value_ptr(value[2]), min, max, "%.5f", p->exponent());
|
||||
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dmat3(value) != p->value()) {
|
||||
@@ -778,7 +801,8 @@ void renderDMat3Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDMat4Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DMat4Property* p = static_cast<DMat4Property*>(prop);
|
||||
@@ -811,7 +835,7 @@ void renderDMat4Property(Property* prop, const std::string& ownerName,
|
||||
ImGui::SliderFloat4("[3]", glm::value_ptr(value[3]), min, max, "%.5f", p->exponent());
|
||||
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dmat4(value) != p->value()) {
|
||||
@@ -826,7 +850,8 @@ void renderDMat4Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderTriggerProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
std::string name = prop->guiName();
|
||||
@@ -837,7 +862,7 @@ void renderTriggerProperty(Property* prop, const std::string& ownerName,
|
||||
executeScript(prop->fullyQualifiedIdentifier(), "nil", isRegular);
|
||||
}
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
@@ -82,8 +82,6 @@ RenderablePlaneProjection::RenderablePlaneProjection(const ghoul::Dictionary& di
|
||||
_texturePath = absPath(_texturePath);
|
||||
_textureFile = new ghoul::filesystem::File(_texturePath);
|
||||
}
|
||||
|
||||
loadTexture();
|
||||
}
|
||||
|
||||
RenderablePlaneProjection::~RenderablePlaneProjection() {
|
||||
|
||||
Reference in New Issue
Block a user