Commit 039f7961 authored by Haocheng LIU's avatar Haocheng LIU Committed by Haocheng LIU

Fix bugs&typo in VTK Example folder

With VTK new version, find_package cannot find VTK_RENDERING_BACKEND
properly. The solution is to call find_package(VTK REQUIRED) first, then
use vtk_module_config to load the needed modules. Some typos are also fixed.
For Statistics example, the SetInput function is replaced by SetInputDta
function(See vtkTableAlgorithm class).
parent c325de75
......@@ -8,7 +8,8 @@ endif()
PROJECT (LabeledMesh)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkCommonDataModel
vtkFiltersSources
......
......@@ -7,8 +7,8 @@ if(POLICY CMP0053)
endif()
PROJECT (DataManipulation)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkCommonDataModel
vtkFiltersGeometry
......
......@@ -23,7 +23,7 @@ cone.SetResolution(10)
# object. (Intermediate filters such as vtkShrinkPolyData could be
# inserted in between the source and the mapper.) We create an
# instance of vtkPolyDataMapper to map the polygonal data into
# graphics primitives. We connect the output of the cone souece to the
# graphics primitives. We connect the output of the cone source to the
# input of this mapper.
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInputConnection(cone.GetOutputPort())
......
......@@ -7,8 +7,8 @@ if(POLICY CMP0053)
endif()
PROJECT(ImageProcessing)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersCore
vtkFiltersModeling
......
......@@ -6,6 +6,15 @@ endif()
project(Infovis)
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersSources
vtkInteractionStyle
vtkRenderingLabel
vtkInfovisLayout
vtkIOInfovis
vtkRendering${VTK_RENDERING_BACKEND}
)
include(${VTK_USE_FILE})
add_executable(TreeLayout TreeLayout.cxx)
......
......@@ -7,8 +7,8 @@ if(POLICY CMP0053)
endif()
PROJECT (Modelling)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkCommonDataModel
vtkFiltersGeneral
......
......@@ -8,7 +8,8 @@ endif()
PROJECT (MultiBlock)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersGeometry
vtkFiltersSources
......
......@@ -11,8 +11,8 @@ PROJECT (Rendering)
if(NOT VTK_SOURCE_DIR)
message(ERROR " Cannot build Rendering examples without VTK_SOURCE_DIR")
endif()
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersSources
vtkInteractionStyle
......
......@@ -151,7 +151,7 @@ int main( int, char *[] )
cout << "done.\n";
// Prepare first test with data
ds1->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable1 );
ds1->SetInputData( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable1 );
datasetTable1->Delete();
// Select Columns of Interest
......@@ -326,7 +326,7 @@ int main( int, char *[] )
modifiedModel->SetBlock( 1, modifiedDerived );
// Run with Assess option only (do not recalculate nor rederive a model)
ds1->SetInput( vtkStatisticsAlgorithm::INPUT_MODEL, modifiedModel );
ds1->SetInputData( vtkStatisticsAlgorithm::INPUT_MODEL, modifiedModel );
ds1->SetLearnOption( false );
ds1->SetDeriveOption( false );
ds1->SetTestOption( true );
......@@ -404,7 +404,7 @@ int main( int, char *[] )
// Set descriptive statistics algorithm and its input data port
vtkDescriptiveStatistics* ds2 = vtkDescriptiveStatistics::New();
ds2->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable2 );
ds2->SetInputData( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable2 );
// Select Columns of Interest (all of them)
for ( int i = 0; i< nMetrics; ++ i )
......@@ -441,11 +441,11 @@ int main( int, char *[] )
ds2->Delete();
// Test model aggregation by adding new data to engine which already has a model
ds1->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable2 );
ds1->SetInputData( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable2 );
datasetTable2->Delete();
vtkMultiBlockDataSet* model = vtkMultiBlockDataSet::New();
model->ShallowCopy( outputMetaDS1 );
ds1->SetInput( vtkStatisticsAlgorithm::INPUT_MODEL, model );
ds1->SetInputData( vtkStatisticsAlgorithm::INPUT_MODEL, model );
model->Delete();
// Update with Learn and Derive options only
......@@ -548,7 +548,7 @@ int main( int, char *[] )
// Set descriptive statistics algorithm and its input data port
vtkDescriptiveStatistics* ds3 = vtkDescriptiveStatistics::New();
ds3->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, simpleTable );
ds3->SetInputData( vtkStatisticsAlgorithm::INPUT_DATA, simpleTable );
simpleTable->Delete();
// Select column of interest
......@@ -673,7 +673,7 @@ int main( int, char *[] )
// Set descriptive statistics algorithm and its input data port
vtkDescriptiveStatistics* ds4 = vtkDescriptiveStatistics::New();
ds4->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, gaussianTable );
ds4->SetInputData( vtkStatisticsAlgorithm::INPUT_DATA, gaussianTable );
gaussianTable->Delete();
// Select Column of Interest
......
......@@ -109,7 +109,7 @@ int main( int, char *[] )
cout << "done.\n";
// Prepare first test with data
haruspex->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, inputData );
haruspex->SetInputData( vtkStatisticsAlgorithm::INPUT_DATA, inputData );
haruspex->SetColumnStatus( inputData->GetColumnName( 0 ) , 1 );
haruspex->SetColumnStatus( inputData->GetColumnName( 2 ) , 1 );
haruspex->SetColumnStatus( "Testing", 1 );
......@@ -164,7 +164,7 @@ int main( int, char *[] )
}
haruspex->SetInput( vtkStatisticsAlgorithm::LEARN_PARAMETERS, paramData );
haruspex->SetInputData( vtkStatisticsAlgorithm::LEARN_PARAMETERS, paramData );
cout << "## Testing with input table:"
<< "\n";
......@@ -235,7 +235,7 @@ int main( int, char *[] )
vtkMultiBlockDataSet* paramsTables = vtkMultiBlockDataSet::New();
paramsTables->ShallowCopy( outputMetaDS );
haruspex->SetInput( vtkStatisticsAlgorithm::INPUT_MODEL, paramsTables );
haruspex->SetInputData( vtkStatisticsAlgorithm::INPUT_MODEL, paramsTables );
// Test Assess option only (do not recalculate nor rederive a model)
haruspex->SetLearnOption( false );
......
......@@ -8,12 +8,14 @@ endif()
project (Step1)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersSources
vtkFiltersSources
vtkInteractionStyle
vtkRendering${VTK_RENDERING_BACKEND}
)
include(${VTK_USE_FILE})
add_executable(Cone MACOSX_BUNDLE Cone.cxx)
target_link_libraries(Cone ${VTK_LIBRARIES})
target_link_libraries(Cone ${VTK_LIBRARIES})
\ No newline at end of file
......@@ -80,7 +80,7 @@ int main()
renWin->SetSize( 300, 300 );
//
// Now we loop over 360 degreeees and render the cone each time.
// Now we loop over 360 degrees and render the cone each time.
//
int i;
for (i = 0; i < 360; ++i)
......
......@@ -7,14 +7,15 @@ if(POLICY CMP0053)
endif()
project (Step2)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersSources
vtkFiltersSources
vtkInteractionStyle
vtkRendering${VTK_RENDERING_BACKEND}
)
include(${VTK_USE_FILE})
add_executable(Cone2 MACOSX_BUNDLE Cone2.cxx)
target_link_libraries(Cone2 ${VTK_LIBRARIES})
target_link_libraries(Cone2 ${VTK_LIBRARIES})
\ No newline at end of file
......@@ -8,7 +8,9 @@ endif()
project (Step3)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersSources
vtkInteractionStyle
vtkRendering${VTK_RENDERING_BACKEND}
......
......@@ -8,7 +8,9 @@ endif()
project (Step4)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersSources
vtkInteractionStyle
vtkRendering${VTK_RENDERING_BACKEND}
......
......@@ -8,7 +8,8 @@ endif()
PROJECT (Step5)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK(
vtkCommonCore
vtkFiltersSources
vtkInteractionStyle
......
......@@ -8,8 +8,11 @@ endif()
PROJECT (Step6)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkFiltersSources
vtkInteractionStyle
vtkInteractionWidgets
vtkRendering${VTK_RENDERING_BACKEND}
)
......
......@@ -7,8 +7,8 @@ if(POLICY CMP0053)
endif()
project (VisualizationAlgorithms)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkCommonDataModel
vtkFiltersCore
......
......@@ -7,8 +7,8 @@ if(POLICY CMP0053)
endif()
project (VolumeRendering)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkIOImage
vtkIOXML
......
......@@ -7,8 +7,8 @@ if(POLICY CMP0053)
endif()
project (Widgets)
find_package(VTK COMPONENTS
find_package(VTK REQUIRED)
vtk_module_load(
vtkCommonCore
vtkFiltersSources
vtkInteractionWidgets
......
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