Common/DataModel/vtkUnstructuredGrid.cxx
//----------------------------------------------------------------------------
// Allocate memory space for data insertion. Execute this method before
// inserting any cells into object.
Allocate memory space for data insertion. Execute this method before
inserting any cells into object.
Allocate memory space for data insertion . Execute this method before inserting any cells into object .
void vtkUnstructuredGrid::Allocate (vtkIdType numCells, int extSize)
{
  if ( numCells < 1 )
  {
    numCells = 1000;
  }
  if ( extSize < 1 )
  {
    extSize = 1000;
  }
  if ( this->Connectivity )
  {
    this->Connectivity->UnRegister(this);
  }
  this->Connectivity = vtkCellArray::New();
  this->Connectivity->Allocate(numCells,4*extSize);
  this->Connectivity->Register(this);
  this->Connectivity->Delete();
  if ( this->Types )
  {
    this->Types->UnRegister(this);
  }
  this->Types = vtkUnsignedCharArray::New();
  this->Types->Allocate(numCells,extSize);
  this->Types->Register(this);
  this->Types->Delete();
  if ( this->Locations )
  {
    this->Locations->UnRegister(this);
  }
  this->Locations = vtkIdTypeArray::New();
  this->Locations->Allocate(numCells,extSize);
  this->Locations->Register(this);
  this->Locations->Delete();
  if ( this->DistinctCellTypes )
  {
    this->DistinctCellTypes->UnRegister(this);
  }
  this->DistinctCellTypes = vtkCellTypes::New();
  this->DistinctCellTypesUpdateMTime = 0;
  this->DistinctCellTypes->Register(this);
  this->DistinctCellTypes->Delete();
}
void vtkUnstructuredGrid :: Allocate ( vtkIdType numCells , int extSize ) { if ( numCells < 1 ) { numCells = 1000 ; } if ( extSize < 1 ) { extSize = 1000 ; } if ( this -> Connectivity ) { this -> Connectivity -> UnRegister ( this ) ; } this -> Connectivity = vtkCellArray :: New ( ) ; this -> Connectivity -> Allocate ( numCells , 4 * extSize ) ; this -> Connectivity -> Register ( this ) ; this -> Connectivity -> Delete ( ) ; if ( this -> Types ) { this -> Types -> UnRegister ( this ) ; } this -> Types = vtkUnsignedCharArray :: New ( ) ; this -> Types -> Allocate ( numCells , extSize ) ; this -> Types -> Register ( this ) ; this -> Types -> Delete ( ) ; if ( this -> Locations ) { this -> Locations -> UnRegister ( this ) ; } this -> Locations = vtkIdTypeArray :: New ( ) ; this -> Locations -> Allocate ( numCells , extSize ) ; this -> Locations -> Register ( this ) ; this -> Locations -> Delete ( ) ; if ( this -> DistinctCellTypes ) { this -> DistinctCellTypes -> UnRegister ( this ) ; } this -> DistinctCellTypes = vtkCellTypes :: New ( ) ; this -> DistinctCellTypesUpdateMTime = 0 ; this -> DistinctCellTypes -> Register ( this ) ; this -> DistinctCellTypes -> Delete ( ) ; }
Allocate memory space for data insertion.
Allocate memory space for data insertion .