| 269 | |
| 270 | template <typename SourceArrayT, typename TargetArrayT> |
| 271 | bool Process(SourceArrayT* src, TargetArrayT* dst) const |
| 272 | { |
| 273 | // check if we can shallow copy it first |
| 274 | if (src->IsA(dst->GetClassName())) |
| 275 | { |
| 276 | dst->ShallowCopy(src); |
| 277 | return true; |
| 278 | } |
| 279 | // Check that allocation succeeds: |
| 280 | if (!dst->Resize(src->GetNumberOfTuples())) |
| 281 | { |
| 282 | return false; |
| 283 | } |
| 284 | |
| 285 | // Copy data: |
| 286 | dst->DeepCopy(src); |
| 287 | |
| 288 | // Free old memory: |
| 289 | src->Resize(0); |
| 290 | |
| 291 | return true; |
| 292 | } |
| 293 | }; |
| 294 | |
| 295 | struct IsHomogeneousImpl : public vtkCellArray::DispatchUtilities |
no test coverage detected