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

Method AddPointArray

IO/Exodus/vtkExodusIIReader.cxx:1317–1346  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1315
1316//------------------------------------------------------------------------------
1317void vtkExodusIIReaderPrivate::AddPointArray(
1318 vtkDataArray* src, BlockSetInfoType* bsinfop, vtkUnstructuredGrid* output)
1319{
1320 vtkPointData* pd = output->GetPointData();
1321 if (this->SqueezePoints)
1322 {
1323 // subset the array using PointMap
1324 vtkDataArray* dest = vtkDataArray::CreateDataArray(src->GetDataType());
1325 dest->SetName(src->GetName());
1326 dest->SetNumberOfComponents(src->GetNumberOfComponents());
1327 dest->SetNumberOfTuples(bsinfop->NextSqueezePoint);
1328 std::map<vtkIdType, vtkIdType>::iterator it, itEnd;
1329 //
1330 // I moved the end condition of the loop out of the for(;;) loop.
1331 // Assuming it doesn't change within the loop itself!
1332 // The reason is that the code was making the call every loop.
1333 //
1334 itEnd = bsinfop->PointMap.end();
1335 for (it = bsinfop->PointMap.begin(); it != itEnd; ++it)
1336 {
1337 pd->CopyTuple(src, dest, it->first, it->second);
1338 }
1339 pd->AddArray(dest);
1340 dest->FastDelete();
1341 }
1342 else
1343 {
1344 pd->AddArray(src);
1345 }
1346}
1347
1348//------------------------------------------------------------------------------
1349void vtkExodusIIReaderPrivate::InsertSetNodeCopies(

Callers 2

Calls 13

CopyTupleMethod · 0.80
FastDeleteMethod · 0.80
CreateDataArrayFunction · 0.50
GetPointDataMethod · 0.45
GetDataTypeMethod · 0.45
SetNameMethod · 0.45
GetNameMethod · 0.45
SetNumberOfComponentsMethod · 0.45
GetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected