Remove interesting times (closes #2991)

This commit is contained in:
Alexander Bock
2024-01-09 15:34:54 +01:00
parent 4bf111115e
commit 902da116e7
6 changed files with 0 additions and 82 deletions

View File

@@ -213,24 +213,6 @@ public:
*/
void updateInterpolations();
/**
* Adds the provided \p time as an interesting time to this scene. The same time can
* be added multiple times.
*
* \param time The time that should be added
*
* \pre \p time.time must not be empty
* \pre \p time.name must not be empty
*/
void addInterestingTime(InterestingTime time);
/**
* Returns the list of all interesting times that are defined for this scene.
*
* \return The list of all interesting times that are defined for this scene
*/
const std::vector<InterestingTime>& interestingTimes() const;
/**
* Returns the Lua library that contains all Lua functions available to change the
* scene graph.
@@ -334,7 +316,6 @@ private:
SceneGraphNode _rootDummy;
std::unique_ptr<SceneInitializer> _initializer;
std::string _profilePropertyName;
std::vector<InterestingTime> _interestingTimes;
bool _valueIsTable = false;
std::mutex _programUpdateLock;

View File

@@ -192,30 +192,6 @@ void GuiSpaceTimeComponent::render() {
CaptionText("Time Controls");
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
const std::vector<Scene::InterestingTime>& interestingTimes =
global::renderEngine->scene()->interestingTimes();
if (!interestingTimes.empty()) {
ImGui::Text("%s", "Interesting Times");
for (size_t i = 0; i < interestingTimes.size(); ++i) {
const Scene::InterestingTime& t = interestingTimes[i];
if (ImGui::Button(t.name.c_str())) {
// No sync or send because time settings are always synced and sent
// to the connected nodes and peers
global::scriptEngine->queueScript(
"openspace.time.setTime(\"" + t.time + "\")",
scripting::ScriptEngine::ShouldBeSynchronized::No,
scripting::ScriptEngine::ShouldSendToRemote::No
);
}
if (i != interestingTimes.size() - 1) {
ImGui::SameLine();
}
}
}
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
ImGui::Text(

View File

@@ -63,7 +63,6 @@ private:
void disconnect();
void processInputState(const nlohmann::json& json);
void setFocusNodes();
void setInterestingTimes();
void updateView(const nlohmann::json& json) const;
void changeFocus(const nlohmann::json& json) const;
void setRenderableEnabled(const nlohmann::json& json) const;

View File

@@ -213,7 +213,6 @@ void FlightControllerTopic::connect() {
std::fill(_inputState.axes.begin(), _inputState.axes.end(), 0.f);
_payload[TypeKey] = Connect;
setFocusNodes();
setInterestingTimes();
_payload[Connect][FocusNodesKey] = _focusNodes;
_payload[Connect][AllNodesKey] = _allNodes;
_payload[Connect][InterestingTimesKey] = _interestingTimes;
@@ -258,25 +257,7 @@ void FlightControllerTopic::setFocusNodes() {
}
}
void FlightControllerTopic::setInterestingTimes() {
std::vector<Scene::InterestingTime> times =
global::renderEngine->scene()->interestingTimes();
std::sort(
times.begin(),
times.end(),
[](Scene::InterestingTime lhs, Scene::InterestingTime rhs) {
return lhs.name < rhs.name;
}
);
for (const Scene::InterestingTime& t : times) {
_interestingTimes[t.name] = t.time;
}
}
void FlightControllerTopic::updateView(const nlohmann::json& json) const {
if (json.find(RenderableKey) != json.end()) {
setRenderableEnabled(json);
}

View File

@@ -572,14 +572,6 @@ void Scene::updateInterpolations() {
);
}
void Scene::addInterestingTime(InterestingTime time) {
_interestingTimes.push_back(std::move(time));
}
const std::vector<Scene::InterestingTime>& Scene::interestingTimes() const {
return _interestingTimes;
}
void Scene::setPropertiesFromProfile(const Profile& p) {
ghoul::lua::LuaState L(ghoul::lua::LuaState::IncludeStandardLibrary::Yes);
@@ -873,7 +865,6 @@ scripting::LuaLibrary Scene::luaLibrary() {
codegen::lua::SceneGraphNodes,
codegen::lua::NodeByRenderableType,
codegen::lua::ScreenSpaceRenderables,
codegen::lua::AddInterestingTime,
codegen::lua::WorldPosition,
codegen::lua::WorldRotation,
codegen::lua::SetParent,

View File

@@ -924,16 +924,6 @@ namespace {
return res;
}
/**
* Adds an interesting time to the current scene. The first argument is the name of the
* time and the second argument is the time itself in the format YYYY-MM-DDThh:mm:ss.uuu
*/
[[codegen::luawrap]] void addInterestingTime(std::string name, std::string time) {
openspace::global::renderEngine->scene()->addInterestingTime(
{ std::move(name), std::move(time) }
);
}
/**
* Returns the world position of the scene graph node with the given string as identifier.
*/