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

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
......@@ -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);
......@@ -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));
......
......@@ -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));
......@@ -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();
......@@ -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));
......@@ -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
......@@ -112,10 +112,10 @@ 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.);
......@@ -123,19 +123,19 @@ int TestAxes(int , char * [])
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
......@@ -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;
......@@ -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();
......
......@@ -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());
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......@@ -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;
}
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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]);
......@@ -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);
......
......@@ -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);
......
......@@ -42,10 +42,10 @@ void ProcessEvents(vtkObject *caller, unsigned long,
chart->SetAngle(angle);
interactor->Render();
if (angle >= 90)
{
{
int timerId = *reinterpret_cast<int *>(callerData);
interactor->DestroyTimer(timerId);
}
}
}
} // End of anonymous namespace.
......@@ -84,11 +84,11 @@ int TestChartXYZ(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) + 0.0);
table->SetValue(i, 2, sin(i * inc) + 0.0);
}
}
//chart->SetAroundX(true);
// Add the three dimensions we are interested in visualizing.
......
......@@ -94,12 +94,12 @@ int TestChartsOn3D(int , char * [])
table->SetNumberOfRows(numPoints);
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, tan(i * inc) + 0.5);
}
}
// Add multiple line plots, setting the colors etc
vtkPlot *points = chart->AddPlot(vtkChart::POINTS);
......
......@@ -60,14 +60,14 @@ int TestColorTransferFunction(int , char * [])
// Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(1);
if (view->GetContext()->GetDevice()->IsA("vtkOpenGLContextDevice2D"))
{
{
view->GetInteractor()->Initialize();
view->GetInteractor()->Start();
}
}
else
{
{
cout << "GL version 2 or higher is required." << endl;
}
}
return EXIT_SUCCESS;
}
......@@ -79,23 +79,23 @@ bool ContextTest::Paint(vtkContext2D *painter)
// Draw some individual lines of different thicknesses.
for (int i = 0; i < 10; ++i)
{
{
painter->GetPen()->SetColor(255,
static_cast<unsigned char>(float(i)*25.0),
0);
painter->GetPen()->SetWidth(1.0 + float(i));
painter->DrawLine(10, 50 + float(i)*10, 60, 50 + float(i)*10);
}
}
// Use the draw lines function now to draw a shape.
vtkSmartPointer<vtkPoints2D> points = vtkSmartPointer<vtkPoints2D>::New();
points->SetNumberOfPoints(30);
for (int i = 0; i < 30; ++i)
{
{
double point[2] = { float(i) * 25.0 + 10.0,
sin(float(i) / 5.0) * 100.0 + 200.0 };
points->SetPoint(i, point);
}
}
painter->GetPen()->SetColor(0, 255, 0);
painter->GetPen()->SetWidth(5.0);
painter->DrawPoly(points);
......@@ -112,7 +112,7 @@ bool ContextTest::Paint(vtkContext2D *painter)
float markerPoints[10*2];
unsigned char markerColors[10*4];
for (int i = 0; i < 10; ++i)
{
{
markerPoints[2 * i] = 500.0 + i * 30.0;
markerPoints[2 * i + 1] = 20 * sin(markerPoints[2 * i]) + 375.0;
......@@ -122,32 +122,32 @@ bool ContextTest::Paint(vtkContext2D *painter)
markerColors[4 * i + 2] = static_cast<unsigned char>(255 * (0.3));
markerColors[4 * i + 3] =
static_cast<unsigned char>(255 * (1.0 - ((i / 10.0) * 0.25)));
}
}
for (int style = VTK_MARKER_NONE + 1; style < VTK_MARKER_UNKNOWN; ++style)
{
{
// Increment the y values:
for (int i = 1; i < 20; i += 2)
{
{
markerPoints[i] += 35.0;
}
}
painter->GetPen()->SetWidth(style * 5 + 5);
// Not highlighted:
painter->DrawMarkers(style, false, markerPoints, 10, markerColors, 4);
// Highlight the middle 4 points
painter->GetPen()->SetColorF(0.9, 0.8, 0.1, 0.5);
painter->DrawMarkers(style, true, markerPoints + 3*2, 4);
}
}
// Draw some individual lines of different thicknesses.
for (int i = 0; i < 10; ++i)
{
{
painter->GetPen()->SetColor(0,
static_cast<unsigned char>(float(i)*25.0),
255, 255);
painter->GetPen()->SetWidth(1.0 + float(i));
painter->DrawPoint(75, 50 + float(i)*10);
}
}
painter->GetPen()->SetColor(0, 0, 255);
painter->GetPen()->SetWidth(3.0);
......
......@@ -125,13 +125,13 @@ int TestContextArea(int argc, char *argv[])
area->GetAxis(vtkAxis::RIGHT)->SetTitle("Right Axis");
for (int i = 0; i < 4; ++i)
{
{
vtkAxis *axis = area->GetAxis(static_cast<vtkAxis::Location>(i));
axis->GetLabelProperties()->SetColor(.6, .6, .9);
axis->GetTitleProperties()->SetColor(.6, .6, .9);
axis->GetPen()->SetColor(.6 * 255, .6 * 255, .9 * 255, 255);
axis->GetGridPen()->SetColor(.6 * 255, .6 * 255, .9 * 255, 128);
}
}
area->GetDrawAreaItem()->AddItem(imageItem.GetPointer());
area->GetDrawAreaItem()->AddItem(contourItem.GetPointer());
......
......@@ -126,13 +126,13 @@ int TestContextAreaFixedAspect(int argc, char *argv[])
area->GetAxis(vtkAxis::RIGHT)->SetTitle("Right Axis");
for (int i = 0; i < 4; ++i)
{
{
vtkAxis *axis = area->GetAxis(static_cast<vtkAxis::Location>(i));
axis->GetLabelProperties()->SetColor(.6, .6, .9);
axis->GetTitleProperties()->SetColor(.6, .6, .9);
axis->GetPen()->SetColor(.6 * 255, .6 * 255, .9 * 255, 255);
axis->GetGridPen()->SetColor(.6 * 255, .6 * 255, .9 * 255, 128);
}
}
area->GetDrawAreaItem()->AddItem(imageItem.GetPointer());
area->GetDrawAreaItem()->AddItem(contourItem.GetPointer());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment