57 : AnalyticalF<3,T,T>(3)
58 {
59 this->
getName() =
"VelocityVolumeImporter";
60
61 OstreamManager clout(std::cout, "VelocityVolumeImporter");
62 _fileName = fileName;
63
64 #if not defined(FEATURE_VTK)
65 if (isVTIFile(_fileName))
66 {
67 std::cerr << "To use the VTK format, add VTK to the FEATURES list in config.mk";
69 }
70 #endif
71 #if defined(FEATURE_VTK)
72 if (!isVTIFile(_fileName)) {
73 std::cerr << "Please convert your file to .vti to use the functor.";
75 } else {
76 clout << "Read .vti file..." << std::endl;
77 _reader->SetFileName(fileName.c_str());
78 _reader->Update();
79 auto* _data = _reader->GetOutput();
80
81 _spacing = static_cast<T>(_data->GetSpacing()[0]);
82 clout << "Read spacing : " << _spacing << std::endl;
83 _data->GetDimensions(_shape.
data());
84 clout << "Read shape : " << _shape << std::endl;
85 _data->GetOrigin(_origin.
data());
86 clout << "Read origin : " << _origin << std::endl;
87
88 vtkCellData* _cellData = _data->GetCellData();
89 vtkPointData* _pointData = _data->GetPointData();
90 if (_cellData->GetNumberOfArrays() > 0) {
91 clout << "Found CellData. " << std::endl;
92 CellData = true;
93 _cellLocator->SetDataSet(_data);
94 _cellLocator->BuildLocator();
95 } else if (_pointData->GetNumberOfArrays() > 0) {
96 clout << "Found PointData." << std::endl;
97 clout << "Warning: If functor reads only 0, consider converting PointData to CellData." << std::endl;
98 PointData = true;
99 } else {
100 std::cerr << "Neither cell data nor point data found.";
102 }
103 }
104 #endif
105 }
std::string & getName()
read and write access to name
constexpr const T * data() const any_platform