Remote module: Poisson Reconstruction
Hi !
For one of my projects, I was trying to use the VTK remote module PoissonReconstruction. It build fine in VTK but I wasn't able to build against it in an external library.
I used the following simple CMakeLists:
#-----------------------------------------------------------------------------
project(BuildAgainstPoisson)
cmake_minimum_required(VERSION 3.6)
#-----------------------------------------------------------------------------
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
include_directories(
${VTK_INCLUDE_DIRS}
${PoissonReconstruction_INCLUDE_DIRS}
)
add_executable(BuildAgainstPoisson main.cxx)
target_link_libraries(BuildAgainstPoisson ${VTK_LIBRARIES} PoissonReconstruction)
with the main.cxx:
#include "vtkPoissonReconstruction.h"
#include "vtkSmartPointer.h"
#include "vtkXMLPolyDataReader.h"
#include "vtkXMLPolyDataWriter.h"
#include "vtkPolyDataWriter.h"
int main( int argc, char * argv[] )
{
vtkSmartPointer< vtkXMLPolyDataReader > reader =
vtkSmartPointer< vtkXMLPolyDataReader >::New();
reader->SetFileName(argv[1]);
vtkSmartPointer< vtkPoissonReconstruction > poissonFilter =
vtkSmartPointer< vtkPoissonReconstruction >::New();
poissonFilter->SetDepth(10);
poissonFilter->SetInputConnection( reader->GetOutputPort() );
vtkSmartPointer< vtkXMLPolyDataWriter > writer =
vtkSmartPointer< vtkXMLPolyDataWriter >::New();
writer->SetInputConnection(poissonFilter->GetOutputPort());
writer->SetFileName(argv[2]);
writer->Update();
return EXIT_SUCCESS;
}