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

Method PlaceWidget

Interaction/Widgets/vtkLineWidget.cxx:947–982  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

945
946//------------------------------------------------------------------------------
947void vtkLineWidget::PlaceWidget(double bds[6])
948{
949 int i;
950 double bounds[6], center[3];
951
952 this->AdjustBounds(bds, bounds, center);
953
954 if (this->Align == vtkLineWidget::YAxis)
955 {
956 this->LineSource->SetPoint1(center[0], bounds[2], center[2]);
957 this->LineSource->SetPoint2(center[0], bounds[3], center[2]);
958 }
959 else if (this->Align == vtkLineWidget::ZAxis)
960 {
961 this->LineSource->SetPoint1(center[0], center[1], bounds[4]);
962 this->LineSource->SetPoint2(center[0], center[1], bounds[5]);
963 }
964 else if (this->Align == vtkLineWidget::XAxis) // default or x-aligned
965 {
966 this->LineSource->SetPoint1(bounds[0], center[1], center[2]);
967 this->LineSource->SetPoint2(bounds[1], center[1], center[2]);
968 }
969 this->LineSource->Update();
970
971 for (i = 0; i < 6; i++)
972 {
973 this->InitialBounds[i] = bounds[i];
974 }
975 this->InitialLength = sqrt((bounds[1] - bounds[0]) * (bounds[1] - bounds[0]) +
976 (bounds[3] - bounds[2]) * (bounds[3] - bounds[2]) +
977 (bounds[5] - bounds[4]) * (bounds[5] - bounds[4]));
978
979 // Position the handles at the end of the lines
980 this->BuildRepresentation();
981 this->SizeHandles();
982}
983
984//------------------------------------------------------------------------------
985void vtkLineWidget::SetPoint1(double x, double y, double z)

Callers 2

vtkLineWidgetMethod · 0.95
EnablePointWidgetMethod · 0.45

Calls 7

BuildRepresentationMethod · 0.95
SizeHandlesMethod · 0.95
sqrtFunction · 0.50
AdjustBoundsMethod · 0.45
SetPoint1Method · 0.45
SetPoint2Method · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected