Commit fa4fc9bd authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

ENH: Added a toy example of an indexed label array.

Change-Id: Iec4e915410f4c69394b5570ee4a61a5cca5c77ec
parent 03e0f27a
......@@ -50,6 +50,9 @@ int TestScatterPlot(int , char * [])
vtkNew<vtkFloatArray> arrT;
arrT->SetName("Tan");
table->AddColumn(arrT.GetPointer());
vtkNew<vtkStringArray> labels;
labels->SetName("Labels");
table->AddColumn(labels.GetPointer());
// Test charting with a few more points...
int numPoints = 40;
......@@ -61,6 +64,14 @@ int TestScatterPlot(int , char * [])
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);
if (i % 2)
{
table->SetValue(i, 4, vtkStdString("Odd"));
}
else
{
table->SetValue(i, 4, vtkStdString("Even"));
}
}
// Add multiple line plots, setting the colors etc
......@@ -78,6 +89,7 @@ int TestScatterPlot(int , char * [])
points->SetInput(table.GetPointer(), 0, 3);
points->SetColor(0, 0, 255, 255);
points->SetWidth(4.0);
points->SetIndexedLabels(labels.GetPointer());
//Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(0);
......
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