No need to use the .set method of properties directly

This commit is contained in:
Alexander Bock
2023-11-28 21:37:52 +01:00
parent 56ad7a3365
commit 3a9716a535
10 changed files with 20 additions and 11 deletions

View File

@@ -69,6 +69,11 @@ public:
*/
void set(std::any value) override;
/**
* Triggers this TriggerProperty.
*/
void trigger();
std::string jsonValue() const override;
};

View File

@@ -526,7 +526,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
if (p.blendingOption.has_value()) {
const std::string blendingOpt = *p.blendingOption;
_blendingFuncOption.set(BlendingMapping[blendingOpt]);
_blendingFuncOption = BlendingMapping[blendingOpt];
}
_originalRenderBin = renderBin();

View File

@@ -82,7 +82,7 @@ ScreenSpaceFramebuffer::ScreenSpaceFramebuffer(const ghoul::Dictionary& dictiona
glm::vec2 resolution = global::windowDelegate->currentDrawBufferResolution();
addProperty(_size);
_size.set(glm::vec4(0.f, 0.f, resolution.x, resolution.y));
_size = glm::vec4(0.f, 0.f, resolution.x, resolution.y);
}
ScreenSpaceFramebuffer::~ScreenSpaceFramebuffer() {}

View File

@@ -238,7 +238,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
_renderOption.addOption(1, "Camera Position Normal");
_renderOption.addOption(2, "Screen center Position Normal");
addProperty(_renderOption);
//_renderOption.set(1);
//_renderOption = 1;
if (p.unit.has_value()) {
_unit = codegen::map<DistanceUnit>(*p.unit);

View File

@@ -163,7 +163,7 @@ ServerInterface::ServerInterface(const ghoul::Dictionary& config)
for (std::string_view k : dict.keys()) {
v.push_back(dict.value<std::string>(k));
}
list.set(v);
list = v;
}
};

View File

@@ -185,7 +185,7 @@ void Browser::updateBrowserSize() {
}
void Browser::reload() {
_reload.set(true);
_reload.trigger();
}
void Browser::setRatio(float ratio) {

View File

@@ -91,7 +91,7 @@ HorizonsTranslation::HorizonsTranslation(const ghoul::Dictionary& dictionary)
std::vector<std::string> files;
files.push_back(file);
_horizonsTextFiles.set(files);
_horizonsTextFiles = files;
}
else if (std::holds_alternative<std::vector<std::string>>(p.horizonsTextFile)) {
std::vector<std::string> files =

View File

@@ -387,7 +387,7 @@ SpoutReceiverPropertyProxy::SpoutReceiverPropertyProxy(properties::PropertyOwner
});
owner.addProperty(_updateSelection);
_updateSelection.set(0);
_updateSelection.trigger();
}
SpoutReceiverPropertyProxy::~SpoutReceiverPropertyProxy() {}

View File

@@ -1089,8 +1089,8 @@ void OrbitalNavigator::setFocusNode(const SceneGraphNode* focusNode,
}
void OrbitalNavigator::setFocusNode(const std::string& focusNode, bool) {
_anchor.set(focusNode);
_aim.set(std::string(""));
_anchor = focusNode;
_aim = std::string("");
}
void OrbitalNavigator::setAnchorNode(const SceneGraphNode* anchorNode,
@@ -1128,11 +1128,11 @@ void OrbitalNavigator::setAimNode(const SceneGraphNode* aimNode) {
}
void OrbitalNavigator::setAnchorNode(const std::string& anchorNode) {
_anchor.set(anchorNode);
_anchor = anchorNode;
}
void OrbitalNavigator::setAimNode(const std::string& aimNode) {
_aim.set(aimNode);
_aim = aimNode;
}
void OrbitalNavigator::updatePreviousAnchorState() {

View File

@@ -42,6 +42,10 @@ void TriggerProperty::set(std::any) {
notifyChangeListeners();
}
void TriggerProperty::trigger() {
notifyChangeListeners();
}
std::string TriggerProperty::jsonValue() const {
return "true";
}