Commit 610b8855 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Merge branch 'fix/vtk6' of /opt/gitlab/repositories/nektar

parents 8307c7d5 8f4cf4e7
......@@ -35,6 +35,5 @@ IF( NEKTAR_USE_VTK )
INCLUDE (${VTK_USE_FILE})
MARK_AS_ADVANCED(VTK_DIR)
ADD_DEFINITIONS(-DNEKTAR_USING_VTK)
INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
ENDIF( NEKTAR_USE_VTK )
......@@ -11,5 +11,10 @@ ADD_UTILITIES_EXECUTABLE(SplitModes util-extra SplitModes.cpp)
IF (NEKTAR_USE_VTK)
ADD_UTILITIES_EXECUTABLE(VtkToPng util-extra VtkToPng.cpp)
TARGET_LINK_LIBRARIES(VtkToPng vtkCommon vtksys vtkViews vtkWidgets vtkRendering vtkIO)
IF (VTK_MAJOR_VERSION LESS 6)
TARGET_LINK_LIBRARIES(VtkToPng vtkCommon vtksys vtkViews vtkWidgets
vtkRendering vtkIO)
ELSE ()
TARGET_LINK_LIBRARIES(VtkToPng ${VTK_LIBRARIES})
ENDIF ()
ENDIF (NEKTAR_USE_VTK)
......@@ -42,7 +42,6 @@
#include <vtkWindowToImageFilter.h>
#include <vtkPNGWriter.h>
#include <vtkGraphicsFactory.h>
#include <vtkImagingFactory.h>
#include <vtkXMLUnstructuredGridReader.h>
#include <vtkDataSetMapper.h>
#include <vtkLookupTable.h>
......@@ -69,10 +68,6 @@ int main(int argc, char * argv[])
graphics_factory->SetOffScreenOnlyMode( 1);
graphics_factory->SetUseMesaClasses( 1 );
vtkSmartPointer<vtkImagingFactory> imaging_factory =
vtkSmartPointer<vtkImagingFactory>::New();
imaging_factory->SetUseMesaClasses( 1 );
// Create a poly data reader and retrieve dataset from file
vtkXMLUnstructuredGridReader* reader = vtkXMLUnstructuredGridReader::New();
reader->SetFileName(vInput.c_str());
......@@ -100,7 +95,11 @@ int main(int argc, char * argv[])
// Create a mapper and actor
vtkSmartPointer<vtkDataSetMapper> mapper =
vtkSmartPointer<vtkDataSetMapper>::New();
#if VTK_MAJOR_VERSION <= 5
mapper->SetInput(data);
#else
mapper->SetInputData(data);
#endif
mapper->ImmediateModeRenderingOn();
mapper->ScalarVisibilityOn();
mapper->SetScalarModeToUsePointData();
......
......@@ -9,7 +9,13 @@ IF (NEKTAR_USE_VTK)
SET(VtkStripsToPolysSources VtkStripsToPolys.cpp)
ADD_UTILITIES_EXECUTABLE(VtkToFld util-extra ${VtkToFldSources})
ADD_UTILITIES_EXECUTABLE(VtkStripsToPolys util-extra ${VtkStripsToPolysSources})
TARGET_LINK_LIBRARIES(VtkToFld vtkCommon vtkIO vtkGraphics)
TARGET_LINK_LIBRARIES(VtkStripsToPolys vtkCommon vtkIO vtkGraphics)
IF (VTK_MAJOR_VERSION LESS 6)
TARGET_LINK_LIBRARIES(VtkToFld vtkCommon vtkIO vtkGraphics)
TARGET_LINK_LIBRARIES(VtkStripsToPolys vtkCommon vtkIO vtkGraphics)
ELSE ()
TARGET_LINK_LIBRARIES(VtkToFld vtkCommonCore vtkIOLegacy
vtkFiltersGeometry)
TARGET_LINK_LIBRARIES(VtkStripsToPolys vtkCommonCore vtkIOLegacy)
ENDIF ()
ENDIF (NEKTAR_USE_VTK)
......@@ -45,6 +45,10 @@ int main(int argc, char* argv[])
// Write out the new mesh
vtkPolyDataWriter *vtkMeshWriter = vtkPolyDataWriter::New();
vtkMeshWriter->SetFileName(argv[2]);
#if VTK_MAJOR_VERSION <= 5
vtkMeshWriter->SetInput(vtkMesh);
#else
vtkMeshWriter->SetInputData(vtkMesh);
#endif
vtkMeshWriter->Update();
}
......@@ -184,7 +184,11 @@ int main(int argc, char* argv[])
vtkPolyData *vtkMesh = vtkMeshReader->GetOutput();
vtkCellDataToPointData* c2p = vtkCellDataToPointData::New();
#if VTK_MAJOR_VERSION <= 5
c2p->SetInput(vtkMesh);
#else
c2p->SetInputData(vtkMesh);
#endif
c2p->PassCellDataOn();
c2p->Update();
vtkPolyData *vtkDataAtPoints = c2p->GetPolyDataOutput();
......
......@@ -49,5 +49,9 @@ ENDIF (NEKTAR_USE_VTK)
ADD_UTILITIES_EXECUTABLE(MeshConvert util ${MeshConvertSources} ${MeshConvertHeaders})
IF (NEKTAR_USE_VTK)
TARGET_LINK_LIBRARIES(MeshConvert vtkCommon vtkIO vtkGraphics)
IF (VTK_MAJOR_VERSION LESS 6)
TARGET_LINK_LIBRARIES(MeshConvert vtkCommon vtkIO vtkGraphics)
ELSE ()
TARGET_LINK_LIBRARIES(MeshConvert vtkCommonCore vtkIOLegacy)
ENDIF ()
ENDIF (NEKTAR_USE_VTK)
......@@ -106,7 +106,11 @@ namespace Nektar
// Write out the new mesh
vtkPolyDataWriter *vtkMeshWriter = vtkPolyDataWriter::New();
vtkMeshWriter->SetFileName(m_config["outfile"].as<string>().c_str());
#if VTK_MAJOR_VERSION <= 5
vtkMeshWriter->SetInput(vtkMesh);
#else
vtkMeshWriter->SetInputData(vtkMesh);
#endif
vtkMeshWriter->Update();
}
}
......
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