| 1315 | } |
| 1316 | |
| 1317 | void 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 | } |
| 1353 | VTK_ABI_NAMESPACE_END |
no test coverage detected