BUG: fix type of argument to SetGridExtent for LandmarkRegistration

Exposed by vtk v5 vs v6 testing.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23434 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix infinite loop when opening or closing a scene

This commit fixes a regression introduced by commit r23191.

Commit r23191 simplified the code introducing smart pointer, typedefs and
also updated "SetNthNodeReferenceID" and "SetAndObserveNthNodeReferenceID"
so that they have have similar code. It turns out that after this update
new reference where systematically created with an ID being an empty string
instead of being a NULL string.

Commits following r23191 also updated the MRML reference system and
attempted to fix what was most likely an issue with the "SetNth" methods.
See r23192, r23196]. These commits fixes the behavior of the SetNth methods
so that setting a reference N was always returning the
associated reference if the reference n-1 was removed.

It turned out that these changes caused more trouble than expected and
to fully support the new behavior, major and backward incompatible changes
in the displayable and storable nodes and also in the scene serialization
would have occur. For that reason, commit r23395 and r23414 have been
integrated to revert all commit updating the behavior but keeping the
"smart pointer" and "typedefs" updates around.

It is only by "reverting" these last commit that the issue fixed by
this commit was revealed.

Note for later:

 * In method almost doing the same thing, do not comment code without
clearly mentioning the reason.

 * If very similar functions are doing almost the same thing, re-factoring
the code is key to reduce the maintenance burden.

Finally, this commit also update method "UpdateNthNodeReference"
to set the ReferencingNode (it was done before the commit introducing
smart pointers), the questions are "Why is this needed ?" and
"What is causing the reference to be dissociated from a referencing node?"

Fixes #3754
Fixes #3768

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23435 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix crash in vtkMRMLNode::UpdateNthNodeReference

This commit fixes regression introduced in previous commit r23435.
Interestingly the message in previous commit raised the question about
the assignment ReferencingNode. It turns out that the method
UpdateNthNodeReference was indirectly called after destroying the
referencing node.

The following pseudo stack trace illustrates the issue:

(obtained while running the test "vtkMRMLVolumeNodeTest1"

Destructor of vtkMRMLVolumeNode (referencing node)
-> SetImageDataConnection(0)
-> SetImageDataToDisplayNodes()
-> GetNthDisplayNode(n)
-> GetNthNodeReference()
-> UpdateNthNodeReference(referenceRole, n)
-> UpdateNthNodeReference(reference, n)
this->ReferencingNode = this

Since ReferencingNode is a weakpointer to the object represented by "this"
and was indirectly called in the destructor of "this", this was
causing a double free or corruption error. It was reported in valgrind
as a "invalid read of size 8".

The test is now passing. But valgrind is still reporting the error
like this one:

Generic Warning: In /home/jchris/Projects/Slicer-2-SuperBuild-Debug/VTKv6/Common/Core/vtkDebugLeaks.cxx, line 292
Deleting unknown object: vtkMRMLVolumeNodeTestHelper1

They will be fixed in follow-up commit.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23436 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Add vtkMRMLDisplayableNode method definition to cpp file.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23437 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Add vtkMRMLStorableNode method definition to cpp file.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23438 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix "Deleting Unknown Object" warning in mrml node tests

This commits (1) changes the helper node class name associated with the
hierarchy node to be unique and (2) updates the helper node definitions
to be consistent with the helper node declared in vtkMRMLNodeTest1.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23439 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix valgrind issues in vtkMRMLVolumeNodeTest1

This commit fixes regression introduced by commit r19917. Instead
of re-implementing Get{I,J,K}ToRASDirection methods, the
macro "TEST_SET_GET_VECTOR3_DOUBLE_RANDOM" has been updated to directly
use the Set/Get method of the object. It then (1) avoids to return a
pointer and (2) avoids to access possibly uninitialized value with the
bracket operator.

Valgrind errors like this one are fixed:

[...]

==20657== Conditional jump or move depends on uninitialised value(s)
==20657==    at 0x626297: vtkMRMLVolumeNodeTest1(int, char**) (vtkMRMLVolumeNodeTest1.cxx:114)
==20657==    by 0x4717DC: main (MRMLCoreCxxTests.cxx:616)

[...]

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