mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 19:29:04 -05:00
First pass on tracking changed properties/assets since initialization
This commit is contained in:
@@ -76,6 +76,7 @@ public:
|
||||
const glm::mat4& projectionMatrix);
|
||||
void drawOverlays();
|
||||
void postDraw();
|
||||
void resetPropertyChangeFlags();
|
||||
void keyboardCallback(Key key, KeyModifier mod, KeyAction action);
|
||||
void charCallback(unsigned int codepoint, KeyModifier modifier);
|
||||
void mouseButtonCallback(MouseButton button, MouseAction action, KeyModifier mods);
|
||||
|
||||
@@ -495,6 +495,11 @@ public:
|
||||
*/
|
||||
virtual std::string generateAdditionalJsonDescription() const;
|
||||
|
||||
/**
|
||||
* Reset the valChanged flag to an unchanged state, as if value has not been changed.
|
||||
*/
|
||||
void resetToUnchanged();
|
||||
|
||||
protected:
|
||||
static const char* IdentifierKey;
|
||||
static const char* NameKey;
|
||||
@@ -531,6 +536,9 @@ protected:
|
||||
/// The callback function sthat will be invoked whenever the value changes
|
||||
std::vector<std::pair<OnDeleteHandle, std::function<void()>>> _onDeleteCallbacks;
|
||||
|
||||
/// Flag indicating that this property value has been changed after initialization
|
||||
bool valChanged = false;
|
||||
|
||||
private:
|
||||
void notifyDeleteListeners();
|
||||
|
||||
|
||||
@@ -176,6 +176,7 @@ void openspace::properties::TemplateProperty<T>::setValue(T val) {
|
||||
if (val != _value) {
|
||||
_value = std::move(val);
|
||||
notifyChangeListeners();
|
||||
valChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +197,7 @@ void TemplateProperty<T>::set(std::any value) {
|
||||
if (v != _value) {
|
||||
_value = std::move(v);
|
||||
notifyChangeListeners();
|
||||
valChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -226,6 +226,9 @@ private:
|
||||
std::unordered_map<Asset*, std::map<Asset*, std::vector<int>>>
|
||||
_onDependencyDeinitializationFunctionRefs;
|
||||
int _assetsTableRef;
|
||||
|
||||
std::vector<std::string> profileAssetsAdded;
|
||||
std::vector<std::string> profileAssetsRemoved;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user