------------------------------------------------------------------------------ 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())
| 141 | // \pre ds_exists: ds!=0 |
| 142 | // \pre valid_id: (id>=0)&&(id<=ds->GetNumberOfCells()) |
| 143 | void 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. |