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

Method RegisterFieldData

Filters/Geometry/vtkAbstractGridConnectivity.h:426–459  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

424
425//------------------------------------------------------------------------------
426inline void vtkAbstractGridConnectivity::RegisterFieldData(
427 int gridID, vtkPointData* PointData, vtkCellData* CellData)
428{
429 // Sanity check
430 assert("pre: GridID is out-of-bound GridPointData" && (gridID >= 0) &&
431 (gridID < static_cast<int>(this->NumberOfGrids)));
432 assert("pre: GridPointData has not been allocated!" &&
433 (this->GridPointData.size() == this->NumberOfGrids));
434 assert("pre: GridCellData has not been allocated!" &&
435 (this->GridCellData.size() == this->NumberOfGrids));
436
437 // Note: The size of these vectors is allocated in SetNumberOfGrids
438 if (PointData != nullptr)
439 {
440 assert("pre: GridPointData[gridID] must be nullptr" && this->GridPointData[gridID] == nullptr);
441 this->GridPointData[gridID] = vtkPointData::New();
442 this->GridPointData[gridID]->ShallowCopy(PointData);
443 }
444 else
445 {
446 this->GridPointData[gridID] = nullptr;
447 }
448
449 if (CellData != nullptr)
450 {
451 assert("pre: GridCellData[gridID] must be nullptr" && this->GridCellData[gridID] == nullptr);
452 this->GridCellData[gridID] = vtkCellData::New();
453 this->GridCellData[gridID]->ShallowCopy(CellData);
454 }
455 else
456 {
457 this->GridCellData[gridID] = nullptr;
458 }
459}
460
461//------------------------------------------------------------------------------
462inline void vtkAbstractGridConnectivity::RegisterGridNodes(int gridID, vtkPoints* nodes)

Callers 2

RegisterGridMethod · 0.80
RegisterGridMethod · 0.80

Calls 4

assertFunction · 0.50
NewFunction · 0.50
sizeMethod · 0.45
ShallowCopyMethod · 0.45

Tested by

no test coverage detected