MCPcopy Create free account
hub / github.com/Kitware/VTK / BuildLabels

Method BuildLabels

Rendering/Label/vtkLabeledDataMapper.cxx:296–329  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

294
295//------------------------------------------------------------------------------
296void 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//------------------------------------------------------------------------------
332struct vtkLabeledDataMapper::vtkLabeledDataMapperFunctor

Callers 1

RenderOpaqueGeometryMethod · 0.95

Calls 12

AllocateLabelsMethod · 0.95
GetInputDataObjectMethod · 0.80
BuildLabelsInternalMethod · 0.80
DeleteMethod · 0.65
GetNumberOfPointsMethod · 0.45
NewIteratorMethod · 0.45
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45
GoToNextItemMethod · 0.45
GetCurrentDataObjectMethod · 0.45
GetClassNameMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected