Commit f830ff47 authored by Kitware Robot's avatar Kitware Robot Committed by David Gobbi

Reindent using the reindentation script.

This commit reindents the code with the following utility:
Utilities/Maintenance/vtk-reindent-code.py

This utility changes the positions of the braces so that they are no
longer indented relative to the code block they reside in.

The bash command line used was the following:

for d in Charts Common Deprecated Domains Examples Filters GUISupport \
         Geovis IO Imaging Infovis Interaction Parallel Rendering \
         Testing Views Web Wrapping; do
  for e in cxx cxx.in txx txx.in hxx hxx.in h h.in c c.in; do
    find "${d}" -name "*.${e}" -exec \
      python Utilities/Maintenance/vtk_reindent_code.py {} +
  done
done
parent 6a7e5148

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

...@@ -68,7 +68,7 @@ int TestAreaPlot( int, char * [] ) ...@@ -68,7 +68,7 @@ int TestAreaPlot( int, char * [] )
float inc = 7.5 / (numPoints-1); float inc = 7.5 / (numPoints-1);
table->SetNumberOfRows(numPoints); table->SetNumberOfRows(numPoints);
for (int i = 0; i < numPoints; ++i) for (int i = 0; i < numPoints; ++i)
{ {
table->SetValue(i, 0, i * inc + 0.01); table->SetValue(i, 0, i * inc + 0.01);
table->SetValue(i, 1, cos(i * inc) + 0.01); table->SetValue(i, 1, cos(i * inc) + 0.01);
table->SetValue(i, 2, sin(i * inc) + 0.01); table->SetValue(i, 2, sin(i * inc) + 0.01);
...@@ -77,7 +77,7 @@ int TestAreaPlot( int, char * [] ) ...@@ -77,7 +77,7 @@ int TestAreaPlot( int, char * [] )
table->SetValue(i, 5, 1.0); table->SetValue(i, 5, 1.0);
validMask->SetValue(i, (i > 30 && i < 40) ? 0 : 1); validMask->SetValue(i, (i > 30 && i < 40) ? 0 : 1);
} }
// Add multiple line plots, setting the colors etc // Add multiple line plots, setting the colors etc
vtkPlotArea* area = vtkPlotArea::SafeDownCast(chart->AddPlot(vtkChart::AREA)); vtkPlotArea* area = vtkPlotArea::SafeDownCast(chart->AddPlot(vtkChart::AREA));
......
...@@ -50,7 +50,7 @@ int TestAxes(int , char * []) ...@@ -50,7 +50,7 @@ int TestAxes(int , char * [])
std::vector<vtkSmartPointer<vtkAxis> > axesVertical(4); std::vector<vtkSmartPointer<vtkAxis> > axesVertical(4);
for (size_t i = 0; i < axesVertical.size(); ++i) for (size_t i = 0; i < axesVertical.size(); ++i)
{ {
axesVertical[i] = vtkSmartPointer<vtkAxis>::New(); axesVertical[i] = vtkSmartPointer<vtkAxis>::New();
vtkAxis *axis = axesVertical[i].GetPointer(); vtkAxis *axis = axesVertical[i].GetPointer();
axis->SetPoint1(vtkVector2f(i * 69 + 30, 10)); axis->SetPoint1(vtkVector2f(i * 69 + 30, 10));
...@@ -60,7 +60,7 @@ int TestAxes(int , char * []) ...@@ -60,7 +60,7 @@ int TestAxes(int , char * [])
axis->SetRange(-1, 50); axis->SetRange(-1, 50);
view->GetScene()->AddItem(axis); view->GetScene()->AddItem(axis);
} }
// Exercise some of the API in the axis API. // Exercise some of the API in the axis API.
axesVertical[0]->AutoScale(); axesVertical[0]->AutoScale();
...@@ -85,15 +85,15 @@ int TestAxes(int , char * []) ...@@ -85,15 +85,15 @@ int TestAxes(int , char * [])
axesVertical[3]->AutoScale(); axesVertical[3]->AutoScale();
for (size_t i = 0; i < axesVertical.size(); ++i) for (size_t i = 0; i < axesVertical.size(); ++i)
{ {
axesVertical[i]->Update(); axesVertical[i]->Update();
} }
// Let's create a few axes, and place them on the scene. // Let's create a few axes, and place them on the scene.
std::vector<vtkSmartPointer<vtkAxis> > axesHorizontal(6); std::vector<vtkSmartPointer<vtkAxis> > axesHorizontal(6);
for (size_t i = 0; i < axesHorizontal.size(); ++i) for (size_t i = 0; i < axesHorizontal.size(); ++i)
{ {
axesHorizontal[i] = vtkSmartPointer<vtkAxis>::New(); axesHorizontal[i] = vtkSmartPointer<vtkAxis>::New();
vtkAxis *axis = axesHorizontal[i].GetPointer(); vtkAxis *axis = axesHorizontal[i].GetPointer();
axis->SetPoint1(vtkVector2f(310, i * 50 + 30)); axis->SetPoint1(vtkVector2f(310, i * 50 + 30));
...@@ -103,7 +103,7 @@ int TestAxes(int , char * []) ...@@ -103,7 +103,7 @@ int TestAxes(int , char * [])
view->GetScene()->AddItem(axis); view->GetScene()->AddItem(axis);
axis->Update(); axis->Update();
} }
// Now to test some of the API in the horizontal axes. // Now to test some of the API in the horizontal axes.
axesHorizontal[0]->LogScaleOn(); // LogScaleActive=false because min*max<0 axesHorizontal[0]->LogScaleOn(); // LogScaleActive=false because min*max<0
...@@ -112,10 +112,10 @@ int TestAxes(int , char * []) ...@@ -112,10 +112,10 @@ int TestAxes(int , char * [])
axesHorizontal[0]->GetRange(range); axesHorizontal[0]->GetRange(range);
if (!axesHorizontal[0]->GetLogScaleActive() || if (!axesHorizontal[0]->GetLogScaleActive() ||
fabs(range[0]) > 1e-8 || fabs(range[1] - 2.) > 1e-8) fabs(range[0]) > 1e-8 || fabs(range[1] - 2.) > 1e-8)
{ {
cerr << "ERROR: did not transition to log scaling when range changed.\n"; cerr << "ERROR: did not transition to log scaling when range changed.\n";
status = EXIT_FAILURE; status = EXIT_FAILURE;
} }
// Now change the axis limits in log-space... // Now change the axis limits in log-space...
axesHorizontal[0]->SetMinimumLimit(-1.); axesHorizontal[0]->SetMinimumLimit(-1.);
axesHorizontal[0]->SetMaximumLimit(3.); axesHorizontal[0]->SetMaximumLimit(3.);
...@@ -123,19 +123,19 @@ int TestAxes(int , char * []) ...@@ -123,19 +123,19 @@ int TestAxes(int , char * [])
if ( if (
fabs(axesHorizontal[0]->GetUnscaledMinimumLimit()-0.1) > 1e-8 || fabs(axesHorizontal[0]->GetUnscaledMinimumLimit()-0.1) > 1e-8 ||
fabs(axesHorizontal[0]->GetUnscaledMaximumLimit()-1000.0) > 1e-8) fabs(axesHorizontal[0]->GetUnscaledMaximumLimit()-1000.0) > 1e-8)
{ {
cerr cerr
<< "ERROR: did not update unscaled limits when scaled limits changed.\n"; << "ERROR: did not update unscaled limits when scaled limits changed.\n";
status = EXIT_FAILURE; status = EXIT_FAILURE;
} }
axesHorizontal[0]->LogScaleOff(); axesHorizontal[0]->LogScaleOff();
if (axesHorizontal[0]->GetLogScaleActive() || if (axesHorizontal[0]->GetLogScaleActive() ||
-axesHorizontal[0]->GetMinimumLimit() == -axesHorizontal[0]->GetMinimumLimit() ==
axesHorizontal[0]->GetMaximumLimit()) axesHorizontal[0]->GetMaximumLimit())
{ {
cerr << "ERROR: did not transition from log scaling or reset limits.\n"; cerr << "ERROR: did not transition from log scaling or reset limits.\n";
status = EXIT_FAILURE; status = EXIT_FAILURE;
} }
axesHorizontal[0]->AutoScale(); axesHorizontal[0]->AutoScale();
axesHorizontal[0]->SetRange(20, 60); // restore range so rest of test can proceed axesHorizontal[0]->SetRange(20, 60); // restore range so rest of test can proceed
...@@ -158,9 +158,9 @@ int TestAxes(int , char * []) ...@@ -158,9 +158,9 @@ int TestAxes(int , char * [])
axesHorizontal[5]->SetPosition(vtkAxis::BOTTOM); axesHorizontal[5]->SetPosition(vtkAxis::BOTTOM);
for (size_t i = 0; i < axesHorizontal.size(); ++i) for (size_t i = 0; i < axesHorizontal.size(); ++i)
{ {
axesHorizontal[i]->Update(); axesHorizontal[i]->Update();
} }
// Test LogScale and UnscaledRange methods // Test LogScale and UnscaledRange methods
vtkNew<vtkAxis> logAxis; vtkNew<vtkAxis> logAxis;
...@@ -172,29 +172,29 @@ int TestAxes(int , char * []) ...@@ -172,29 +172,29 @@ int TestAxes(int , char * [])
logAxis->GetUnscaledRange(NULL); // Insure NULL pointers are ignored. logAxis->GetUnscaledRange(NULL); // Insure NULL pointers are ignored.
logAxis->GetUnscaledRange(logRange); logAxis->GetUnscaledRange(logRange);
if ((logRange[0] != plainRange[0]) || (logRange[1] != plainRange[1])) if ((logRange[0] != plainRange[0]) || (logRange[1] != plainRange[1]))
{ {
vtkGenericWarningMacro( vtkGenericWarningMacro(
<< "Error: expected unscaled range to be unchanged but got [" << "Error: expected unscaled range to be unchanged but got ["
<< logRange[0] << ", " << logRange[1] << "]."); << logRange[0] << ", " << logRange[1] << "].");
} }
logAxis->GetRange(logRange); logAxis->GetRange(logRange);
if ( if (
(fabs((pow(10., logRange[0]) - plainRange[0])) > 1e-6) || (fabs((pow(10., logRange[0]) - plainRange[0])) > 1e-6) ||
(fabs((pow(10., logRange[1]) - plainRange[1])) > 1e-6)) (fabs((pow(10., logRange[1]) - plainRange[1])) > 1e-6))
{ {
vtkGenericWarningMacro( vtkGenericWarningMacro(
<< "Error: expected scaled range to be [-1, 3] but got [" << "Error: expected scaled range to be [-1, 3] but got ["
<< logRange[0] << ", " << logRange[1] << "]."); << logRange[0] << ", " << logRange[1] << "].");
} }
if ( if (
(logAxis->GetMinimum() != logRange[0]) || (logAxis->GetMinimum() != logRange[0]) ||
(logAxis->GetMaximum() != logRange[1]) || (logAxis->GetMaximum() != logRange[1]) ||
(logAxis->GetUnscaledMinimum() != plainRange[0]) || (logAxis->GetUnscaledMinimum() != plainRange[0]) ||
(logAxis->GetUnscaledMaximum() != plainRange[1])) (logAxis->GetUnscaledMaximum() != plainRange[1]))
{ {
vtkGenericWarningMacro( vtkGenericWarningMacro(
"Error: returned ranges do not match returned min/max."); "Error: returned ranges do not match returned min/max.");
} }
logAxis->SetMinimum(logRange[0]); logAxis->SetMinimum(logRange[0]);
logAxis->SetMaximum(logRange[1]); logAxis->SetMaximum(logRange[1]);
logAxis->Update(); logAxis->Update();
......
...@@ -80,16 +80,16 @@ int TestBagPlot(int, char * []) ...@@ -80,16 +80,16 @@ int TestBagPlot(int, char * [])
// Fill the table // Fill the table
for (int j = 0; j < numDataJ; ++j) for (int j = 0; j < numDataJ; ++j)
{ {
for (int i = 0; i < numDataI; ++i) for (int i = 0; i < numDataI; ++i)
{ {
table->SetValue(i + j * numDataI, 0, i); //X table->SetValue(i + j * numDataI, 0, i); //X
table->SetValue(i + j * numDataI, 1, j); //Y table->SetValue(i + j * numDataI, 1, j); //Y
double d = densities[i + j * numDataI]; double d = densities[i + j * numDataI];
table->SetValue(i + j * numDataI, 2, d);