MCPcopy Create free account
hub / github.com/Kitware/ParaView / CopyFromCellAttribute

Method CopyFromCellAttribute

Remoting/Core/vtkPVArrayInformation.cxx:397–416  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

395
396//----------------------------------------------------------------------------
397void vtkPVArrayInformation::CopyFromCellAttribute(vtkCellGrid* grid, vtkCellAttribute* attribute)
398{
399 assert(!!attribute);
400 const int numComponents = attribute->GetNumberOfComponents();
401 assert(numComponents > 0);
402
403 this->Name = attribute->GetName().Data();
404 this->DataType = VTK_DOUBLE; // TODO: vtkCellAttribute doesn't force this.
405 // this->NumberOfTuples = 0; // TODO: Should we even try to answer this?
406
407 this->Components.resize(numComponents + 1);
408 for (int comp = -1; comp < numComponents; ++comp)
409 {
410 auto& compInfo = this->Components.at(comp + 1);
411 grid->GetCellAttributeRange(attribute, comp < 0 ? -2 : comp, compInfo.Range.GetData(), false);
412 grid->GetCellAttributeRange(
413 attribute, comp < 0 ? -2 : comp, compInfo.FiniteRange.GetData(), true);
414 compInfo.DefaultName = vtkPVPostFilter::DefaultComponentName(comp, numComponents);
415 }
416}
417
418//----------------------------------------------------------------------------
419void vtkPVArrayInformation::CopyFromGenericAttribute(vtkGenericAttribute* array)

Callers 1

CopyFromDataObjectMethod · 0.80

Calls 5

DataMethod · 0.80
GetNumberOfComponentsMethod · 0.45
GetNameMethod · 0.45
resizeMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected