------------------------------------------------------------------------------
| 114 | |
| 115 | //------------------------------------------------------------------------------ |
| 116 | int vtkGenericGeometryFilter::RequestData(vtkInformation* vtkNotUsed(request), |
| 117 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 118 | { |
| 119 | // get the info objects |
| 120 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 121 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 122 | |
| 123 | // get the input and output |
| 124 | vtkGenericDataSet* input = |
| 125 | vtkGenericDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 126 | vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 127 | |
| 128 | vtkIdType cellId; |
| 129 | int i, j; |
| 130 | vtkIdType numPts = input->GetNumberOfPoints(); |
| 131 | vtkIdType numCells = input->GetNumberOfCells(); |
| 132 | char* cellVis; |
| 133 | vtkGenericAdaptorCell* cell; |
| 134 | double x[3] = { 0, 0, 0 }; |
| 135 | vtkIdType ptIds[4]; |
| 136 | |
| 137 | vtkIdType ptId; |
| 138 | int allVisible; |
| 139 | vtkPointData* outputPD = output->GetPointData(); |
| 140 | vtkCellData* outputCD = output->GetCellData(); |
| 141 | |
| 142 | if (numCells == 0) |
| 143 | { |
| 144 | vtkErrorMacro(<< "Number of cells is zero, no data to process."); |
| 145 | return 1; |
| 146 | } |
| 147 | |
| 148 | vtkDebugMacro(<< "Executing geometry filter"); |
| 149 | |
| 150 | if ((!this->CellClipping) && (!this->PointClipping) && (!this->ExtentClipping)) |
| 151 | { |
| 152 | allVisible = 1; |
| 153 | cellVis = nullptr; |
| 154 | } |
| 155 | else |
| 156 | { |
| 157 | allVisible = 0; |
| 158 | cellVis = new char[numCells]; |
| 159 | } |
| 160 | |
| 161 | vtkGenericCellIterator* cellIt = input->NewCellIterator(); |
| 162 | // Mark cells as being visible or not |
| 163 | // |
| 164 | if (!allVisible) |
| 165 | { |
| 166 | for (cellIt->Begin(); !cellIt->IsAtEnd(); cellIt->Next()) |
| 167 | { |
| 168 | cell = cellIt->GetCell(); |
| 169 | cellId = cell->GetId(); |
| 170 | if (this->CellClipping && (cellId < this->CellMinimum || cellId > this->CellMaximum)) |
| 171 | { |
| 172 | cellVis[cellId] = 0; |
| 173 | } |
nothing calls this directly
no test coverage detected