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

Method InitializeHandles

Interaction/Widgets/vtkSplineWidget.cxx:1395–1432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1393}
1394
1395void vtkSplineWidget::InitializeHandles(vtkPoints* points)
1396{
1397 if (!points)
1398 {
1399 return;
1400 }
1401
1402 int npts = points->GetNumberOfPoints();
1403 if (npts < 2)
1404 {
1405 return;
1406 }
1407
1408 double p0[3];
1409 double p1[3];
1410
1411 points->GetPoint(0, p0);
1412 points->GetPoint(npts - 1, p1);
1413
1414 if (vtkMath::Distance2BetweenPoints(p0, p1) == 0.0)
1415 {
1416 --npts;
1417 this->Closed = 1;
1418 this->ParametricSpline->ClosedOn();
1419 }
1420
1421 this->SetNumberOfHandles(npts);
1422 int i;
1423 for (i = 0; i < npts; ++i)
1424 {
1425 this->SetHandlePosition(i, points->GetPoint(i));
1426 }
1427
1428 if (this->Interactor && this->Enabled)
1429 {
1430 this->Interactor->Render();
1431 }
1432}
1433
1434int vtkSplineWidget::IsClosed()
1435{

Callers 11

InsertHandleOnLineMethod · 0.95
EraseHandleMethod · 0.95
EraseHandleMethod · 0.45
PushHandleMethod · 0.45
ExecuteMethod · 0.45
ExecuteMethod · 0.45
TestBrokenLineWidgetFunction · 0.45
TestPolylineWidgetFunction · 0.45

Calls 5

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

Tested by 7

ExecuteMethod · 0.36
ExecuteMethod · 0.36
TestBrokenLineWidgetFunction · 0.36
TestPolylineWidgetFunction · 0.36