------------------------------------------------------------------------------
| 945 | |
| 946 | //------------------------------------------------------------------------------ |
| 947 | void 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 | //------------------------------------------------------------------------------ |
| 985 | void vtkLineWidget::SetPoint1(double x, double y, double z) |
no test coverage detected