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

Method InitializeHandles

Interaction/Widgets/vtkBrokenLineWidget.cxx:1317–1352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1315}
1316
1317void vtkBrokenLineWidget::InitializeHandles(vtkPoints* points)
1318{
1319 if (!points)
1320 {
1321 return;
1322 }
1323
1324 int npts = points->GetNumberOfPoints();
1325 if (npts < 2)
1326 {
1327 return;
1328 }
1329
1330 double p0[3];
1331 double p1[3];
1332
1333 points->GetPoint(0, p0);
1334 points->GetPoint(npts - 1, p1);
1335
1336 if (vtkMath::Distance2BetweenPoints(p0, p1) == 0.)
1337 {
1338 --npts;
1339 }
1340
1341 this->SetNumberOfHandles(npts);
1342 int i;
1343 for (i = 0; i < npts; ++i)
1344 {
1345 this->SetHandlePosition(i, points->GetPoint(i));
1346 }
1347
1348 if (this->Interactor && this->Enabled)
1349 {
1350 this->Interactor->Render();
1351 }
1352}
1353VTK_ABI_NAMESPACE_END

Callers 2

InsertHandleOnLineMethod · 0.95
EraseHandleMethod · 0.95

Calls 5

SetNumberOfHandlesMethod · 0.95
SetHandlePositionMethod · 0.95
RenderMethod · 0.65
GetNumberOfPointsMethod · 0.45
GetPointMethod · 0.45

Tested by

no test coverage detected