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

Method ConvertToSmallestStorage

Common/DataModel/vtkCellArray.cxx:1304–1333  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1302
1303//------------------------------------------------------------------------------
1304bool vtkCellArray::ConvertToSmallestStorage()
1305{
1306 bool isHomogeneous = this->IsHomogeneous() >= 0;
1307 if (!isHomogeneous)
1308 {
1309 if (this->IsStorage64Bit() && this->CanConvertTo32BitStorage())
1310 {
1311 return this->ConvertTo32BitStorage();
1312 }
1313 // Already at the smallest possible.
1314 return true;
1315 }
1316 else
1317 {
1318 if (this->IsStorage64Bit() || this->IsStorageFixedSize64Bit())
1319 {
1320 if (this->CanConvertTo32BitStorage()) // Avoid checking for homogeneity again
1321 {
1322 return this->ConvertToFixedSize32BitStorage();
1323 }
1324 return this->ConvertToFixedSize64BitStorage();
1325 }
1326 else if (this->IsStorage32Bit())
1327 {
1328 return this->ConvertToFixedSize32BitStorage();
1329 }
1330 // Already at the smallest possible.
1331 return true;
1332 }
1333}
1334
1335//------------------------------------------------------------------------------
1336bool vtkCellArray::AllocateExact(vtkIdType numCells, vtkIdType connectivitySize)

Callers

nothing calls this directly

Tested by

no test coverage detected