------------------------------------------------------------------------------
| 294 | |
| 295 | //------------------------------------------------------------------------------ |
| 296 | void vtkLabeledDataMapper::BuildLabels() |
| 297 | { |
| 298 | vtkDebugMacro(<< "Rebuilding labels"); |
| 299 | vtkDataObject* inputDO = this->GetInputDataObject(0, 0); |
| 300 | vtkCompositeDataSet* cd = vtkCompositeDataSet::SafeDownCast(inputDO); |
| 301 | vtkDataSet* ds = vtkDataSet::SafeDownCast(inputDO); |
| 302 | if (ds) |
| 303 | { |
| 304 | this->AllocateLabels(ds->GetNumberOfPoints()); |
| 305 | this->NumberOfLabels = 0; |
| 306 | this->BuildLabelsInternal(ds); |
| 307 | } |
| 308 | else if (cd) |
| 309 | { |
| 310 | this->AllocateLabels(cd->GetNumberOfPoints()); |
| 311 | this->NumberOfLabels = 0; |
| 312 | vtkCompositeDataIterator* iter = cd->NewIterator(); |
| 313 | for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem()) |
| 314 | { |
| 315 | ds = vtkDataSet::SafeDownCast(iter->GetCurrentDataObject()); |
| 316 | if (ds) |
| 317 | { |
| 318 | this->BuildLabelsInternal(ds); |
| 319 | } |
| 320 | } |
| 321 | iter->Delete(); |
| 322 | } |
| 323 | else |
| 324 | { |
| 325 | vtkErrorMacro("Unsupported data type: " << inputDO->GetClassName()); |
| 326 | } |
| 327 | |
| 328 | this->BuildTime.Modified(); |
| 329 | } |
| 330 | |
| 331 | //------------------------------------------------------------------------------ |
| 332 | struct vtkLabeledDataMapper::vtkLabeledDataMapperFunctor |
no test coverage detected