------------------------------------------------------------------------------ Set the type of dereferenced cell. Checks to see whether cell type has changed and creates a new cell only if necessary.
| 443 | // Set the type of dereferenced cell. Checks to see whether cell type |
| 444 | // has changed and creates a new cell only if necessary. |
| 445 | void vtkGenericCell::SetCellType(int cellType) |
| 446 | { |
| 447 | if (this->Cell->GetCellType() != cellType) |
| 448 | { |
| 449 | if (cellType < 0 || cellType >= VTK_NUMBER_OF_CELL_TYPES) |
| 450 | { |
| 451 | this->Cell = nullptr; |
| 452 | } |
| 453 | else if (this->CellStore[cellType] == nullptr) |
| 454 | { |
| 455 | this->CellStore[cellType] = vtkGenericCell::InstantiateCell(cellType); |
| 456 | this->Cell = this->CellStore[cellType]; |
| 457 | } |
| 458 | else |
| 459 | { |
| 460 | this->Cell = this->CellStore[cellType]; |
| 461 | } |
| 462 | if (this->Cell == nullptr) |
| 463 | { |
| 464 | vtkErrorMacro(<< "Unsupported cell type: " << cellType << " Setting to vtkEmptyCell"); |
| 465 | this->Cell = this->CellStore[VTK_EMPTY_CELL]; |
| 466 | } |
| 467 | |
| 468 | this->Points->UnRegister(this); |
| 469 | this->Points = this->Cell->Points; |
| 470 | this->Points->Register(this); |
| 471 | this->PointIds->UnRegister(this); |
| 472 | this->PointIds = this->Cell->PointIds; |
| 473 | this->PointIds->Register(this); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | //------------------------------------------------------------------------------ |
| 478 | void vtkGenericCell::InterpolateFunctions(const double pcoords[3], double* weights) |