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

Method InitWithOneCell

Testing/GenericBridge/vtkBridgeCellIteratorOne.cxx:143–166  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Used internally by vtkBridgeDataSet. Iterate on one cell `id' of `ds'. \pre ds_exists: ds!=0 \pre valid_id: (id>=0)&&(id<=ds->GetNumberOfCells())

Source from the content-addressed store, hash-verified

141// \pre ds_exists: ds!=0
142// \pre valid_id: (id>=0)&&(id<=ds->GetNumberOfCells())
143void vtkBridgeCellIteratorOne::InitWithOneCell(vtkBridgeDataSet* ds, vtkIdType cellid)
144{
145 assert("pre: ds_exists" && ds != nullptr);
146 assert("pre: valid_id" && ((cellid >= 0) && (cellid <= ds->GetNumberOfCells())));
147
148 if ((this->Cell != nullptr) && (this->DataSet == nullptr) && (this->InternalCell == nullptr))
149 {
150 // previous mode was InitWithOneCell(vtkBridgeCell *c)
151 // this->Cell->Delete();
152 this->Cell = nullptr;
153 }
154
155 if (this->Cell == nullptr)
156 {
157 // first init or previous mode was InitWithOneCell(vtkBridgeCell *c)
158 this->Cell = vtkBridgeCell::New();
159 }
160
161 vtkSetObjectBodyMacro(InternalCell, vtkCell, static_cast<vtkCell*>(nullptr));
162 vtkSetObjectBodyMacro(DataSet, vtkBridgeDataSet, ds);
163 this->Id = cellid;
164 this->cIsAtEnd = 1;
165 this->Cell->Init(this->DataSet, this->Id);
166}
167//------------------------------------------------------------------------------
168// Description:
169// Used internally by vtkBridgeCell.

Callers

nothing calls this directly

Calls 6

DeleteMethod · 0.65
assertFunction · 0.50
NewFunction · 0.50
GetNumberOfCellsMethod · 0.45
InitMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected