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

Method AddTimeStep

Filters/Extraction/vtkExtractDataArraysOverTime.cxx:285–313  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

283
284//------------------------------------------------------------------------------
285void vtkExtractDataArraysOverTime::vtkInternal::AddTimeStep(
286 int ts_index, double time, vtkDataObject* data)
287{
288 this->TimeArray->SetTypedComponent(ts_index, 0, time);
289 const int attributeType = this->Self->GetFieldAssociation();
290
291 if (auto cd = vtkCompositeDataSet::SafeDownCast(data))
292 {
293 vtkCompositeDataIterator* iter = cd->NewIterator();
294 for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
295 {
296 if (auto block = iter->GetCurrentDataObject())
297 {
298 if (block->GetAttributesAsFieldData(attributeType) != nullptr)
299 {
300 this->AddTimeStepInternal(iter->GetCurrentFlatIndex(), ts_index, time, block);
301 }
302 }
303 }
304 iter->Delete();
305 }
306 else if (data)
307 {
308 if (data->GetAttributesAsFieldData(attributeType) != nullptr)
309 {
310 this->AddTimeStepInternal(0, ts_index, time, data);
311 }
312 }
313}
314
315//------------------------------------------------------------------------------
316static void vtkExtractArraysAssignUniqueCoordNames(

Callers 1

RequestDataMethod · 0.45

Calls 11

AddTimeStepInternalMethod · 0.95
GetFieldAssociationMethod · 0.80
GetCurrentFlatIndexMethod · 0.80
DeleteMethod · 0.65
SetTypedComponentMethod · 0.45
NewIteratorMethod · 0.45
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45
GoToNextItemMethod · 0.45
GetCurrentDataObjectMethod · 0.45

Tested by

no test coverage detected