Commit acb56e04 authored by George Zagaris's avatar George Zagaris
Browse files

Merge remote branch 'origin/master' into AMR-Refactoring

parents 3dc56fe4 04f8b0eb
......@@ -74,6 +74,9 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
ENDIF()
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
SET (VTK_MAX_THREADS "64" CACHE STRING
"Max number of threads vktMultiThreader will allocate.")
MARK_AS_ADVANCED(
CMAKE_HP_PTHREADS
CMAKE_THREAD_LIBS
......@@ -82,5 +85,6 @@ CMAKE_USE_SPROC
CMAKE_USE_WIN32_THREADS
CMAKE_X_CFLAGS
CMAKE_X_LIBS
VTK_MAX_THREADS
)
......@@ -81,7 +81,7 @@ endif()
#-----------------------------------------------------------------------------
# VTK version number. An even minor number corresponds to releases.
SET(VTK_MAJOR_VERSION 5)
SET(VTK_MINOR_VERSION 7)
SET(VTK_MINOR_VERSION 9)
SET(VTK_BUILD_VERSION 0)
SET(VTK_VERSION
"${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
......@@ -892,16 +892,16 @@ IF(VTK_USE_MPI)
# Use MPI variables defined in the CMake (2.8) FindMPI module.
IF(${MPIEXEC})
SET(VTK_MPIRUN_EXE ${MPIEXEC})
SET(VTK_MPI_PRENUMPROC_FLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "These flags will be directly before the number of processess flag (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPIRUN_EXE CACHE FILEPATH ${MPIEXEC} FORCE)
SET(VTK_MPI_PRENUMPROC_FLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "These flags will be directly before the number of processess flag (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
IF(NOT ${MPI_NUMPROC_FLAG})
SET(VTK_MPI_NUMPROC_FLAG "-np" CACHE STRING "Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_NUMPROC_FLAG "-np" CACHE STRING "Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
ELSE(NOT ${MPI_NUMPROC_FLAG})
SET(VTK_MPI_NUMPROC_FLAG ${MPIEXEC_NUMPROC_FLAG} CACHE STRING "Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_NUMPROC_FLAG ${MPIEXEC_NUMPROC_FLAG} CACHE STRING "Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
ENDIF(NOT ${MPI_NUMPROC_FLAG})
SET(VTK_MPI_PREFLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "These flags will be directly before the executable that is being run by VTK_MPIRUN_EXE. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_POSTFLAGS ${MPIEXEC_POSTFLAGS} CACHE STRING "These flags will come after all flags given to MPIRun.(see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_MAX_NUMPROCS ${MPIEXEC_MAX_NUMPROCS} CACHE STRING "Maximum number of processors available to run parallel applications. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_PREFLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "These flags will be directly before the executable that is being run by VTK_MPIRUN_EXE. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
SET(VTK_MPI_POSTFLAGS ${MPIEXEC_POSTFLAGS} CACHE STRING "These flags will come after all flags given to MPIRun.(see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
SET(VTK_MPI_MAX_NUMPROCS ${MPIEXEC_MAX_NUMPROCS} CACHE STRING "Maximum number of processors available to run parallel applications. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
ELSE(${MPIEXEC})
# set to the default hardcoded values. This else can probably be deleted when VTK requires CMake 2.8+.
FIND_PROGRAM(VTK_MPIRUN_EXE NAMES mpiexec mpirun lamexec PATHS "C:/Program Files/MPICH/mpd/bin")
......
......@@ -24,10 +24,7 @@
#include "vtkContextScene.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRegressionTestImage.h"
#define VTK_CREATE(type, name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
#include "vtkNew.h"
// Monthly circulation data
static int data_2008[] = {10822, 10941, 9979, 10370, 9460, 11228, 15093, 12231, 10160, 9816, 9384, 7892};
......@@ -38,30 +35,30 @@ static int data_2010[] = {9058, 10941, 9979, 10270, 8900, 11228, 14688, 12231, 1
int TestBarGraph(int , char * [])
{
// Set up a 2D scene, add an XY chart to it
VTK_CREATE(vtkContextView, view);
vtkNew<vtkContextView> view;
view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
view->GetRenderWindow()->SetSize(400, 300);
VTK_CREATE(vtkChartXY, chart);
view->GetScene()->AddItem(chart);
vtkNew<vtkChartXY> chart;
view->GetScene()->AddItem(chart.GetPointer());
// Create a table with some points in it...
VTK_CREATE(vtkTable, table);
vtkNew<vtkTable> table;
VTK_CREATE(vtkIntArray, arrMonth);
vtkNew<vtkIntArray> arrMonth;
arrMonth->SetName("Month");
table->AddColumn(arrMonth);
table->AddColumn(arrMonth.GetPointer());
VTK_CREATE(vtkIntArray, arr2008);
vtkNew<vtkIntArray> arr2008;
arr2008->SetName("2008");
table->AddColumn(arr2008);
table->AddColumn(arr2008.GetPointer());
VTK_CREATE(vtkIntArray, arr2009);
vtkNew<vtkIntArray> arr2009;
arr2009->SetName("2009");
table->AddColumn(arr2009);
table->AddColumn(arr2009.GetPointer());
VTK_CREATE(vtkIntArray, arr2010);
vtkNew<vtkIntArray> arr2010;
arr2010->SetName("2010");
table->AddColumn(arr2010);
table->AddColumn(arr2010.GetPointer());
table->SetNumberOfRows(12);
for (int i = 0; i < 12; i++)
......@@ -76,15 +73,15 @@ int TestBarGraph(int , char * [])
vtkPlot *line = 0;
line = chart->AddPlot(vtkChart::BAR);
line->SetInput(table, 0, 1);
line->SetInput(table.GetPointer(), 0, 1);
line->SetColor(0, 255, 0, 255);
line = chart->AddPlot(vtkChart::BAR);
line->SetInput(table, 0, 2);
line->SetInput(table.GetPointer(), 0, 2);
line->SetColor(255, 0, 0, 255);
line = chart->AddPlot(vtkChart::BAR);
line->SetInput(table, 0, 3);
line->SetInput(table.GetPointer(), 0, 3);
line->SetColor(0, 0, 255, 255);
//Finally render the scene and compare the image to a reference image
......
......@@ -28,6 +28,7 @@
#include "vtkTextProperty.h"
#include "vtkOpenGLContextDevice2D.h"
#include "vtkPoints2D.h"
#include "vtkNew.h"
#include "vtkRegressionTestImage.h"
......@@ -45,11 +46,11 @@ public:
int TestContext( int, char * [] )
{
// Set up a 2D context view, context test object and add it to the scene
vtkSmartPointer<vtkContextView> view = vtkSmartPointer<vtkContextView>::New();
vtkNew<vtkContextView> view;
view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
view->GetRenderWindow()->SetSize(800, 600);
vtkSmartPointer<ContextTest> test = vtkSmartPointer<ContextTest>::New();
view->GetScene()->AddItem(test);
vtkNew<ContextTest> test;
view->GetScene()->AddItem(test.GetPointer());
// Force the use of the freetype based rendering strategy
vtkOpenGLContextDevice2D::SafeDownCast(view->GetContext()->GetDevice())
......@@ -135,7 +136,7 @@ bool ContextTest::Paint(vtkContext2D *painter)
525, 199, 666, 45);
// Now to test out the transform...
vtkSmartPointer<vtkTransform2D> transform = vtkSmartPointer<vtkTransform2D>::New();
vtkNew<vtkTransform2D> transform;
transform->Translate(20, 200);
painter->GetDevice()->SetMatrix(transform->GetMatrix());
painter->GetPen()->SetColor(255, 0, 0);
......
......@@ -23,6 +23,7 @@
#include "vtkContextScene.h"
#include "vtkPNGReader.h"
#include "vtkImageData.h"
#include "vtkNew.h"
#include "vtkTestUtilities.h"
#include "vtkRegressionTestImage.h"
......@@ -34,12 +35,12 @@ int TestContextImage(int argc, char * argv [])
"Data/vtk.png");
// Set up a 2D context view, context test object and add it to the scene
vtkSmartPointer<vtkContextView> view = vtkSmartPointer<vtkContextView>::New();
vtkNew<vtkContextView> view;
view->GetRenderWindow()->SetSize(275, 275);
vtkSmartPointer<vtkImageItem> item = vtkSmartPointer<vtkImageItem>::New();
view->GetScene()->AddItem(item);
vtkNew<vtkImageItem> item;
view->GetScene()->AddItem(item.GetPointer());
vtkSmartPointer<vtkPNGReader> reader = vtkSmartPointer<vtkPNGReader>::New();
vtkNew<vtkPNGReader> reader;
reader->SetFileName(logo);
reader->Update();
item->SetImage(vtkImageData::SafeDownCast(reader->GetOutput()));
......
......@@ -21,6 +21,7 @@
#include "vtkContextTransform.h"
#include "vtkContextView.h"
#include "vtkContextScene.h"
#include "vtkNew.h"
#include "vtkRegressionTestImage.h"
......@@ -28,39 +29,38 @@
int TestContextScene( int argc, char * argv [] )
{
// Set up a 2D context view, context test object and add it to the scene
vtkSmartPointer<vtkContextView> view = vtkSmartPointer<vtkContextView>::New();
vtkNew<vtkContextView> view;
view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
view->GetRenderWindow()->SetSize(400, 400);
vtkSmartPointer<vtkBlockItem> test = vtkSmartPointer<vtkBlockItem>::New();
vtkNew<vtkBlockItem> test;
test->SetDimensions(20, 20, 30, 40);
vtkSmartPointer<vtkBlockItem> test2 = vtkSmartPointer<vtkBlockItem>::New();
vtkNew<vtkBlockItem> test2;
test2->SetDimensions(80, 20, 30, 40);
vtkSmartPointer<vtkBlockItem> parent = vtkSmartPointer<vtkBlockItem>::New();
vtkNew<vtkBlockItem> parent;
parent->SetDimensions(20, 200, 80, 40);
parent->SetLabel("Parent");
vtkSmartPointer<vtkBlockItem> child = vtkSmartPointer<vtkBlockItem>::New();
vtkNew<vtkBlockItem> child;
child->SetDimensions(120, 200, 80, 46);
child->SetLabel("Child");
vtkSmartPointer<vtkBlockItem> child2 = vtkSmartPointer<vtkBlockItem>::New();
vtkNew<vtkBlockItem> child2;
child2->SetDimensions(150, 250, 86, 46);
child2->SetLabel("Child2");
vtkSmartPointer<vtkContextTransform> transform =
vtkSmartPointer<vtkContextTransform>::New();
transform->AddItem(parent);
vtkNew<vtkContextTransform> transform;
transform->AddItem(parent.GetPointer());
transform->Translate(50, -190);
// Build up our multi-level scene
view->GetScene()->AddItem(test); // scene
view->GetScene()->AddItem(test2); // scene
view->GetScene()->AddItem(parent); // scene
parent->AddItem(child); // scene->parent
child->AddItem(child2); // scene->parent->child
view->GetScene()->AddItem(test.GetPointer()); // scene
view->GetScene()->AddItem(test2.GetPointer()); // scene
view->GetScene()->AddItem(parent.GetPointer()); // scene
parent->AddItem(child.GetPointer()); // scene->parent
child->AddItem(child2.GetPointer()); // scene->parent->child
// Add our transformed item
view->GetScene()->AddItem(transform);
view->GetScene()->AddItem(transform.GetPointer());
// Turn off the color buffer
view->GetScene()->SetUseBufferId(false);
......
......@@ -26,6 +26,7 @@
#include "vtkBrush.h"
#include "vtkTextProperty.h"
#include "vtkStdString.h"
#include "vtkNew.h"
#include "vtkRegressionTestImage.h"
......@@ -43,21 +44,18 @@ public:
int TestDiagram(int, char * [])
{
// Set up a 2D chart actor, APIDiagram object andn add them to the renderer
vtkSmartPointer<vtkContextActor> actor =
vtkSmartPointer<vtkContextActor>::New();
vtkSmartPointer<APIDiagram> diagram = vtkSmartPointer<APIDiagram>::New();
actor->GetScene()->AddItem(diagram);
vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
vtkNew<vtkContextActor> actor;
vtkNew<APIDiagram> diagram;
actor->GetScene()->AddItem(diagram.GetPointer());
vtkNew<vtkRenderer> renderer;
renderer->SetBackground(1.0, 1.0, 1.0);
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
vtkNew<vtkRenderWindow> renderWindow;
renderWindow->SetSize(800, 600);
renderWindow->AddRenderer(renderer);
renderer->AddActor(actor);
renderWindow->AddRenderer(renderer.GetPointer());
renderer->AddActor(actor.GetPointer());
vtkSmartPointer<vtkRenderWindowInteractor> interactor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
interactor->SetRenderWindow(renderWindow);
vtkNew<vtkRenderWindowInteractor> interactor;
interactor->SetRenderWindow(renderWindow.GetPointer());
renderWindow->SetMultiSamples(0);
interactor->Initialize();
interactor->Start();
......
......@@ -32,6 +32,7 @@
#include "vtkShader2Collection.h"
#include "vtkUniformVariables.h"
#include "vtkOpenGLRenderWindow.h"
#include "vtkNew.h"
#include "vtkRegressionTestImage.h"
......@@ -69,9 +70,6 @@ const char* SimpleFragmentShader2 =
" gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n"
"}\n";
#define VTK_CREATE(type, name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
//----------------------------------------------------------------------------
class GLSLTestItem : public vtkContextItem
{
......@@ -93,11 +91,11 @@ public:
int TestGLSL( int, char * [] )
{
// Set up a 2D context view, context test object and add it to the scene
VTK_CREATE(vtkContextView, view);
vtkNew<vtkContextView> view;
view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
view->GetRenderWindow()->SetSize(200, 200);
VTK_CREATE(GLSLTestItem, test);
view->GetScene()->AddItem(test);
vtkNew<GLSLTestItem> test;
view->GetScene()->AddItem(test.GetPointer());
// Ensure that there is a valid OpenGL context - Mac inconsistent behavior.
view->GetRenderWindow()->SetMultiSamples(0);
......
......@@ -23,21 +23,20 @@
#include "vtkContextScene.h"
#include "vtkMath.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkNew.h"
//----------------------------------------------------------------------------
int TestHistogram2D(int, char * [])
{
// Set up a 2D scene, add an XY chart to it
int size = 401;
vtkSmartPointer<vtkContextView> view =
vtkSmartPointer<vtkContextView>::New();
vtkNew<vtkContextView> view;
view->GetRenderWindow()->SetSize(size, size);
vtkSmartPointer<vtkChartHistogram2D> chart =
vtkSmartPointer<vtkChartHistogram2D>::New();
vtkNew<vtkChartHistogram2D> chart;
view->GetScene()->AddItem(chart);
view->GetScene()->AddItem(chart.GetPointer());
vtkSmartPointer<vtkImageData> data = vtkSmartPointer<vtkImageData>::New();
vtkNew<vtkImageData> data;
data->SetExtent(0, size-1, 0, size-1, 0, 0);
data->SetNumberOfScalarComponents(1);
data->SetScalarTypeToDouble();
......@@ -55,10 +54,9 @@ int TestHistogram2D(int, char * [])
cos(vtkMath::RadiansFromDegrees(double(j)));
}
}
chart->SetInput(data);
chart->SetInput(data.GetPointer());
vtkSmartPointer<vtkColorTransferFunction> transferFunction =
vtkSmartPointer<vtkColorTransferFunction>::New();
vtkNew<vtkColorTransferFunction> transferFunction;
transferFunction->AddHSVSegment(0.0, 0.0, 1.0, 1.0,
0.3333, 0.3333, 1.0, 1.0);
transferFunction->AddHSVSegment(0.3333, 0.3333, 1.0, 1.0,
......@@ -66,7 +64,7 @@ int TestHistogram2D(int, char * [])
transferFunction->AddHSVSegment(0.6666, 0.6666, 1.0, 1.0,
1.0, 0.2, 1.0, 0.3);
transferFunction->Build();
chart->SetTransferFunction(transferFunction);
chart->SetTransferFunction(transferFunction.GetPointer());
//Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(0);
......
......@@ -22,31 +22,31 @@
#include "vtkContextView.h"
#include "vtkContextScene.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkNew.h"
//----------------------------------------------------------------------------
int TestLinePlot( int, char * [] )
{
// Set up a 2D scene, add an XY chart to it
vtkSmartPointer<vtkContextView> view =
vtkSmartPointer<vtkContextView>::New();
vtkNew<vtkContextView> view;
view->GetRenderWindow()->SetSize(400, 300);
vtkSmartPointer<vtkChartXY> chart = vtkSmartPointer<vtkChartXY>::New();
view->GetScene()->AddItem(chart);
vtkNew<vtkChartXY> chart;
view->GetScene()->AddItem(chart.GetPointer());
// Create a table with some points in it...
vtkSmartPointer<vtkTable> table = vtkSmartPointer<vtkTable>::New();
vtkSmartPointer<vtkFloatArray> arrX = vtkSmartPointer<vtkFloatArray>::New();
vtkNew<vtkTable> table;
vtkNew<vtkFloatArray> arrX;
arrX->SetName("X Axis");
table->AddColumn(arrX);
vtkSmartPointer<vtkFloatArray> arrC = vtkSmartPointer<vtkFloatArray>::New();
table->AddColumn(arrX.GetPointer());
vtkNew<vtkFloatArray> arrC;
arrC->SetName("Cosine");
table->AddColumn(arrC);
vtkSmartPointer<vtkFloatArray> arrS = vtkSmartPointer<vtkFloatArray>::New();
table->AddColumn(arrC.GetPointer());
vtkNew<vtkFloatArray> arrS;
arrS->SetName("Sine");
table->AddColumn(arrS);
vtkSmartPointer<vtkFloatArray> arrS2 = vtkSmartPointer<vtkFloatArray>::New();
table->AddColumn(arrS.GetPointer());
vtkNew<vtkFloatArray> arrS2;
arrS2->SetName("Sine2");
table->AddColumn(arrS2);
table->AddColumn(arrS2.GetPointer());
// Test charting with a few more points...
int numPoints = 69;
float inc = 7.5 / (numPoints-1);
......@@ -61,15 +61,15 @@ int TestLinePlot( int, char * [] )
// Add multiple line plots, setting the colors etc
vtkPlot *line = chart->AddPlot(vtkChart::LINE);
line->SetInput(table, 0, 1);
line->SetInput(table.GetPointer(), 0, 1);
line->SetColor(0, 255, 0, 255);
line->SetWidth(1.0);
line = chart->AddPlot(vtkChart::LINE);
line->SetInput(table, 0, 2);
line->SetInput(table.GetPointer(), 0, 2);
line->SetColor(255, 0, 0, 255);
line->SetWidth(5.0);
line = chart->AddPlot(vtkChart::LINE);
line->SetInput(table, 0, 3);
line->SetInput(table.GetPointer(), 0, 3);
line->SetColor(0, 0, 255, 255);
line->SetWidth(4.0);
......
......@@ -25,7 +25,7 @@
#include "vtkContextScene.h"
#include "vtkInteractorEventRecorder.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRegressionTestImage.h"
#include "vtkNew.h"
char TestLinePlotInteractionLog[] =
"# StreamVersion 1\n"
......@@ -129,14 +129,13 @@ char TestLinePlotInteractionLog[] =
int TestLinePlotInteraction(int, char * [])
{
// Set up a 2D scene, add an XY chart to it
vtkSmartPointer<vtkContextView> view =
vtkSmartPointer<vtkContextView>::New();
vtkNew<vtkContextView> view;
view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
view->GetRenderWindow()->SetSize(400, 300);
vtkSmartPointer<vtkChartXY> chart = vtkSmartPointer<vtkChartXY>::New();
vtkNew<vtkChartXY> chart;
chart->GetAxis(vtkAxis::LEFT)->SetTitle("");
chart->GetAxis(vtkAxis::BOTTOM)->SetTitle("");
view->GetScene()->AddItem(chart);
view->GetScene()->AddItem(chart.GetPointer());
// Create a table with some points in it...
vtkSmartPointer<vtkTable> table = vtkSmartPointer<vtkTable>::New();
......
......@@ -23,35 +23,32 @@
#include "vtkContextView.h"
#include "vtkContextScene.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRegressionTestImage.h"
#define VTK_CREATE(type, name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
#include "vtkNew.h"
//----------------------------------------------------------------------------
int TestParallelCoordinates(int , char* [])
{
// Set up a 2D scene, add an XY chart to it
VTK_CREATE(vtkContextView, view);
vtkNew<vtkContextView> view;
view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
view->GetRenderWindow()->SetSize(800, 600);
VTK_CREATE(vtkChartParallelCoordinates, chart);
view->GetScene()->AddItem(chart);
vtkNew<vtkChartParallelCoordinates> chart;
view->GetScene()->AddItem(chart.GetPointer());
// Create a table with some points in it...
VTK_CREATE(vtkTable, table);
VTK_CREATE(vtkFloatArray, arrX);
vtkNew<vtkTable> table;
vtkNew<vtkFloatArray> arrX;
arrX->SetName("Field 1");
table->AddColumn(arrX);
VTK_CREATE(vtkFloatArray, arrC);
table->AddColumn(arrX.GetPointer());
vtkNew<vtkFloatArray> arrC;
arrC->SetName("Field 2");
table->AddColumn(arrC);
VTK_CREATE(vtkFloatArray, arrS);
table->AddColumn(arrC.GetPointer());
vtkNew<vtkFloatArray> arrS;
arrS->SetName("Field 3");
table->AddColumn(arrS);
VTK_CREATE(vtkFloatArray, arrS2);
table->AddColumn(arrS.GetPointer());
vtkNew<vtkFloatArray> arrS2;
arrS2->SetName("Field 4");
table->AddColumn(arrS2);
table->AddColumn(arrS2.GetPointer());
// Test charting with a few more points...
int numPoints = 200;
float inc = 7.5 / (numPoints-1);
......@@ -64,7 +61,7 @@ int TestParallelCoordinates(int , char* [])
table->SetValue(i, 3, tan(i * inc) + 0.5);
}
chart->GetPlot(0)->SetInput(table);
chart->GetPlot(0)->SetInput(table.GetPointer());
view->GetRenderWindow()->SetMultiSamples(0);
view->GetInteractor()->Initialize();
......
......@@ -25,12 +25,9 @@
#include "vtkContextView.h"
#include "vtkContextScene.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRegressionTestImage.h"
#include "vtkNew.h"
#include "vtkColorSeries.h"
#define VTK_CREATE(type, name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
#define NUM_ITEMS (5)
static int data[] = {77938,9109,2070,12806,19514};
//static int data[] = {200,200,200,200,200};
......@@ -40,17 +37,17 @@ static const char *labels[] = {"Books","New and Popular","Periodical","Audiobook
int TestPieChart(int , char * [])
{
// Set up a 2D scene, add an XY chart to it
VTK_CREATE(vtkContextView, view);
vtkNew<vtkContextView> view;
view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
view->GetRenderWindow()->SetSize(600, 350);
VTK_CREATE(vtkChartPie, chart);
view->GetScene()->AddItem(chart);
vtkNew<vtkChartPie> chart;
view->GetScene()->AddItem(chart.GetPointer());
// Create a table with some points in it...
VTK_CREATE(vtkTable, table);
vtkNew<vtkTable> table;
VTK_CREATE(vtkIntArray,arrData);
VTK_CREATE(vtkStringArray,labelArray);
vtkNew<vtkIntArray> arrData;
vtkNew<vtkStringArray> labelArray;
arrData->SetName("2008 Circulation");
for (int i = 0; i < NUM_ITEMS; i++)
......@@ -59,20 +56,18 @@ int TestPieChart(int , char * [])
labelArray->InsertNextValue(labels[i]);
}
table->AddColumn(arrData);
table->AddColumn(arrData.GetPointer());
// Create a color series to use with our stacks.
VTK_CREATE(vtkColorSeries,colorSeries);
vtkNew<vtkColorSeries> colorSeries;
colorSeries->SetColorScheme(vtkColorSeries::WARM);
// Add multiple line plots, setting the colors etc
vtkPlotPie *pie = 0;
pie = vtkPlotPie::SafeDownCast(chart->AddPlot(0));
pie->SetColorSeries(colorSeries);
pie->SetInput(table);
pie->SetInputArray(0,"2008 Circulation");
pie->SetLabels(labelArray);
vtkPlotPie *pie = vtkPlotPie::SafeDownCast(chart->AddPlot(0));
pie->SetColorSeries(colorSeries.GetPointer());
pie->SetInput(table.GetPointer());
pie->SetInputArray(0, "2008 Circulation");
pie->SetLabels(labelArray.GetPointer());
chart->SetShowLegend(true);
......
......@@ -43,21 +43,6 @@
//-----------------------------------------------------------------------------
namespace {
// See if the point is within tolerance on x and between base and extent on Y.
bool inRange(const vtkVector2f& point, const vtkVector2f& tol,
const vtkVector3f& current)
{
if (current.X() > point.X() - tol.X() && current.X() < point.X() + tol.X() &&