----------------------------------------------------------------------------
| 167 | |
| 168 | //---------------------------------------------------------------------------- |
| 169 | bool vtkSMReaderReloadHelper::ExtendFileSeries(vtkSMSourceProxy* proxy) |
| 170 | { |
| 171 | if (!this->SupportsFileSeries(proxy)) |
| 172 | { |
| 173 | return false; |
| 174 | } |
| 175 | |
| 176 | SM_SCOPED_TRACE(CallFunction).arg("ExtendFileSeries").arg(proxy); |
| 177 | |
| 178 | const char* pname = vtkSMCoreUtilities::GetFileNameProperty(proxy); |
| 179 | assert(pname); |
| 180 | |
| 181 | vtkSMStringVectorProperty* svp = |
| 182 | vtkSMStringVectorProperty::SafeDownCast(proxy->GetProperty(pname)); |
| 183 | assert(svp && svp->GetRepeatable()); |
| 184 | if (svp->GetNumberOfElements() < 1) |
| 185 | { |
| 186 | vtkErrorMacro("Reader has not files specified. At least 1 file must be specified " |
| 187 | "to be able to add more to the series."); |
| 188 | return false; |
| 189 | } |
| 190 | |
| 191 | std::vector<std::string> files = |
| 192 | vtkGetFilesInSeries(proxy->GetSessionProxyManager(), svp->GetElement(0)); |
| 193 | if (!files.empty()) |
| 194 | { |
| 195 | svp->SetElements(files); |
| 196 | proxy->UpdateVTKObjects(); |
| 197 | proxy->UpdatePipelineInformation(); |
| 198 | return true; |
| 199 | } |
| 200 | return false; |
| 201 | } |
| 202 | |
| 203 | //---------------------------------------------------------------------------- |
| 204 | void vtkSMReaderReloadHelper::PrintSelf(ostream& os, vtkIndent indent) |
no test coverage detected