Page MenuHomePhabricator

DataTreeNode should raise modified event whenever the Node`s property list was modified
Closed, ResolvedPublic

Description

This would really ease the handling of DataTreeNodes

Event Timeline

This is a design choice. As far as I know, ITK objects that hold SmartPointer
to other objects do not get modified, if the objects that they hold get
modified.

In your case, PropertyList should maybe have a convenience event
"ContainedNodeModified". (The Modified event of PropertyList should only be
emitted if the list is changed, e.g. nodes removed or added.)

i dont get it ;)
the propertylist does not know anything about the DataTreeNode it belongs to.
Yes, it is a design choice. And in this case it would make sense as the PropertyList is a dynamic way to change the information in a DataTreeNode.
Lets say you would not take a PropertyList but rather design special derivations of the DataTreeNode like ImageDataTreeNodes, ... In this case you would have getter and setter methods like SetOpacity(), SetVisible(), etc.
Of course, you would call Modified() in this setter methods, dont you ? ;)

(In reply to comment #1)

(The Modified event of PropertyList should only be
emitted if the list is changed, e.g. nodes removed or added.)

<-- this should spell 'e.g. properties removed or added'

(In reply to comment #2)

Lets say you would not take a PropertyList but rather design special
derivations of the DataTreeNode like ImageDataTreeNodes, ... In this case you
would have getter and setter methods like SetOpacity(), SetVisible(), etc.
Of course, you would call Modified() in this setter methods, dont you ? ;)

Yes I would, but we have a different implementation and there, I would not. ;)
Still, it is a question of coding style, we just have to decide how to do it. Im my experience, the ITK guys don't 'collect & forward' events.

Hi Michi,

can you please explain better which or how the "handling" of DataTreeNotes would be improved?

see Wiki Specification Page: If one wants to know if a DataTreeNode was modified somehow, you have to listen to the DataTreeNode itself and its PropertyList and/or to single Propertis forcing you to hold long lists of oberserver tags and writing repetetive code

Hi, your bug is resolved, can you please remove the needs_core_modification request (set it to - or nothing)? Otherwise it clutters the list of open requests which is not filterable by status.

This will help granting the flag for open bugs much faster ;)