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

Method SetCellType

Common/DataModel/vtkGenericCell.cxx:445–475  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Set the type of dereferenced cell. Checks to see whether cell type has changed and creates a new cell only if necessary.

Source from the content-addressed store, hash-verified

443// Set the type of dereferenced cell. Checks to see whether cell type
444// has changed and creates a new cell only if necessary.
445void 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//------------------------------------------------------------------------------
478void vtkGenericCell::InterpolateFunctions(const double pcoords[3], double* weights)

Callers 15

GetCellMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
StartRenderingMethod · 0.45
GetCellMethod · 0.45
GetCellMethod · 0.45
GetCellMethod · 0.45
GetDimensionMethod · 0.45

Calls 3

GetCellTypeMethod · 0.45
UnRegisterMethod · 0.45
RegisterMethod · 0.45