| 1032 | } |
| 1033 | |
| 1034 | void vtkBoxWidget::Scale(double* vtkNotUsed(p1), double* vtkNotUsed(p2), int vtkNotUsed(X), int Y) |
| 1035 | { |
| 1036 | double* pts = static_cast<vtkDoubleArray*>(this->Points->GetData())->GetPointer(0); |
| 1037 | double* center = static_cast<vtkDoubleArray*>(this->Points->GetData())->GetPointer(3 * 14); |
| 1038 | double sf; |
| 1039 | |
| 1040 | if (Y > this->Interactor->GetLastEventPosition()[1]) |
| 1041 | { |
| 1042 | sf = 1.03; |
| 1043 | } |
| 1044 | else |
| 1045 | { |
| 1046 | sf = 0.97; |
| 1047 | } |
| 1048 | |
| 1049 | // Move the corners |
| 1050 | for (int i = 0; i < 8; i++, pts += 3) |
| 1051 | { |
| 1052 | pts[0] = sf * (pts[0] - center[0]) + center[0]; |
| 1053 | pts[1] = sf * (pts[1] - center[1]) + center[1]; |
| 1054 | pts[2] = sf * (pts[2] - center[2]) + center[2]; |
| 1055 | } |
| 1056 | this->PositionHandles(); |
| 1057 | } |
| 1058 | |
| 1059 | void vtkBoxWidget::ComputeNormals() |
| 1060 | { |