------------------------------------------------------------------------------
| 300 | |
| 301 | //------------------------------------------------------------------------------ |
| 302 | void vtkDataObjectMeshCache::UpdateCache(vtkDataObject* output) |
| 303 | { |
| 304 | if (!output) |
| 305 | { |
| 306 | vtkWarningMacro("Cannot update from nullptr"); |
| 307 | return; |
| 308 | } |
| 309 | |
| 310 | bool isSupported = this->IsSupportedData(output); |
| 311 | if (!isSupported) |
| 312 | { |
| 313 | vtkWarningMacro("Cannot update from unsupported data type: " << output->GetClassName()); |
| 314 | return; |
| 315 | } |
| 316 | |
| 317 | this->Cache.TakeReference(output->NewInstance()); |
| 318 | this->Cache->ShallowCopy(output); |
| 319 | this->CachedOriginalMeshTime = this->GetOriginalMeshTime(); |
| 320 | this->CachedConsumerTime = this->Consumer->GetMTime(); |
| 321 | |
| 322 | vtkCacheLog(INFO, "Update Cache: " << this->Cache.GetPointer()); |
| 323 | this->Modified(); |
| 324 | } |
| 325 | |
| 326 | //------------------------------------------------------------------------------ |
| 327 | void vtkDataObjectMeshCache::InvalidateCache() |