------------------------------------------------------------------------------ This function sets an array containing file names
| 185 | //------------------------------------------------------------------------------ |
| 186 | // This function sets an array containing file names |
| 187 | void vtkImageReader2::SetFileNames(vtkStringArray* filenames) |
| 188 | { |
| 189 | if (filenames == this->FileNames) |
| 190 | { |
| 191 | return; |
| 192 | } |
| 193 | if (this->FileNames) |
| 194 | { |
| 195 | this->FileNames->Delete(); |
| 196 | this->FileNames = nullptr; |
| 197 | } |
| 198 | if (filenames) |
| 199 | { |
| 200 | this->FileNames = filenames; |
| 201 | this->FileNames->Register(this); |
| 202 | if (this->FileNames->GetNumberOfValues() > 0) |
| 203 | { |
| 204 | this->DataExtent[4] = 0; |
| 205 | this->DataExtent[5] = this->FileNames->GetNumberOfValues() - 1; |
| 206 | } |
| 207 | delete[] this->FilePrefix; |
| 208 | this->FilePrefix = nullptr; |
| 209 | delete[] this->FileName; |
| 210 | this->FileName = nullptr; |
| 211 | } |
| 212 | |
| 213 | this->Modified(); |
| 214 | } |
| 215 | |
| 216 | //------------------------------------------------------------------------------ |
| 217 | // This function sets the pattern of the file name which turn a prefix |