Import 2017-06-07 23:51:09: master 236c03fd

Author Committer Branch Timestamp Parent
jcfr jcfr master 2014-12-01 14:12:14 master 5ebec949
Changeset

BUG: Ensure RemoveAllMarkups also invoke MarkupRemovedEvent

This commit improve the API consistency by ensuring the event will
be sent also if RemoveAllMarkups is called.

Similarly, the function "SetLocked" is called instead of directly
setting the ivar, doing so will ensure that the LockModifiedEvent
is also invoked.

Note that the pair StartModify/EndModify is used to ensure the ModifedEvent
associated with the markups node is invoked at the end if it applies.

For sake of consistency, the function RemoveAllTexts() has been added.
Since no text is added/removed when function Add/RemoveMarkup are called,
it doesn't make sense to clear the text when removing markups.

Running the test py_AddManyMarkupsFiducialTest doesn't show any decrease
in time with/without this patch. (Ubuntu 13.10 / debug build)

With: 24.17 sec, 26.65 sec, 24.01 sec (3 runs)
Without: 26.59 sec, 27.04 sec, 24.72 sec (3 runs)

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23809 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Modules/Loadable/Markups/MRML/vtkMRMLMarkupsNode.cxx Diff File
mod - Modules/Loadable/Markups/MRML/vtkMRMLMarkupsNode.h Diff File