STYLE: Use static member variables for reference roles and attribute name

Issue #2727

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22186 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Copy NodeReferenceMRMLAttributeNames in vtkMRMLNode::Copy()

Issue #2727

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22187 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Add support for node reference templates

In vtkMRMLSelectionNode, the exact name of the reference roles of a unit is
not known until the unit is set and observed. (it's a dynamic number of
unit reference roles). By using a special key '/' in the reference role
(e.g. "unit/"), it is possible to have multiple reference roles
(e.g. "unit/length", "unit/time"...).
Issue #2727

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22188 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Restore the selection node units on scene close

Re-enable Units module.
Closes #3176, #3152

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22189 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Improve qMRMLUnitWidget interface

QFlags were added to this widget so one can choose what properties are
visible or not. This is what is done in the qSlicerUnitsSettingsPanel to
hide the advanced properties of the unit to the user. By default, the user
can only modify the precision property.
If he choose to show more properties, a warning stating that only display
values are changed when modifying an unit is shown along with the other
properties.

Style wise, the groupbox title now has its first letter in uppercase to
follow the GUI conventions and a horizontale line in the
qMRMLUnitNodeWidget between the precision and the rest of the properties.

See Issue #3137

From: Johan Andruejohl <johan.andruejohl@kitware.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22190 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix modules depending on units

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22191 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Add vtkMRMLUnitNode::GetDisplayStringFromValue

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22192 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix Volumes module decimals behavior

* make sure qMRMLVolumeInfoWidget gets setMRMLScene called before
the current volume node combobox. This is important because
qMRMLSliderWidget can change the number of decimals from the units node.
Such decimal number should be overwritten by the value of the spacing (or
origin).

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22193 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Disable Apply button when CLI has a Completing status

If the user clicks frenetically on the Apply button, it was eventually
generating an assert in vtkSlicerCLIModuleLogic::ProcessMRMLLogicsEvents
because the button was clicked when the CLI was still "Completing".
Issue #2915

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22194 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Make vtkMRMLApplicationLogic::InvokeEventWithDelay thread-safe

If InvokeEventWithDelay was called from a different thread,
the AutoConnection in qSlicerCoreApplication was queuing the signal
therefore the InvokeRequest was deleted before the requestInvokeEvent()
slot was called.
Issue #2915

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22195 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix random crash in CLI when writing in output volume node

itkMRMLIDImageIO::Write was triggering node events (such as
vtkMRMLVolumeNode::ImageDataModifiedEvent) in a thread other than
the main thread.
The solution is to catch those events before any observer is notified,
and reschedule those events in the main thread.

Closes #2915

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22196 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Improve robustness of vtkMRMLScalarVolumeDisplayNode

Setting back the DisableModifiedEvent to 0 could be dangerous if the
node ModifiedEvent was already disabled before ProcessMRMLEvents is called.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22197 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: adding SimpleFilters as internal modules via externalproject

Following the example of MultiVolumeImporter, a new external project
was added to download the SimpleFilters repository, the source
directory is propagated into the Slicer project and it is added as a
sub-directory to the build in scripted modules.