Common/DataModel/vtkUnstructuredGrid.cxx
//----------------------------------------------------------------------------
// Insert/create cell in object by type and list of point ids defining
// cell topology. Using a special input format, this function also support
// polyhedron cells.
Insert/create cell in object by type and list of point ids defining
cell topology. Using a special input format, this function also support
polyhedron cells.
Insert / create cell in object by type and list of point ids defining cell topology . Using a special input format this function also support polyhedron cells .
vtkIdType vtkUnstructuredGrid::InternalInsertNextCell(int type, vtkIdList *ptIds)
{
  if (type == VTK_POLYHEDRON)
  {
    vtkIdType* dataPtr = ptIds->GetPointer(0);
    return this->InsertNextCell(type, dataPtr[0], dataPtr+1);
  }
  vtkIdType npts = ptIds->GetNumberOfIds();
  this->Connectivity->InsertNextCell(ptIds);
  vtkDebugMacro(<< "insert location "
                << this->Connectivity->GetInsertLocation(npts));
  this->Locations->InsertNextValue(this->Connectivity->GetInsertLocation(npts));
  if ( this->FaceLocations )
  {
    this->FaceLocations->InsertNextValue(-1);
  }
  return this->Types->InsertNextValue(static_cast<unsigned char>(type));
}
vtkIdType vtkUnstructuredGrid :: InternalInsertNextCell ( int type , vtkIdList * ptIds ) { if ( type == VTK_POLYHEDRON ) { vtkIdType * dataPtr = ptIds -> GetPointer ( 0 ) ; return this -> InsertNextCell ( type , dataPtr [ 0 ] , dataPtr + 1 ) ; } vtkIdType npts = ptIds -> GetNumberOfIds ( ) ; this -> Connectivity -> InsertNextCell ( ptIds ) ; vtkDebugMacro ( << " " << this -> Connectivity -> GetInsertLocation ( npts ) ) ; this -> Locations -> InsertNextValue ( this -> Connectivity -> GetInsertLocation ( npts ) ) ; if ( this -> FaceLocations ) { this -> FaceLocations -> InsertNextValue ( -1 ) ; } return this -> Types -> InsertNextValue ( static_cast < unsigned char > ( type ) ) ; }
Insert/create cell in object by type and list of point ids defining
cell topology.
Insert / create cell in object by type and list of point ids defining cell topology .
// For polyhedron cell, input ptIds is of format: // (numCellFaces, numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...) // insert connectivity // insert type and storage information // If faces have been created, we need to pad them (we are not creating // a polyhedral cell in this method) // insert cell type