------------------------------------------------------------------------------
| 196 | |
| 197 | //------------------------------------------------------------------------------ |
| 198 | void vtkProjectSphereFilter::TransformCellInformation( |
| 199 | vtkPointSet* input, vtkPointSet* output, vtkIdList* polePointIds) |
| 200 | { |
| 201 | // a map from the old point to the newly created point for split cells |
| 202 | std::map<vtkIdType, vtkIdType> boundaryMap; |
| 203 | |
| 204 | double TOLERANCE = .0001; |
| 205 | vtkNew<vtkPoints> tmpPoints; |
| 206 | tmpPoints->DeepCopy(output->GetPoints()); |
| 207 | output->GetPoints()->Reset(); |
| 208 | vtkNew<vtkMergePoints> locator; |
| 209 | locator->InitPointInsertion( |
| 210 | output->GetPoints(), output->GetBounds(), tmpPoints->GetNumberOfPoints()); |
| 211 | double coord[3]; |
| 212 | for (vtkIdType i = 0; i < tmpPoints->GetNumberOfPoints(); i++) |
| 213 | { |
| 214 | // creating a duplicate of the input point and inserting them in the locator |
| 215 | // is a bit annoying but required for building up the locator properly |
| 216 | // otherwise it won't know these points exist |
| 217 | tmpPoints->GetPoint(i, coord); |
| 218 | locator->InsertNextPoint(coord); |
| 219 | } |
| 220 | |
| 221 | vtkIdType numberOfCells = input->GetNumberOfCells(); |
| 222 | vtkCellArray* connectivity = nullptr; |
| 223 | vtkUnstructuredGrid* ugrid = vtkUnstructuredGrid::SafeDownCast(output); |
| 224 | vtkPolyData* poly = vtkPolyData::SafeDownCast(output); |
| 225 | if (ugrid) |
| 226 | { |
| 227 | ugrid->Allocate(numberOfCells); |
| 228 | connectivity = ugrid->GetCells(); |
| 229 | } |
| 230 | else if (poly) |
| 231 | { |
| 232 | poly->AllocateEstimate(numberOfCells, 3); |
| 233 | connectivity = poly->GetPolys(); |
| 234 | } |
| 235 | output->GetCellData()->CopyAllOn(); |
| 236 | output->GetCellData()->CopyAllocate(input->GetCellData(), input->GetNumberOfCells()); |
| 237 | vtkPointData* pointData = output->GetPointData(); |
| 238 | pointData->CopyAllOn(); |
| 239 | pointData->CopyAllocate(pointData, output->GetNumberOfPoints()); |
| 240 | |
| 241 | vtkNew<vtkIdList> cellPoints; |
| 242 | vtkNew<vtkIdList> skippedCells; |
| 243 | vtkIdType mostPointsInCell = 0; |
| 244 | for (vtkIdType cellId = 0; cellId < numberOfCells; cellId++) |
| 245 | { |
| 246 | if (this->CheckAbort()) |
| 247 | { |
| 248 | break; |
| 249 | } |
| 250 | bool onLeftBoundary = false; |
| 251 | bool onRightBoundary = false; |
| 252 | bool leftSideInterior = false; // between SplitLongitude and SplitLongitude+90 |
| 253 | bool rightSideInterior = false; // between SplitLongitude+270 and SplitLongitude+360 |
| 254 | bool middleInterior = false; // between SplitLongitude+90 and SplitLongitude+270 |
| 255 |
no test coverage detected