MCPcopy Create free account
hub / github.com/Kitware/VTK / BuildRepresentation

Method BuildRepresentation

Common/DataModel/vtkSphericalPointIterator.cxx:560–596  ·  view source on GitHub ↗

------------------------------------------------------------------------------ The Initialize() method is assumed to have been called.

Source from the content-addressed store, hash-verified

558//------------------------------------------------------------------------------
559// The Initialize() method is assumed to have been called.
560void 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//------------------------------------------------------------------------------
599void vtkSphericalPointIterator::PrintSelf(ostream& os, vtkIndent indent)

Callers

nothing calls this directly

Calls 11

GetNumberOfAxesMethod · 0.95
SetLinesMethod · 0.80
ResetMethod · 0.45
SetNumberOfPointsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
SetPointsMethod · 0.45
AddArrayMethod · 0.45
GetCellDataMethod · 0.45
SetPointMethod · 0.45
InsertNextCellMethod · 0.45
SetTypedComponentMethod · 0.45

Tested by

no test coverage detected