1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <vtkFileResourceStream.h>
#include <vtkNew.h>
#include <vtkTestUtilities.h>
#include "vtkF3DSPZReader.h"
#include <iostream>
int TestF3DSPZReader(int vtkNotUsed(argc), char* argv[])
{
std::string path = std::string(argv[1]) + "data/hornedlizard_small_d0.spz";
vtkNew<vtkFileResourceStream> stream;
if (!stream->Open(path.c_str()))
{
std::cerr << "Cannot open file" << std::endl;
return EXIT_FAILURE;
}
vtkNew<vtkF3DSPZReader> reader;
reader->SetStream(stream);
reader->Update();
vtkIdType nbGaussians = reader->GetOutput()->GetNumberOfPoints();
if (nbGaussians != 13296)
{
std::cerr << "Incorrect number of gaussians: " << nbGaussians << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
|