| 65 | } |
| 66 | |
| 67 | void |
| 68 | CloudTransformTool::update (int x, int y, BitMask modifiers, BitMask buttons) |
| 69 | { |
| 70 | if (!cloud_ptr_) |
| 71 | return; |
| 72 | if (!(buttons & LEFT)) |
| 73 | return; |
| 74 | |
| 75 | float transform[MATRIX_SIZE]; |
| 76 | |
| 77 | int dx = (x - x_); |
| 78 | int dy = (y - y_); |
| 79 | if (dx == 0 && dy == 0) |
| 80 | return; |
| 81 | trackball_.update(x, y); |
| 82 | if (modifiers & CTRL) |
| 83 | getTranslateMatrix(dx, dy, transform); |
| 84 | else if (modifiers & ALT) |
| 85 | getZTranslateMatrix(dy, transform); |
| 86 | else if (modifiers & SHFT) |
| 87 | getScaleMatrix(dy, transform); |
| 88 | else |
| 89 | trackball_.getRotationMatrix(transform); |
| 90 | |
| 91 | cloud_ptr_ -> multMatrix(transform); |
| 92 | |
| 93 | x_ = x; |
| 94 | y_ = y; |
| 95 | } |
| 96 | |
| 97 | void |
| 98 | CloudTransformTool::getTranslateMatrix (int dx, int dy, float* matrix) |
nothing calls this directly
no test coverage detected