you can’t yet i did that as a way to ensure that setting and removing a parent was safe since ofParameter handles all the listener stuff but not completely sure is the best way to go because of performance reasons so until it’s better tested and nobody complains that it’s slow it’s a private property and there’s no way to access it. if you want to change it in your code you can add some getters but be adviced that ofNode might change in the future and not use parameters.
Thank you Arturo.
I suspected there was a good reason for it to be like that.
So far i fixed it extending ofNode in a class where there is another ofParameter. I don-t like the idea of having two times the same thing and having to update back and forth… but it works…
So the new class looks like this:
class InteractiveNode : public ofNode {
void setup(glm::vec3 vector, float w, float h)
{
getPositionParameter().setName(name);
setPosition(vector);
// add a listener so that we update things when parameters are loaded from file
position.addListener(this, &InteractiveNode::_setPosition);
}
void _setPosition(glm::vec3 & vector)
{
setPosition(vector);
}
void customDraw();
void onPositionChanged(){
position.setWithoutEventNotifications(getPosition());
};
const string& getName() const;
ofParameter<glm::vec3>& getPositionParameter() {
return position;
}
private:
ofParameter<glm::vec3> position;
string name;
};
I also tried hacking ofNode class by adding a couple of public methods: