Import 2017-06-07 23:51:09: master 4e0a67e3

Author Committer Branch Timestamp Parent
pinter pinter master 2017-03-24 13:05:10 master 9613ba22
Changeset

STYLE: Indentation related changes

  1. vtkMRMLNode::Indent member seemed unused in the core, except from the also unused ROI list node, so the member was removed

  2. In WriteXML functions, the increasing indentation was added between the XML attributes, which did not have major effect on the top level, but for example in the scene view section, where indentation was increased, it made the nodes look like this:

    <Selection
    id="vtkMRMLSelectionNodeSingleton" name="Selection" hideFromEditors="true" selectable="true" selected="false" singletonTag="Singleton"

As the purpose of indentation is to add space in front of the lines, adding that space between the XML attributes seems unnecessary. With these changes, the same entry now looks like this:

<Selection
id="vtkMRMLSelectionNodeSingleton" name="Selection" hideFromEditors="true" selectable="true" selected="false"

History:

In the first implementation of WriteXML(), the name of the node (e.g vtkMRMLModelNode.cxx) was explicitly serialized and indented in the function by explicitly using nIndent.
See r40 (COMP: added vtkITK and MRML libs). Code like this was used:

vtkIndent i1(nIndent);
of &lt;&lt; i1 &lt;&lt; &quot;&lt;Model&quot;;

of &lt;&lt; &quot; id='&quot; &lt;&lt; this->ID &lt;&lt; &quot;'&quot;;
if (this->Name && strcmp(this->Name, &quot;&quot;))
{
  of &lt;&lt; &quot; name='&quot; &lt;&lt; this->Name &lt;&lt; &quot;'&quot;;
}
[...]
if (this->Color && strcmp(this->Color, &quot;&quot;))
{
  of &lt;&lt; &quot; color='&quot; &lt;&lt; this->Color &lt;&lt; &quot;'&quot;;
}

Then, this approach was reviewed in r133 (ENH: more transform functionality) by systematically calling the base class implementation of WriteXML() function.

Code above was then updated like this:

Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);

if (this->Color && strcmp(this->Color, ""))
{
of << indent << " color='" << this->Color << "'";
}

This commit simplifies the XML serialization and explicitly mark indent parameter as deprecated.

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

mod - Libs/MRML/Core/Testing/vtkMRMLNodeTest1.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLAbstractViewNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLCameraNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLChartNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLChartViewNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLClipModelsNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLColorNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLColorTableNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLCrosshairNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDiffusionImageVolumeNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDiffusionTensorDisplayPropertiesNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDiffusionTensorVolumeDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDiffusionTensorVolumeSliceDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDiffusionWeightedVolumeDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDiffusionWeightedVolumeNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDisplayableHierarchyNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLFiducialListNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLFreeSurferProceduralColorNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLGlyphableVolumeDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLGlyphableVolumeSliceDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLHierarchyNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLInteractionNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLLayoutNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLLinearTransformNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLMarkupsStorageNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLNRRDStorageNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLNode.h Diff File
mod - Libs/MRML/Core/vtkMRMLROIListNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLROINode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLScalarVolumeDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLScene.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSceneViewNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLScriptedModuleNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSegmentationStorageNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSelectionNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSliceCompositeNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSliceNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSnapshotClipNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLStorableNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLStorageNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSubjectHierarchyLegacyNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTableNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTableViewNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTensorVolumeNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTransformDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTransformNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLUnitNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLVectorVolumeDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLVectorVolumeNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLViewNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLVolumeHeaderlessStorageNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLVolumeNode.cxx Diff File
mod - Libs/vtkSegmentationCore/vtkSegment.cxx Diff File
mod - Libs/vtkSegmentationCore/vtkSegmentation.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationAngleNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationBidimensionalNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationControlPointsNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationLineDisplayNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationLinesNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationPointDisplayNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationROINode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationRulerNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationSnapshotNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationSplineNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationTextDisplayNode.cxx Diff File
mod - Modules/Loadable/AtlasCreator/Logic/vtkMRMLAtlasCreatorNode.cxx Diff File
mod - Modules/Loadable/CropVolume/MRML/vtkMRMLCropVolumeParametersNode.cxx Diff File
mod - Modules/Loadable/Markups/MRML/vtkMRMLMarkupsFiducialNode.cxx Diff File
mod - Modules/Loadable/Markups/MRML/vtkMRMLMarkupsNode.cxx Diff File
mod - Modules/Loadable/MultiVolumeRendering/MRML/vtkMRMLMultiVolumeRenderingDisplayNode.cxx Diff File
mod - Modules/Loadable/Segmentations/MRML/vtkMRMLSegmentEditorNode.cxx Diff File
mod - Modules/Loadable/VolumeRendering/MRML/vtkMRMLCPURayCastVolumeRenderingDisplayNode.cxx Diff File
mod - Modules/Loadable/VolumeRendering/MRML/vtkMRMLGPURayCastVolumeRenderingDisplayNode.cxx Diff File
mod - Modules/Loadable/VolumeRendering/MRML/vtkMRMLVolumePropertyNode.cxx Diff File
mod - Modules/Loadable/VolumeRendering/MRML/vtkMRMLVolumeRenderingDisplayNode.cxx Diff File
mod - Modules/Loadable/VolumeRendering/MRML/vtkMRMLVolumeRenderingScenarioNode.cxx Diff File