bool FemPostPipeline::canRead(Base::FileInfo File) { if (File.hasExtension("vtk") || // from FemResult only unstructural mesh is supported in femvtktoools.cpp File.hasExtension("vtp") || File.hasExtension("vts") || File.hasExtension("vtr") || File.hasExtension("vti") || File.hasExtension("vtu")) return true; return false; }
void FemPostPipeline::read(Base::FileInfo File) { // checking on the file if (!File.isReadable()) throw Base::FileException("File to load not existing or not readable", File); if (File.hasExtension("vtu")) readXMLFile<vtkXMLUnstructuredGridReader>(File.filePath()); else if (File.hasExtension("vtp")) readXMLFile<vtkXMLPolyDataReader>(File.filePath()); else if (File.hasExtension("vts")) readXMLFile<vtkXMLStructuredGridReader>(File.filePath()); else if (File.hasExtension("vtr")) readXMLFile<vtkXMLRectilinearGridReader>(File.filePath()); else if (File.hasExtension("vti")) readXMLFile<vtkXMLImageDataReader>(File.filePath()); else if (File.hasExtension("vtk")) readXMLFile<vtkDataSetReader>(File.filePath()); else throw Base::FileException("Unknown extension"); }