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

Method AllocateExact

Common/DataModel/vtkUnstructuredGrid.cxx:1472–1499  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1470
1471//------------------------------------------------------------------------------
1472bool vtkUnstructuredGrid::AllocateExact(vtkIdType numCells, vtkIdType connectivitySize)
1473{
1474 if (numCells < 1)
1475 {
1476 numCells = 1024;
1477 }
1478 if (connectivitySize < 1)
1479 {
1480 connectivitySize = 1024;
1481 }
1482
1483 this->DistinctCellTypesUpdateMTime = 0;
1484 this->DistinctCellTypes = vtkSmartPointer<vtkCellTypes>::New();
1485 this->Types = vtkSmartPointer<vtkUnsignedCharArray>::New();
1486 this->Connectivity = vtkSmartPointer<vtkCellArray>::New();
1487
1488 bool result = this->Connectivity->AllocateExact(numCells, connectivitySize);
1489 if (result)
1490 {
1491 result = this->Types->Allocate(numCells) != 0;
1492 }
1493 if (result)
1494 {
1495 result = this->DistinctCellTypes->Allocate(VTK_NUMBER_OF_CELL_TYPES) != 0;
1496 }
1497
1498 return result;
1499}
1500
1501//----------------------------------------------------------------------------
1502// Supporting functions for IsCellBoundary() and GetCellNeighbors(). These

Callers 2

GetPolyhedronFacesMethod · 0.45
SetCellsMethod · 0.45

Calls 2

NewFunction · 0.50
AllocateMethod · 0.45

Tested by

no test coverage detected