Skip to content

Commit

Permalink
Reindent using the reindentation script.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kwrobot authored and dgobbi committed Sep 23, 2016
1 parent 6a7e514 commit f830ff4
Show file tree
Hide file tree
Showing 3,975 changed files with 206,697 additions and 206,697 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestAreaPlot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int TestAreaPlot( int, char * [] )
float inc = 7.5 / (numPoints-1);
table->SetNumberOfRows(numPoints);
for (int i = 0; i < numPoints; ++i)
{
{
table->SetValue(i, 0, i * inc + 0.01);
table->SetValue(i, 1, cos(i * inc) + 0.01);
table->SetValue(i, 2, sin(i * inc) + 0.01);
Expand All @@ -77,7 +77,7 @@ int TestAreaPlot( int, char * [] )
table->SetValue(i, 5, 1.0);

validMask->SetValue(i, (i > 30 && i < 40) ? 0 : 1);
}
}

// Add multiple line plots, setting the colors etc
vtkPlotArea* area = vtkPlotArea::SafeDownCast(chart->AddPlot(vtkChart::AREA));
Expand Down
40 changes: 20 additions & 20 deletions Charts/Core/Testing/Cxx/TestAxes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int TestAxes(int , char * [])
std::vector<vtkSmartPointer<vtkAxis> > axesVertical(4);

for (size_t i = 0; i < axesVertical.size(); ++i)
{
{
axesVertical[i] = vtkSmartPointer<vtkAxis>::New();
vtkAxis *axis = axesVertical[i].GetPointer();
axis->SetPoint1(vtkVector2f(i * 69 + 30, 10));
Expand All @@ -60,7 +60,7 @@ int TestAxes(int , char * [])
axis->SetRange(-1, 50);

view->GetScene()->AddItem(axis);
}
}

// Exercise some of the API in the axis API.
axesVertical[0]->AutoScale();
Expand All @@ -85,15 +85,15 @@ int TestAxes(int , char * [])
axesVertical[3]->AutoScale();

for (size_t i = 0; i < axesVertical.size(); ++i)
{
{
axesVertical[i]->Update();
}
}

// Let's create a few axes, and place them on the scene.
std::vector<vtkSmartPointer<vtkAxis> > axesHorizontal(6);

for (size_t i = 0; i < axesHorizontal.size(); ++i)
{
{
axesHorizontal[i] = vtkSmartPointer<vtkAxis>::New();
vtkAxis *axis = axesHorizontal[i].GetPointer();
axis->SetPoint1(vtkVector2f(310, i * 50 + 30));
Expand All @@ -103,7 +103,7 @@ int TestAxes(int , char * [])

view->GetScene()->AddItem(axis);
axis->Update();
}
}

// Now to test some of the API in the horizontal axes.
axesHorizontal[0]->LogScaleOn(); // LogScaleActive=false because min*max<0
Expand All @@ -112,30 +112,30 @@ int TestAxes(int , char * [])
axesHorizontal[0]->GetRange(range);
if (!axesHorizontal[0]->GetLogScaleActive() ||
fabs(range[0]) > 1e-8 || fabs(range[1] - 2.) > 1e-8)
{
{
cerr << "ERROR: did not transition to log scaling when range changed.\n";
status = EXIT_FAILURE;
}
}
// Now change the axis limits in log-space...
axesHorizontal[0]->SetMinimumLimit(-1.);
axesHorizontal[0]->SetMaximumLimit(3.);
// ... and verify that the unscaled limits have changed:
if (
fabs(axesHorizontal[0]->GetUnscaledMinimumLimit()-0.1) > 1e-8 ||
fabs(axesHorizontal[0]->GetUnscaledMaximumLimit()-1000.0) > 1e-8)
{
{
cerr
<< "ERROR: did not update unscaled limits when scaled limits changed.\n";
status = EXIT_FAILURE;
}
}
axesHorizontal[0]->LogScaleOff();
if (axesHorizontal[0]->GetLogScaleActive() ||
-axesHorizontal[0]->GetMinimumLimit() ==
axesHorizontal[0]->GetMaximumLimit())
{
{
cerr << "ERROR: did not transition from log scaling or reset limits.\n";
status = EXIT_FAILURE;
}
}
axesHorizontal[0]->AutoScale();
axesHorizontal[0]->SetRange(20, 60); // restore range so rest of test can proceed

Expand All @@ -158,9 +158,9 @@ int TestAxes(int , char * [])
axesHorizontal[5]->SetPosition(vtkAxis::BOTTOM);

for (size_t i = 0; i < axesHorizontal.size(); ++i)
{
{
axesHorizontal[i]->Update();
}
}

// Test LogScale and UnscaledRange methods
vtkNew<vtkAxis> logAxis;
Expand All @@ -172,29 +172,29 @@ int TestAxes(int , char * [])
logAxis->GetUnscaledRange(NULL); // Insure NULL pointers are ignored.
logAxis->GetUnscaledRange(logRange);
if ((logRange[0] != plainRange[0]) || (logRange[1] != plainRange[1]))
{
{
vtkGenericWarningMacro(
<< "Error: expected unscaled range to be unchanged but got ["
<< logRange[0] << ", " << logRange[1] << "].");
}
}
logAxis->GetRange(logRange);
if (
(fabs((pow(10., logRange[0]) - plainRange[0])) > 1e-6) ||
(fabs((pow(10., logRange[1]) - plainRange[1])) > 1e-6))
{
{
vtkGenericWarningMacro(
<< "Error: expected scaled range to be [-1, 3] but got ["
<< logRange[0] << ", " << logRange[1] << "].");
}
}
if (
(logAxis->GetMinimum() != logRange[0]) ||
(logAxis->GetMaximum() != logRange[1]) ||
(logAxis->GetUnscaledMinimum() != plainRange[0]) ||
(logAxis->GetUnscaledMaximum() != plainRange[1]))
{
{
vtkGenericWarningMacro(
"Error: returned ranges do not match returned min/max.");
}
}
logAxis->SetMinimum(logRange[0]);
logAxis->SetMaximum(logRange[1]);
logAxis->Update();
Expand Down
8 changes: 4 additions & 4 deletions Charts/Core/Testing/Cxx/TestBagPlot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ int TestBagPlot(int, char * [])

// Fill the table
for (int j = 0; j < numDataJ; ++j)
{
{
for (int i = 0; i < numDataI; ++i)
{
{
table->SetValue(i + j * numDataI, 0, i); //X
table->SetValue(i + j * numDataI, 1, j); //Y
double d = densities[i + j * numDataI];
table->SetValue(i + j * numDataI, 2, d); // Density
}
cout << endl;
}
cout << endl;
}

vtkNew<vtkPlotBag> bagPlot;
chart->AddPlot(bagPlot.GetPointer());
Expand Down
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestBarGraph.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ int TestBarGraph(int , char * [])

table->SetNumberOfRows(12);
for (int i = 0; i < 12; i++)
{
{
table->SetValue(i,0,i+1);
table->SetValue(i,1,data_2008[i]);
table->SetValue(i,2,data_2009[i]);
table->SetValue(i,3,data_2010[i]);
}
}

// Add multiple bar plots, setting the colors etc
vtkPlot *plot = 0;
Expand Down
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestBarGraphHorizontal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ int TestBarGraphHorizontal(int , char * [])

table->SetNumberOfRows(12);
for (int i = 0; i < 12; i++)
{
{
table->SetValue(i,0,i+1);
table->SetValue(i,1,data_2008[i]);
table->SetValue(i,2,data_2009[i]);
table->SetValue(i,3,data_2010[i]);
}
}

// Add multiple bar plots, setting the colors etc
vtkPlot *plot = 0;
Expand Down
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestBarGraphSelection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ int TestBarGraphSelection(int , char * [])

table->SetNumberOfRows(12);
for (int i = 0; i < 12; i++)
{
{
table->SetValue(i,0,i+1);
table->SetValue(i,1,data_2008[i]);
table->SetValue(i,2,data_2009[i]);
table->SetValue(i,3,data_2010[i]);
}
}

// Build a selection object.
vtkNew<vtkIdTypeArray> selection;
Expand Down
8 changes: 4 additions & 4 deletions Charts/Core/Testing/Cxx/TestBoxPlot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,26 @@ int TestBoxPlot(int , char* [])
vtkNew<vtkTable> inputBoxPlotTable;

for (int i = 0; i < numParam; i++)
{
{
char num[10];
sprintf(num, "P%d", i);
vtkNew<vtkIntArray> arrIndex;
arrIndex->SetName(num);
inputBoxPlotTable->AddColumn(arrIndex.GetPointer());
}
}

inputBoxPlotTable->SetNumberOfRows(5);

// This scaling parameter can be used to test Y axis positioning
const double scale = 1e02;
for (int i = 0; i < numParam; i++)
{
{
inputBoxPlotTable->SetValue(0, i, (i/2) * scale); //Q0
inputBoxPlotTable->SetValue(1, i, (2*i + 2 - i) * scale); //Q1
inputBoxPlotTable->SetValue(2, i, (2*i + 4) * scale); //Q2
inputBoxPlotTable->SetValue(3, i, (2*i + 7) * scale); //Q3
inputBoxPlotTable->SetValue(4, i, (2*i + 8) * scale); //Q4
}
}

vtkNew<vtkLookupTable> lookup;
lookup->SetNumberOfColors(5);
Expand Down
8 changes: 4 additions & 4 deletions Charts/Core/Testing/Cxx/TestCategoryLegend.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ int TestCategoryLegend(int argc, char* argv[])

vtkNew<vtkLookupTable> lut;
for (int i = 0; i < values->GetNumberOfTuples(); ++i)
{
{
lut->SetAnnotation(values->GetValue(i), values->GetValue(i).ToString());
}
}

vtkNew<vtkColorSeries> colorSeries;
colorSeries->SetColorScheme(vtkColorSeries::BREWER_QUALITATIVE_SET3);
Expand All @@ -66,10 +66,10 @@ int TestCategoryLegend(int argc, char* argv[])

int retVal = vtkRegressionTestImage(contextView->GetRenderWindow());
if (retVal == vtkRegressionTester::DO_INTERACTOR)
{
{
contextView->GetRenderWindow()->Render();
contextView->GetInteractor()->Start();
retVal = vtkRegressionTester::PASSED;
}
}
return !retVal;
}
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestChartDouble.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ int TestChartDouble(int, char *[])
float inc = 7.5 / (numPoints - 1);
table->SetNumberOfRows(numPoints);
for (int i = 0; i < numPoints; ++i)
{
{
double x(i * inc + 0.2);
table->SetValue(i, 0, x);
table->SetValue(i, 1, 1.0e-80 * (cos(x - 1.0) + sin(x - 3.14 / 4.0)));
table->SetValue(i, 2, 1.0e-80 * sin(x) * 1e-12);
table->SetValue(i, 3, 1.0e-80 * sin(x - 1.0));
}
}

// Add multiple line plots, setting the colors etc
vtkPlot *line = chart->AddPlot(vtkChart::POINTS);
Expand Down
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestChartDoubleColors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ int TestChartDoubleColors(int, char *[])
float inc = 7.5 / (numPoints - 1);
table->SetNumberOfRows(numPoints);
for (int i = 0; i < numPoints; ++i)
{
{
double x(i * inc + 0.2);
table->SetValue(i, 0, x);
table->SetValue(i, 1, 1.0e-80 * (cos(x - 1.0) + sin(x - 3.14 / 4.0)));
table->SetValue(i, 2, 1.0e-80 * sin(x) * 1e-12);
table->SetValue(i, 3, 1.0e-80 * sin(x - 1.0));
table->SetValue(i, 4, cos(i * inc));
}
}

vtkNew<vtkLookupTable> lut;
lut->SetValueRange(0.0, 1.0);
Expand Down
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestChartMatrix.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ int TestChartMatrix( int, char * [] )
float inc = 7.5 / (numPoints-1);
table->SetNumberOfRows(numPoints);
for (int i = 0; i < numPoints; ++i)
{
{
table->SetValue(i, 0, i * inc);
table->SetValue(i, 1, cos(i * inc));
table->SetValue(i, 2, sin(i * inc));
table->SetValue(i, 3, sin(i * inc) + 0.5);
table->SetValue(i, 4, tan(i * inc));
}
}

// Add multiple line plots, setting the colors etc
vtkPlot *line = chart->AddPlot(vtkChart::POINTS);
Expand Down
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestChartTileScaling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ int TestChartTileScaling( int, char *[])
float inc = 7.5 / (numPoints-1);
table->SetNumberOfRows(numPoints);
for (int i = 0; i < numPoints; ++i)
{
{
table->SetValue(i, 0, i * inc);
table->SetValue(i, 1, sin(i * inc) + 0.0);
table->SetValue(i, 2, 1.0);
}
}

// Add multiple line plots, setting the colors etc
vtkPlot *line = chart->AddPlot(vtkChart::LINE);
Expand Down
8 changes: 4 additions & 4 deletions Charts/Core/Testing/Cxx/TestChartUnicode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
int TestChartUnicode(int argc, char *argv[])
{
if (argc < 2)
{
{
cout << "Missing font filename." << endl;
return EXIT_FAILURE;
}
}

std::string fontFile(argv[1]);

Expand Down Expand Up @@ -72,10 +72,10 @@ int TestChartUnicode(int argc, char *argv[])
float inc = 7.5 / (numPoints - 1);
table->SetNumberOfRows(numPoints);
for (int i = 0; i < numPoints; ++i)
{
{
table->SetValue(i, 0, i * inc);
table->SetValue(i, 1, cos(i * inc) + sin(i * (inc - 3.14)));
}
}

// Add multiple line plots, setting the colors etc
vtkPlot *line = chart->AddPlot(vtkChart::LINE);
Expand Down
4 changes: 2 additions & 2 deletions Charts/Core/Testing/Cxx/TestChartXYInvertedAxis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1532,13 +1532,13 @@ int TestChartXYInvertedAxis( int argc, char * argv[] )
float inc = 7.5 / (numPoints-1);
table->SetNumberOfRows(numPoints);
for (int i = 0; i < numPoints; ++i)
{
{
table->SetValue(i, 0, i * inc);
table->SetValue(i, 1, cos(i * inc) + 0.0);
table->SetValue(i, 2, sin(i * inc) + 0.0);
table->SetValue(i, 3, sin(i * inc) + 0.5);
table->SetValue(i, 4, 1.0);
}
}

// Add multiple line plots, setting the colors etc
vtkPlot *line = chart->AddPlot(vtkChart::LINE);
Expand Down
Loading

0 comments on commit f830ff4

Please sign in to comment.