mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-21 12:29:04 -06:00
Various cleanup
This commit is contained in:
@@ -350,7 +350,7 @@ return {
|
||||
},
|
||||
{
|
||||
Name = "NAVCAM",
|
||||
Parent = "Rosetta",,
|
||||
Parent = "Rosetta",
|
||||
GuiPath = "/Solar System/Missions/Rosetta"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -70,7 +70,6 @@ public:
|
||||
#ifdef GLOBEBROWSING_USE_GDAL
|
||||
GuiGlobeBrowsingComponent _globeBrowsing;
|
||||
#endif // GLOBEBROWSING_USE_GDAL
|
||||
//GuiOriginComponent _origin;
|
||||
GuiPerformanceComponent _performance;
|
||||
GuiPropertyComponent _globalProperty;
|
||||
GuiPropertyComponent _property;
|
||||
|
||||
@@ -259,7 +259,6 @@ GUI::GUI()
|
||||
, _currentVisibility(properties::Property::Visibility::Developer)
|
||||
{
|
||||
addPropertySubOwner(_help);
|
||||
//addPropertySubOwner(_origin);
|
||||
addPropertySubOwner(_performance);
|
||||
addPropertySubOwner(_globalProperty);
|
||||
addPropertySubOwner(_property);
|
||||
|
||||
@@ -98,316 +98,7 @@ void GuiMissionComponent::render() {
|
||||
const Mission& currentMission = MissionManager::ref().currentMission();
|
||||
renderMission(currentMission);
|
||||
|
||||
|
||||
//std::vector<SceneGraphNode*> nodes =
|
||||
// OsEng.renderEngine().scene()->allSceneGraphNodes();
|
||||
|
||||
//std::sort(
|
||||
// nodes.begin(),
|
||||
// nodes.end(),
|
||||
// [](SceneGraphNode* lhs, SceneGraphNode* rhs) {
|
||||
// return lhs->name() < rhs->name();
|
||||
// }
|
||||
//);
|
||||
|
||||
//ImGui::BeginGroup();
|
||||
//if (ImGui::IsItemHovered()) {
|
||||
// ImGui::SetTooltip(
|
||||
// "%s",
|
||||
// "These buttons and the dropdown menu determine the focus object in the scene "
|
||||
// "that is the center of all camera movement"
|
||||
// );
|
||||
//}
|
||||
|
||||
//CaptionText("Focus Selection");
|
||||
|
||||
//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();
|
||||
// auto it = std::find(tags.begin(), tags.end(), "GUI.Interesting");
|
||||
// if (it != tags.end()) {
|
||||
// bool pressed = ImGui::Button(n->name().c_str());
|
||||
// ImGui::SameLine();
|
||||
// if (pressed) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.setPropertyValue('NavigationHandler.Origin', '" +
|
||||
// n->name() + "');",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//ImGui::NewLine();
|
||||
//ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
|
||||
|
||||
//SceneGraphNode* currentFocus = OsEng.navigationHandler().focusNode();
|
||||
|
||||
//std::string nodeNames = "";
|
||||
//for (SceneGraphNode* n : nodes) {
|
||||
// nodeNames += n->name() + '\0';
|
||||
//}
|
||||
|
||||
//auto iCurrentFocus = std::find(nodes.begin(), nodes.end(), currentFocus);
|
||||
//if (!nodes.empty()) {
|
||||
// // Only check if we found the current focus node if we have any nodes at all
|
||||
// // only then it would be a real error
|
||||
// ghoul_assert(iCurrentFocus != nodes.end(), "Focus node not found");
|
||||
//}
|
||||
//int currentPosition = static_cast<int>(std::distance(nodes.begin(), iCurrentFocus));
|
||||
|
||||
//bool hasChanged = ImGui::Combo("Focus Node", ¤tPosition, nodeNames.c_str());
|
||||
//if (hasChanged) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.setPropertyValue('NavigationHandler.Origin', '" +
|
||||
// nodes[currentPosition]->name() + "');",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
|
||||
//ImGui::EndGroup();
|
||||
|
||||
//ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 20.f);
|
||||
|
||||
//ImGui::Separator();
|
||||
//ImGui::Separator();
|
||||
//ImGui::Separator();
|
||||
|
||||
//ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 20.f);
|
||||
|
||||
|
||||
//ImGui::BeginGroup();
|
||||
//if (ImGui::IsItemHovered()) {
|
||||
// ImGui::SetTooltip(
|
||||
// "%s",
|
||||
// "These elements determine the simulation time inside OpenSpace."
|
||||
// );
|
||||
//}
|
||||
|
||||
//CaptionText("Time Controls");
|
||||
//ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
|
||||
|
||||
//constexpr int BufferSize = 256;
|
||||
//static char Buffer[BufferSize];
|
||||
//bool dateChanged = ImGui::InputText(
|
||||
// "Date",
|
||||
// Buffer,
|
||||
// BufferSize,
|
||||
// ImGuiInputTextFlags_EnterReturnsTrue
|
||||
//);
|
||||
//if (dateChanged) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setTime(\"" + std::string(Buffer) + "\")",
|
||||
// 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."
|
||||
// );
|
||||
//}
|
||||
|
||||
//auto incrementTime = [](int days) {
|
||||
// using namespace std::chrono;
|
||||
// double j2000 = OsEng.timeManager().time().j2000Seconds();
|
||||
|
||||
// long long seconds = duration_cast<std::chrono::seconds>(
|
||||
// std::chrono::hours(24) * std::abs(days)
|
||||
// ).count();
|
||||
|
||||
// double newTime = [days, j2000, seconds](){
|
||||
// if (days < 0) {
|
||||
// return static_cast<double>(j2000 - seconds);
|
||||
// }
|
||||
// else {
|
||||
// return static_cast<double>(j2000 + seconds);
|
||||
// }
|
||||
// }();
|
||||
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setTime(" + std::to_string(newTime) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//};
|
||||
|
||||
//bool minusMonth = ImGui::Button("-Month");
|
||||
//if (ImGui::IsItemHovered()) {
|
||||
// ImGui::SetTooltip(
|
||||
// "%s",
|
||||
// "OBS: A month here equals 30 days."
|
||||
// );
|
||||
//}
|
||||
//if (minusMonth) {
|
||||
// incrementTime(-30);
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
//bool minusWeek = ImGui::Button("-Week");
|
||||
//if (minusWeek) {
|
||||
// incrementTime(-7);
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
//bool minusDay = ImGui::Button("-Day");
|
||||
//if (minusDay) {
|
||||
// incrementTime(-1);
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
//
|
||||
//ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 55.f);
|
||||
|
||||
//bool plusDay = ImGui::Button("+Day");
|
||||
//if (plusDay) {
|
||||
// incrementTime(1);
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
//bool plusWeek = ImGui::Button("+Week");
|
||||
//if (plusWeek) {
|
||||
// incrementTime(7);
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
//bool plusMonth = ImGui::Button("+Month");
|
||||
//if (plusMonth) {
|
||||
// incrementTime(30);
|
||||
//}
|
||||
//if (ImGui::IsItemHovered()) {
|
||||
// ImGui::SetTooltip(
|
||||
// "%s",
|
||||
// "OBS: A month here equals 30 days."
|
||||
// );
|
||||
//}
|
||||
|
||||
//ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 20.f);
|
||||
|
||||
|
||||
//float deltaTime = static_cast<float>(OsEng.timeManager().time().deltaTime());
|
||||
//bool changed = ImGui::SliderFloat("Delta Time", &deltaTime, -100000.f, 100000.f, "%.3f", 5.f);
|
||||
//if (changed) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(deltaTime) + ")",
|
||||
// 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."
|
||||
// );
|
||||
//}
|
||||
|
||||
//bool isPaused = OsEng.timeManager().time().paused();
|
||||
|
||||
//
|
||||
//bool pauseChanged = ImGui::Button(isPaused ? "Resume" : "Pause", { ImGui::GetWindowWidth() - 7.5f, 0.f } );
|
||||
//if (pauseChanged) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.togglePause()",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
|
||||
//auto setDeltaTime = [](std::chrono::seconds dt) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(dt.count()) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//};
|
||||
|
||||
//bool minusDs = ImGui::Button("-1d/s");
|
||||
//if (minusDs) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(-24 * 60 * 60) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
//bool minusHs = ImGui::Button("-1h/s");
|
||||
//if (minusHs) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(-60 * 60) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
//bool minusMs = ImGui::Button("-1min/s");
|
||||
//if (minusMs) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(-60) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
//bool minusSs = ImGui::Button("-1s/s");
|
||||
//if (minusSs) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(-1) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
//bool zero = ImGui::Button("0");
|
||||
//if (zero) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(0) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
|
||||
//bool plusSs = ImGui::Button("+1s/s");
|
||||
//if (plusSs) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(1) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
//bool plusMs = ImGui::Button("1min/s");
|
||||
//if (plusMs) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(60) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
//bool plusHs = ImGui::Button("1h/s");
|
||||
//if (plusHs) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(60 * 60) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
//bool plusDs = ImGui::Button("1d/s");
|
||||
//if (plusDs) {
|
||||
// OsEng.scriptEngine().queueScript(
|
||||
// "openspace.time.setDeltaTime(" + std::to_string(24 * 60 * 60) + ")",
|
||||
// scripting::ScriptEngine::RemoteScripting::Yes
|
||||
// );
|
||||
//}
|
||||
//ImGui::SameLine();
|
||||
|
||||
|
||||
//ImGui::EndGroup();
|
||||
|
||||
ImGui::End();
|
||||
|
||||
}
|
||||
|
||||
} // namespace openspace gui
|
||||
|
||||
Reference in New Issue
Block a user