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

Method ForwardAttributes

Filters/Temporal/vtkDataObjectMeshCache.cxx:554–583  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

552
553//------------------------------------------------------------------------------
554void vtkDataObjectMeshCache::ForwardAttributes(
555 vtkDataSet* input, vtkDataSet* cache, vtkDataSet* output, int attribute, const std::string& name)
556{
557 vtkCacheLog(INFO, "Forward attribute " << vtkDataObject::GetAssociationTypeAsString(attribute));
558
559 auto inAttribute = input->GetAttributes(attribute);
560 auto outAttribute = output->GetAttributes(attribute);
561 auto cacheAttribute = cache->GetAttributes(attribute);
562
563 auto originalIds = cacheAttribute->GetArray(name.c_str());
564 if (!originalIds)
565 {
566 vtkCacheLog(
567 INFO, "Global Ids not found for " << vtkDataObject::GetAssociationTypeAsString(attribute));
568 return;
569 }
570
571 outAttribute->CopyAllOn();
572 outAttribute->CopyAllocate(inAttribute);
573
574 // NOTE potential optimization:
575 // this copy may be replaced by an use of SMPTools (or optionally the implicit vtkIndexedArray?)
576 auto ptsIdsRange = vtk::DataArrayValueRange(originalIds);
577 vtkIdType outId = 0;
578 for (auto originalId : ptsIdsRange)
579 {
580 outAttribute->CopyData(inAttribute, originalId, outId);
581 outId++;
582 }
583}
584
585//------------------------------------------------------------------------------
586bool vtkDataObjectMeshCache::CacheHasRequestedIds() const

Callers 1

Calls 7

DataArrayValueRangeFunction · 0.85
GetAttributesMethod · 0.45
GetArrayMethod · 0.45
c_strMethod · 0.45
CopyAllOnMethod · 0.45
CopyAllocateMethod · 0.45
CopyDataMethod · 0.45

Tested by

no test coverage detected