建立Chapo2文件,根目录下有:
1.CMakeLists.txt文件
cmake_minimum_required(VERSION 3.1)
PROJECT(second)
find_package(VTK REQUIRED) include(${VTK_USE_FILE})
add_executable(second MACOSX_BUNDLE second.cxx )
target_link_libraries(second ${VTK_LIBRARIES})
2.second.cxx:
#include<vtkSmartPointer.h>
#include<vtkRenderWindow.h>
#include<vtkPlaneSource.h>
#include<vtkActor.h>
#include<vtkJPEGReader.h>
#include<vtkPolyDataMapper.h>
#include<vtkRenderer.h>
#include "vtkRenderWindowInteractor.h"
#include "vtkProperty.h"
int main (