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

Method InitializeHandles

Interaction/Widgets/vtkCameraPathRepresentation.cxx:443–475  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

441
442//------------------------------------------------------------------------------
443void vtkCameraPathRepresentation::InitializeHandles(vtkPoints* points)
444{
445 if (!points)
446 {
447 vtkErrorMacro(<< "ERROR: Invalid or nullptr points\n");
448 return;
449 }
450
451 int npts = points->GetNumberOfPoints();
452 if (npts < 2)
453 {
454 return;
455 }
456
457 double p0[3];
458 double p1[3];
459
460 points->GetPoint(0, p0);
461 points->GetPoint(npts - 1, p1);
462
463 if (vtkMath::Distance2BetweenPoints(p0, p1) == 0.0)
464 {
465 --npts;
466 this->Closed = 1;
467 this->ParametricSpline->ClosedOn();
468 }
469
470 this->SetNumberOfHandles(npts);
471 for (int i = 0; i < npts; ++i)
472 {
473 this->SetHandlePosition(i, points->GetPoint(i));
474 }
475}
476
477//------------------------------------------------------------------------------
478void vtkCameraPathRepresentation::SizeHandles()

Callers

nothing calls this directly

Calls 4

SetNumberOfHandlesMethod · 0.95
GetNumberOfPointsMethod · 0.45
GetPointMethod · 0.45
SetHandlePositionMethod · 0.45

Tested by

no test coverage detected