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

Function GenerateNewRandomArrayName

Testing/Core/vtkTestUtilities.cxx:1351–1363  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1349
1350//----------------------------------------------------------------------------
1351void GenerateNewRandomArrayName(std::string nameRoot, vtkAbstractArray* array1,
1352 vtkAbstractArray* array2, vtkFieldData* fd1, vtkFieldData* fd2)
1353{
1354 std::string name;
1355 do
1356 {
1357 // The name is an integer over 2 bytes written in hexadecimal. We are unlikely not to find one.
1358 name = nameRoot + GenerateRandomHexaString();
1359 } while (fd1->GetAbstractArray(name.c_str()) && fd2->GetAbstractArray(name.c_str()));
1360
1361 array1->SetName(name.c_str());
1362 array2->SetName(name.c_str());
1363}
1364
1365//----------------------------------------------------------------------------
1366void AddArrayCopyWithUniqueNameToFieldData(std::string nameRoot, vtkDataArray* array1,

Calls 4

GenerateRandomHexaStringFunction · 0.85
GetAbstractArrayMethod · 0.80
c_strMethod · 0.45
SetNameMethod · 0.45

Tested by

no test coverage detected