File: TestF3DSPZReader.cxx

package info (click to toggle)
f3d 3.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,668 kB
  • sloc: cpp: 99,109; python: 811; sh: 342; xml: 238; java: 101; javascript: 95; makefile: 25
file content (34 lines) | stat: -rw-r--r-- 755 bytes parent folder | download
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;
}