MCPcopy Create free account
hub / github.com/Kitware/ParaView / vtkGetFilesInSeries

Function vtkGetFilesInSeries

Remoting/ServerManager/vtkSMReaderReloadHelper.cxx:67–100  ·  view source on GitHub ↗

Returns empty to indicate nothing found or don't bother updating.

Source from the content-addressed store, hash-verified

65
66// Returns empty to indicate nothing found or don't bother updating.
67std::vector<std::string> vtkGetFilesInSeries(vtkSMSessionProxyManager* pxm, const char* fname)
68{
69 std::string dir = vtksys::SystemTools::GetFilenamePath(fname);
70
71 // We use unix-slashes so we can consistently compare filenames in
72 // vtkFindFileGroupFor().
73 std::string unixFname = fname;
74 vtksys::SystemTools::ConvertToUnixSlashes(unixFname);
75
76 vtkSmartPointer<vtkSMProxy> helper;
77 helper.TakeReference(pxm->NewProxy("misc", "FileInformationHelper"));
78 vtkSMPropertyHelper(helper, "WorkingDirectory").Set(dir.c_str());
79 vtkSMPropertyHelper(helper, "Path").Set(dir.c_str());
80 vtkSMPropertyHelper(helper, "SpecialDirectories").Set(0);
81 vtkSMPropertyHelper(helper, "DirectoryListing").Set(1);
82 helper->UpdateVTKObjects();
83
84 vtkNew<vtkPVFileInformation> info;
85 helper->GatherInformation(info.Get());
86
87 if (vtkPVFileInformation* group = vtkFindFileGroupFor(info.Get(), unixFname))
88 {
89 std::vector<std::string> retval(group->GetContents()->GetNumberOfItems());
90 for (int cc = 0, max = group->GetContents()->GetNumberOfItems(); cc < max; ++cc)
91 {
92 vtkPVFileInformation* item =
93 vtkPVFileInformation::SafeDownCast(group->GetContents()->GetItemAsObject(cc));
94 retval[cc] = item->GetFullPath();
95 }
96 return retval;
97 }
98
99 return std::vector<std::string>();
100}
101}
102
103vtkStandardNewMacro(vtkSMReaderReloadHelper);

Callers 1

ExtendFileSeriesMethod · 0.85

Calls 7

vtkFindFileGroupForFunction · 0.85
GetNumberOfItemsMethod · 0.80
NewProxyMethod · 0.45
SetMethod · 0.45
UpdateVTKObjectsMethod · 0.45
GatherInformationMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected