------------------------------------------------------------------------------
| 94 | |
| 95 | //------------------------------------------------------------------------------ |
| 96 | int vtkDataSetRegionSurfaceFilter::RequestData( |
| 97 | vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 98 | { |
| 99 | vtkUnstructuredGrid* input = vtkUnstructuredGrid::GetData(inputVector[0], 0); |
| 100 | |
| 101 | if (!input) |
| 102 | { |
| 103 | vtkErrorMacro("Input not specified!"); |
| 104 | return 0; |
| 105 | } |
| 106 | |
| 107 | if (this->RegionArrayName) |
| 108 | { |
| 109 | this->RegionArray = |
| 110 | vtkIntArray::SafeDownCast(input->GetCellData()->GetArray(this->RegionArrayName)); |
| 111 | } |
| 112 | |
| 113 | // assume all tets, and that the tets are small relative to the size of the |
| 114 | // regions (absolute max number of faces in output would be |
| 115 | // input->GetNumberOfCells() * 4) |
| 116 | this->OrigCellIds->Reset(); |
| 117 | this->OrigCellIds->Allocate(input->GetNumberOfCells()); |
| 118 | this->CellFaceIds->Reset(); |
| 119 | this->CellFaceIds->Allocate(input->GetNumberOfCells()); |
| 120 | |
| 121 | this->Superclass::RequestData(request, inputVector, outputVector); |
| 122 | |
| 123 | // if any tets, then we'll have CellFaceIds... assume all tets and that we |
| 124 | // want to addthe cell data |
| 125 | if (this->CellFaceIds->GetNumberOfTuples() > 0) |
| 126 | { |
| 127 | vtkPolyData* output = vtkPolyData::GetData(outputVector, 0); |
| 128 | if (output->GetNumberOfCells() != this->CellFaceIds->GetNumberOfTuples()) |
| 129 | { |
| 130 | vtkErrorMacro("Unable to add CellData because wrong # of values!"); |
| 131 | } |
| 132 | else |
| 133 | { |
| 134 | output->GetCellData()->AddArray(this->OrigCellIds); |
| 135 | output->GetCellData()->AddArray(this->CellFaceIds); |
| 136 | } |
| 137 | } |
| 138 | else |
| 139 | { // get rid of point mapping information |
| 140 | vtkPolyData* output = vtkPolyData::GetData(outputVector, 0); |
| 141 | output->GetPointData()->RemoveArray("vtkOriginalPointIds"); |
| 142 | } |
| 143 | |
| 144 | this->CheckAbort(); |
| 145 | |
| 146 | return 1; |
| 147 | } |
| 148 | |
| 149 | //------------------------------------------------------------------------------ |
| 150 | int vtkDataSetRegionSurfaceFilter::UnstructuredGridExecute( |
nothing calls this directly
no test coverage detected