------------------------------------------------------------------------------ The Initialize() method is assumed to have been called.
| 558 | //------------------------------------------------------------------------------ |
| 559 | // The Initialize() method is assumed to have been called. |
| 560 | void vtkSphericalPointIterator::BuildRepresentation(vtkPolyData* pd) |
| 561 | { |
| 562 | // Initialize the representation |
| 563 | pd->Reset(); |
| 564 | |
| 565 | // Get the basic iterator information |
| 566 | int numAxes = this->GetNumberOfAxes(); |
| 567 | double* center = this->Iterator->Center; |
| 568 | |
| 569 | // Build the polydata |
| 570 | vtkNew<vtkPoints> pts; |
| 571 | pts->SetDataTypeToDouble(); |
| 572 | pts->SetNumberOfPoints(numAxes + 1); |
| 573 | vtkNew<vtkCellArray> lines; |
| 574 | vtkNew<vtkUnsignedIntArray> lineNumbers; |
| 575 | lineNumbers->SetNumberOfTuples(numAxes); |
| 576 | pd->SetPoints(pts); |
| 577 | pd->SetLines(lines); |
| 578 | pd->GetCellData()->AddArray(lineNumbers); |
| 579 | |
| 580 | // Loop over axes. The center point goes first. |
| 581 | vtkIdType linePts[2]; |
| 582 | linePts[0] = 0; |
| 583 | pts->SetPoint(0, center[0], center[1], center[2]); |
| 584 | for (auto i = 1; i <= numAxes; ++i) |
| 585 | { |
| 586 | int axisNum = i - 1; |
| 587 | double x[3]; |
| 588 | x[0] = center[0] + this->Iterator->Axes[axisNum].A[0]; |
| 589 | x[1] = center[1] + this->Iterator->Axes[axisNum].A[1]; |
| 590 | x[2] = center[2] + this->Iterator->Axes[axisNum].A[2]; |
| 591 | pts->SetPoint(i, x); |
| 592 | linePts[1] = i; |
| 593 | lines->InsertNextCell(2, linePts); |
| 594 | lineNumbers->SetTypedComponent(axisNum, 0, axisNum); |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | //------------------------------------------------------------------------------ |
| 599 | void vtkSphericalPointIterator::PrintSelf(ostream& os, vtkIndent indent) |
nothing calls this directly
no test coverage detected