Commit 4e0a67e3 authored by pinter's avatar pinter
Browse files

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 << i1 << "<Model";

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

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
parent 9613ba22
......@@ -246,7 +246,7 @@ void vtkMRMLNodeTestHelper1::WriteXML(ostream& of, int nIndent)
vtkIndent indent(nIndent);
if (this->OtherNodeID != NULL)
{
of << indent << " OtherNodeRef=\"" << this->OtherNodeID << "\"";
of << " OtherNodeRef=\"" << this->OtherNodeID << "\"";
}
}
......@@ -290,10 +290,9 @@ void vtkMRMLStorageNodeTestHelper::SetSceneReferences()
void vtkMRMLStorageNodeTestHelper::WriteXML(ostream& of, int nIndent)
{
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
if (this->OtherNodeID != NULL)
{
of << indent << " OtherNodeRef=\"" << this->OtherNodeID << "\"";
of << " OtherNodeRef=\"" << this->OtherNodeID << "\"";
}
}
......
......@@ -75,43 +75,41 @@ void vtkMRMLAbstractViewNode::WriteXML(ostream& of, int nIndent)
this->Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
if (this->GetLayoutLabel())
{
of << indent << " layoutLabel=\"" << this->GetLayoutLabel() << "\"";
of << " layoutLabel=\"" << this->GetLayoutLabel() << "\"";
}
if (this->GetLayoutName())
{
of << indent << " layoutName=\"" << this->GetLayoutName() << "\"";
of << " layoutName=\"" << this->GetLayoutName() << "\"";
}
if (this->GetViewGroup() > 0)
{
of << indent << " viewGroup=\"" << this->GetViewGroup() << "\"";
of << " viewGroup=\"" << this->GetViewGroup() << "\"";
}
of << indent << " active=\"" << (this->Active ? "true" : "false") << "\"";
of << indent << " visibility=\"" << (this->Visibility ? "true" : "false") << "\"";
of << " active=\"" << (this->Active ? "true" : "false") << "\"";
of << " visibility=\"" << (this->Visibility ? "true" : "false") << "\"";
// background color
of << indent << " backgroundColor=\"" << this->BackgroundColor[0] << " "
of << " backgroundColor=\"" << this->BackgroundColor[0] << " "
<< this->BackgroundColor[1] << " " << this->BackgroundColor[2] << "\"";
of << indent << " backgroundColor2=\"" << this->BackgroundColor2[0] << " "
of << " backgroundColor2=\"" << this->BackgroundColor2[0] << " "
<< this->BackgroundColor2[1] << " " << this->BackgroundColor2[2] << "\"";
if (this->OrientationMarkerEnabled)
{
of << indent << " orientationMarkerType=\"" << this->GetOrientationMarkerTypeAsString(this->OrientationMarkerType) << "\"";
of << indent << " orientationMarkerSize=\"" << this->GetOrientationMarkerSizeAsString(this->OrientationMarkerSize) << "\"";
of << " orientationMarkerType=\"" << this->GetOrientationMarkerTypeAsString(this->OrientationMarkerType) << "\"";
of << " orientationMarkerSize=\"" << this->GetOrientationMarkerSizeAsString(this->OrientationMarkerSize) << "\"";
}
if (this->RulerEnabled)
{
of << indent << " rulerType=\"" << this->GetRulerTypeAsString(this->RulerType) << "\"";
of << " rulerType=\"" << this->GetRulerTypeAsString(this->RulerType) << "\"";
}
of << indent << " AxisLabels=\"";
of << " AxisLabels=\"";
for (int i=0; i<vtkMRMLAbstractViewNode::AxisLabelsCount; i++)
{
of << (i>0?";":"") << this->GetAxisLabel(i);
......
......@@ -79,30 +79,28 @@ void vtkMRMLCameraNode::WriteXML(ostream& of, int nIndent)
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
double *position = this->GetPosition();
of << indent << " position=\"" << position[0] << " "
of << " position=\"" << position[0] << " "
<< position[1] << " "
<< position[2] << "\"";
double *focalPoint = this->GetFocalPoint();
of << indent << " focalPoint=\"" << focalPoint[0] << " "
of << " focalPoint=\"" << focalPoint[0] << " "
<< focalPoint[1] << " "
<< focalPoint[2] << "\"";
double *viewUp = this->GetViewUp();
of << indent << " viewUp=\"" << viewUp[0] << " "
of << " viewUp=\"" << viewUp[0] << " "
<< viewUp[1] << " "
<< viewUp[2] << "\"";
of << indent << " parallelProjection=\"" << (this->GetParallelProjection() ? "true" : "false") << "\"";
of << " parallelProjection=\"" << (this->GetParallelProjection() ? "true" : "false") << "\"";
of << indent << " parallelScale=\"" << this->GetParallelScale() << "\"";
of << " parallelScale=\"" << this->GetParallelScale() << "\"";
if (this->GetActiveTag())
{
of << indent << " activetag=\"" << this->GetActiveTag() << "\"";
of << " activetag=\"" << this->GetActiveTag() << "\"";
}
if (this->GetAppliedTransform())
......@@ -123,9 +121,8 @@ void vtkMRMLCameraNode::WriteXML(ostream& of, int nIndent)
ss << " ";
}
}
of << indent << " appliedTransform=\"" << ss.str() << "\"";
of << " appliedTransform=\"" << ss.str() << "\"";
}
}
//----------------------------------------------------------------------------
......
......@@ -76,12 +76,9 @@ vtkMRMLChartNode::~vtkMRMLChartNode()
//----------------------------------------------------------------------------
void vtkMRMLChartNode::WriteXML(ostream& of, int nIndent)
{
// Start by having the superclass write its information
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
// Write all the IDs
of << " arrays=\"";
DoubleArrayIDMap::iterator it;
......@@ -114,7 +111,6 @@ void vtkMRMLChartNode::WriteXML(ostream& of, int nIndent)
}
}
of << "\"";
}
......
......@@ -53,8 +53,6 @@ void vtkMRMLChartViewNode::WriteXML(ostream& of, int nIndent)
{
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
if (this->ChartNodeID)
{
of << " chart=\"" << this->ChartNodeID << "\"";
......
......@@ -48,16 +48,14 @@ void vtkMRMLClipModelsNode::WriteXML(ostream& of, int nIndent)
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
of << " clipType=\"" << this->ClipType << "\"";
of << indent << " clipType=\"" << this->ClipType << "\"";
of << indent << " redSliceClipState=\"" << this->RedSliceClipState << "\"";
of << indent << " yellowSliceClipState=\"" << this->YellowSliceClipState << "\"";
of << indent << " greenSliceClipState=\"" << this->GreenSliceClipState << "\"";
of << " redSliceClipState=\"" << this->RedSliceClipState << "\"";
of << " yellowSliceClipState=\"" << this->YellowSliceClipState << "\"";
of << " greenSliceClipState=\"" << this->GreenSliceClipState << "\"";
if (this->ClippingMethod != vtkMRMLClipModelsNode::Straight)
{
of << indent << " clippingMethod=\"" << (this->GetClippingMethodAsString(this->ClippingMethod)) << "\"";
of << " clippingMethod=\"" << (this->GetClippingMethodAsString(this->ClippingMethod)) << "\"";
}
}
......
......@@ -67,8 +67,6 @@ void vtkMRMLColorNode::WriteXML(ostream& of, int nIndent)
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
of << " type=\"" << this->GetType() << "\"";
if (this->FileName != NULL)
......
......@@ -54,8 +54,6 @@ void vtkMRMLColorTableNode::WriteXML(ostream& of, int nIndent)
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
// only print out the look up table size so that the table can be
// initialized properly
if (this->LookupTable != NULL)
......
......@@ -55,63 +55,61 @@ void vtkMRMLCrosshairNode::WriteXML(ostream& of, int nIndent)
{
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
if ( this->CrosshairMode == vtkMRMLCrosshairNode::NoCrosshair )
{
of << indent << " crosshairMode=\"" << "NoCrosshair" << "\"";
of << " crosshairMode=\"" << "NoCrosshair" << "\"";
}
else if ( this->CrosshairMode == vtkMRMLCrosshairNode::ShowBasic )
{
of << indent << " crosshairMode=\"" << "ShowBasic" << "\"";
of << " crosshairMode=\"" << "ShowBasic" << "\"";
}
else if ( this->CrosshairMode == vtkMRMLCrosshairNode::ShowIntersection )
{
of << indent << " crosshairMode=\"" << "ShowIntersection" << "\"";
of << " crosshairMode=\"" << "ShowIntersection" << "\"";
}
else if ( this->CrosshairMode == vtkMRMLCrosshairNode::ShowHashmarks )
{
of << indent << " crosshairMode=\"" << "ShowHashmarks" << "\"";
of << " crosshairMode=\"" << "ShowHashmarks" << "\"";
}
else if ( this->CrosshairMode == vtkMRMLCrosshairNode::ShowAll )
{
of << indent << " crosshairMode=\"" << "ShowAll" << "\"";
of << " crosshairMode=\"" << "ShowAll" << "\"";
}
else if ( this->CrosshairMode == vtkMRMLCrosshairNode::ShowSmallBasic )
{
of << indent << " crosshairMode=\"" << "ShowSmallBasic" << "\"";
of << " crosshairMode=\"" << "ShowSmallBasic" << "\"";
}
else if ( this->CrosshairMode == vtkMRMLCrosshairNode::ShowSmallIntersection )
{
of << indent << " crosshairMode=\"" << "ShowSmallIntersection" << "\"";
of << " crosshairMode=\"" << "ShowSmallIntersection" << "\"";
}
of << indent << " navigation=\"" << (this->Navigation ? "true" : "false") << "\"";
of << " navigation=\"" << (this->Navigation ? "true" : "false") << "\"";
if ( this->CrosshairBehavior == vtkMRMLCrosshairNode::JumpSlice
|| this->CrosshairBehavior == vtkMRMLCrosshairNode::Normal )
{
of << indent << " crosshairBehavior=\"" << "JumpSlice" << "\"";
of << " crosshairBehavior=\"" << "JumpSlice" << "\"";
}
else if (this->CrosshairBehavior == vtkMRMLCrosshairNode::NoAction)
{
of << indent << " crosshairBehavior=\"" << "NoAction" << "\"";
of << " crosshairBehavior=\"" << "NoAction" << "\"";
}
if ( this->CrosshairThickness == vtkMRMLCrosshairNode::Fine )
{
of << indent << " crosshairThickness=\"" << "Fine" << "\"";
of << " crosshairThickness=\"" << "Fine" << "\"";
}
else if ( this->CrosshairThickness == vtkMRMLCrosshairNode::Medium )
{
of << indent << " crosshairThickness=\"" << "Medium" << "\"";
of << " crosshairThickness=\"" << "Medium" << "\"";
}
else if ( this->CrosshairThickness == vtkMRMLCrosshairNode::Thick )
{
of << indent << " crosshairThickness=\"" << "Thick" << "\"";
of << " crosshairThickness=\"" << "Thick" << "\"";
}
of << indent << " crosshairRAS=\"" << this->CrosshairRAS[0] << " "
of << " crosshairRAS=\"" << this->CrosshairRAS[0] << " "
<< this->CrosshairRAS[1] << " " << this->CrosshairRAS[2] << "\"";
}
......
......@@ -65,19 +65,18 @@ void vtkMRMLDiffusionImageVolumeNode::WriteXML(ostream& of, int nIndent)
{
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
std::stringstream ss;
if (this->BaselineNodeID != NULL)
{
of << indent << " baselineNodeRef=\"" << this->BaselineNodeID << "\"";
of << " baselineNodeRef=\"" << this->BaselineNodeID << "\"";
}
if (this->DiffusionWeightedNodeID != NULL)
{
of << indent << " diffusionWeightedNodeRef=\"" << this->DiffusionWeightedNodeID << "\"";
of << " diffusionWeightedNodeRef=\"" << this->DiffusionWeightedNodeID << "\"";
}
if (this->MaskNodeID != NULL)
{
of << indent << " maskNodeRef=\"" << this->MaskNodeID << "\"";
of << " maskNodeRef=\"" << this->MaskNodeID << "\"";
}
}
......
......@@ -85,21 +85,19 @@ void vtkMRMLDiffusionTensorDisplayPropertiesNode::WriteXML(ostream& of, int nInd
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
of << indent << " glyphGeometry=\"" << this->GlyphGeometry << "\"";
of << indent << " colorGlyphBy=\"" << this->ColorGlyphBy << "\"";
of << indent << " glyphScaleFactor=\"" << this->GlyphScaleFactor << "\"";
of << indent << " glyphEigenvector=\"" << this->GlyphEigenvector << "\"";
of << indent << " glyphExtractEigenvalues=\"" << this->GlyphExtractEigenvalues << "\"";
of << indent << " lineGlyphResolution=\"" << this->LineGlyphResolution << "\"";
of << indent << " tubeGlyphRadius=\"" << this->TubeGlyphRadius << "\"";
of << indent << " tubeGlyphNumberOfSides=\"" << this->TubeGlyphNumberOfSides << "\"";
of << indent << " ellipsoidGlyphThetaResolution=\"" << this->EllipsoidGlyphThetaResolution << "\"";
of << indent << " ellipsoidGlyphPhiResolution=\"" << this->EllipsoidGlyphPhiResolution << "\"";
of << indent << " superquadricGlyphGamma=\"" << this->SuperquadricGlyphGamma << "\"";
of << indent << " superquadricGlyphThetaResolution=\"" << this->SuperquadricGlyphThetaResolution << "\"";
of << indent << " superquadricGlyphPhiResolution=\"" << this->SuperquadricGlyphPhiResolution << "\"";
of << " glyphGeometry=\"" << this->GlyphGeometry << "\"";
of << " colorGlyphBy=\"" << this->ColorGlyphBy << "\"";
of << " glyphScaleFactor=\"" << this->GlyphScaleFactor << "\"";
of << " glyphEigenvector=\"" << this->GlyphEigenvector << "\"";
of << " glyphExtractEigenvalues=\"" << this->GlyphExtractEigenvalues << "\"";
of << " lineGlyphResolution=\"" << this->LineGlyphResolution << "\"";
of << " tubeGlyphRadius=\"" << this->TubeGlyphRadius << "\"";
of << " tubeGlyphNumberOfSides=\"" << this->TubeGlyphNumberOfSides << "\"";
of << " ellipsoidGlyphThetaResolution=\"" << this->EllipsoidGlyphThetaResolution << "\"";
of << " ellipsoidGlyphPhiResolution=\"" << this->EllipsoidGlyphPhiResolution << "\"";
of << " superquadricGlyphGamma=\"" << this->SuperquadricGlyphGamma << "\"";
of << " superquadricGlyphThetaResolution=\"" << this->SuperquadricGlyphThetaResolution << "\"";
of << " superquadricGlyphPhiResolution=\"" << this->SuperquadricGlyphPhiResolution << "\"";
}
//----------------------------------------------------------------------------
......
......@@ -89,10 +89,7 @@ void vtkMRMLDiffusionTensorVolumeDisplayNode::WriteXML(ostream& of, int nIndent)
{
this->Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
of << indent << " scalarInvariant=\"" << this->ScalarInvariant << "\"";
of << " scalarInvariant=\"" << this->ScalarInvariant << "\"";
}
//----------------------------------------------------------------------------
......
......@@ -62,19 +62,14 @@ vtkMRMLDiffusionTensorVolumeSliceDisplayNode::~vtkMRMLDiffusionTensorVolumeSlice
//----------------------------------------------------------------------------
void vtkMRMLDiffusionTensorVolumeSliceDisplayNode::WriteXML(ostream& of, int nIndent)
{
// Write all attributes not equal to their defaults
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
if (this->DiffusionTensorDisplayPropertiesNodeID != NULL)
{
of << indent << " DiffusionTensorDisplayPropertiesNodeRef=\"" << this->DiffusionTensorDisplayPropertiesNodeID << "\"";
of << " DiffusionTensorDisplayPropertiesNodeRef=\"" << this->DiffusionTensorDisplayPropertiesNodeID << "\"";
}
}
......
......@@ -51,11 +51,9 @@ void vtkMRMLDiffusionWeightedVolumeDisplayNode::WriteXML(ostream& of, int nInden
{
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
std::stringstream ss;
ss << this->DiffusionComponent;
of << indent << " diffusionComponent=\"" << ss.str() << "\"";
of << " diffusionComponent=\"" << ss.str() << "\"";
}
//----------------------------------------------------------------------------
......
......@@ -66,7 +66,6 @@ void vtkMRMLDiffusionWeightedVolumeNode::WriteXML(ostream& of, int nIndent)
{
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
std::stringstream ss;
for(int i=0; i<3; i++)
{
......@@ -79,7 +78,7 @@ void vtkMRMLDiffusionWeightedVolumeNode::WriteXML(ostream& of, int nIndent)
}
}
}
of << indent << " measurementFrameMatrix=\"" << ss.str() << "\"";
of << " measurementFrameMatrix=\"" << ss.str() << "\"";
ss.clear();
......@@ -91,7 +90,7 @@ void vtkMRMLDiffusionWeightedVolumeNode::WriteXML(ostream& of, int nIndent)
}
}
of << indent << " gradients=\"" << ss.str() << "\"";
of << " gradients=\"" << ss.str() << "\"";
ss.clear();
......@@ -99,8 +98,7 @@ void vtkMRMLDiffusionWeightedVolumeNode::WriteXML(ostream& of, int nIndent)
{
ss << this->BValues->GetValue(g) << " ";
}
of << indent << " bValues=\"" << ss.str() << "\"";
of << " bValues=\"" << ss.str() << "\"";
}
//----------------------------------------------------------------------------
......
......@@ -111,72 +111,70 @@ void vtkMRMLDisplayNode::WriteXML(ostream& of, int nIndent)
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
of << indent << " color=\"" << this->Color[0] << " "
of << " color=\"" << this->Color[0] << " "
<< this->Color[1] << " "
<< this->Color[2] << "\"";
of << indent << " edgeColor=\"" << this->EdgeColor[0] << " "
of << " edgeColor=\"" << this->EdgeColor[0] << " "
<< this->EdgeColor[1] << " " << this->EdgeColor[2] << "\"";
of << indent << " selectedColor=\"" << this->SelectedColor[0] << " "
of << " selectedColor=\"" << this->SelectedColor[0] << " "
<< this->SelectedColor[1] << " "
<< this->SelectedColor[2] << "\"";
of << indent << " selectedAmbient=\"" << this->SelectedAmbient << "\"";
of << " selectedAmbient=\"" << this->SelectedAmbient << "\"";
of << indent << " ambient=\"" << this->Ambient << "\"";
of << " ambient=\"" << this->Ambient << "\"";
of << indent << " diffuse=\"" << this->Diffuse << "\"";
of << " diffuse=\"" << this->Diffuse << "\"";
of << indent << " selectedSpecular=\"" << this->SelectedSpecular << "\"";
of << " selectedSpecular=\"" << this->SelectedSpecular << "\"";
of << indent << " specular=\"" << this->Specular << "\"";
of << " specular=\"" << this->Specular << "\"";
of << indent << " power=\"" << this->Power << "\"";
of << " power=\"" << this->Power << "\"";
of << indent << " opacity=\"" << this->Opacity << "\"";
of << indent << " sliceIntersectionOpacity=\"" << this->SliceIntersectionOpacity << "\"";
of << " opacity=\"" << this->Opacity << "\"";
of << " sliceIntersectionOpacity=\"" << this->SliceIntersectionOpacity << "\"";
of << indent << " pointSize=\"" << this->PointSize << "\"";
of << indent << " lineWidth=\"" << this->LineWidth << "\"";
of << indent << " representation=\"" << this->Representation << "\"";
of << indent << " lighting=\"" << (this->Lighting? "true" : "false") << "\"";
of << indent << " interpolation=\"" << this->Interpolation << "\"";
of << indent << " shading=\"" << (this->Shading? "true" : "false") << "\"";
of << " pointSize=\"" << this->PointSize << "\"";
of << " lineWidth=\"" << this->LineWidth << "\"";
of << " representation=\"" << this->Representation << "\"";
of << " lighting=\"" << (this->Lighting? "true" : "false") << "\"";
of << " interpolation=\"" << this->Interpolation << "\"";
of << " shading=\"" << (this->Shading? "true" : "false") << "\"";
of << indent << " visibility=\"" << (this->Visibility ? "true" : "false") << "\"";
of << indent << " edgeVisibility=\"" << (this->EdgeVisibility? "true" : "false") << "\"";
of << indent << " clipping=\"" << (this->Clipping ? "true" : "false") << "\"";
of << " visibility=\"" << (this->Visibility ? "true" : "false") << "\"";
of << " edgeVisibility=\"" << (this->EdgeVisibility? "true" : "false") << "\"";
of << " clipping=\"" << (this->Clipping ? "true" : "false") << "\"";
of << indent << " sliceIntersectionVisibility=\"" << (this->SliceIntersectionVisibility ? "true" : "false") << "\"";
of << " sliceIntersectionVisibility=\"" << (this->SliceIntersectionVisibility ? "true" : "false") << "\"";
of << indent << " sliceIntersectionThickness=\"" << this->SliceIntersectionThickness << "\"";
of << " sliceIntersectionThickness=\"" << this->SliceIntersectionThickness << "\"";
of << indent << " frontfaceCulling=\"" << (this->FrontfaceCulling ? "true" : "false") << "\"";
of << indent << " backfaceCulling=\"" << (this->BackfaceCulling ? "true" : "false") << "\"";
of << " frontfaceCulling=\"" << (this->FrontfaceCulling ? "true" : "false") << "\"";
of << " backfaceCulling=\"" << (this->BackfaceCulling ? "true" : "false") << "\"";
of << indent << " scalarVisibility=\"" << (this->ScalarVisibility ? "true" : "false") << "\"";
of << " scalarVisibility=\"" << (this->ScalarVisibility ? "true" : "false") << "\"";
of << indent << " vectorVisibility=\"" << (this->VectorVisibility ? "true" : "false") << "\"";
of << " vectorVisibility=\"" << (this->VectorVisibility ? "true" : "false") << "\"";
of << indent << " tensorVisibility=\"" << (this->TensorVisibility ? "true" : "false") << "\"";
of << " tensorVisibility=\"" << (this->TensorVisibility ? "true" : "false") << "\"";
of << indent << " interpolateTexture=\"" << (this->InterpolateTexture ? "true" : "false") << "\"";
of << " interpolateTexture=\"" << (this->InterpolateTexture ? "true" : "false") << "\"";
of << indent << " scalarRangeFlag=\"" << this->GetScalarRangeFlagTypeAsString(this->ScalarRangeFlag) << "\"";
of << " scalarRangeFlag=\"" << this->GetScalarRangeFlagTypeAsString(this->ScalarRangeFlag) << "\"";
of << indent << " scalarRange=\"" << this->ScalarRange[0] << " "
of << " scalarRange=\"" << this->ScalarRange[0] << " "
<< this->ScalarRange[1] << "\"";
if (this->ColorNodeID != NULL)
{
of << indent << " colorNodeID=\"" << this->ColorNodeID << "\"";
of << " colorNodeID=\"" << this->ColorNodeID << "\"";
}
if (this->ActiveScalarName != NULL)
{
of << indent << " activeScalarName=\"" << this->ActiveScalarName << "\"";
of << " activeScalarName=\"" << this->ActiveScalarName << "\"";
}
std::stringstream ss;
......@@ -191,7 +189,7 @@ void vtkMRMLDisplayNode::WriteXML(ostream& of, int nIndent)
}
if (this->ViewNodeIDs.size() > 0)
{
of << indent << " viewNodeRef=\"" << ss.str().c_str() << "\"";
of << " viewNodeRef=\"" << ss.str().c_str() << "\"";
}
of << " ";
......
......@@ -52,14 +52,12 @@ void vtkMRMLDisplayableHierarchyNode::WriteXML(ostream& of, int nIndent)
Superclass::WriteXML(of, nIndent);
vtkIndent indent(nIndent);
if (this->DisplayNodeID != NULL)
{
of << indent << " displayNodeID=\"" << this->DisplayNodeID << "\"";
of << " displayNodeID=\"" << this->DisplayNodeID << "\"";
}
of << indent << " expanded=\"" << (this->Expanded ? "true" : "false") << "\"";
of << " expanded=\"" << (this->Expanded ? "true" : "false") << "\"";
}
//----------------------------------------------------------------------------
......
......@@ -86,7 +86,6 @@ void vtkMRMLFiducialListNode::WriteXML(ostream& of, int nIndent)
// rest is saved in the storage node file, but it needs to be here as well
// due to the way the scene snapshots are handled (storage nodes are not re-read)
vtkIndent indent(nIndent);
of << " symbolScale=\"" <<