| 122 | } |
| 123 | |
| 124 | void |
| 125 | SelectionTransformTool::end (int x, int y, BitMask modifiers, BitMask buttons) |
| 126 | { |
| 127 | if (!(buttons & LEFT)) |
| 128 | return; |
| 129 | |
| 130 | float scale = 1.0f / cloud_ptr_->getScalingFactor(); |
| 131 | int dx = (x - x_); |
| 132 | int dy = (y - y_); |
| 133 | update(x, y, modifiers, buttons); |
| 134 | if (modifiers_ & CTRL) |
| 135 | { |
| 136 | std::shared_ptr<TransformCommand> c(new TransformCommand(selection_ptr_, |
| 137 | cloud_ptr_, transform_matrix_, (float) dx * translate_factor_ * scale, |
| 138 | (float) -dy * translate_factor_ * scale, 0.0f)); |
| 139 | command_queue_ptr_->execute(c); |
| 140 | } |
| 141 | else if (modifiers_ & ALT) |
| 142 | { |
| 143 | std::shared_ptr<TransformCommand> c(new TransformCommand(selection_ptr_, |
| 144 | cloud_ptr_, transform_matrix_, 0.0f, 0.0f, |
| 145 | (float) dy * translate_factor_ * scale)); |
| 146 | command_queue_ptr_->execute(c); |
| 147 | } |
| 148 | else |
| 149 | { |
| 150 | std::shared_ptr<TransformCommand> c(new TransformCommand(selection_ptr_, |
| 151 | cloud_ptr_, transform_matrix_, 0.0f, 0.0f, 0.0f)); |
| 152 | command_queue_ptr_->execute(c); |
| 153 | } |
| 154 | setIdentity(transform_matrix_); |
| 155 | cloud_ptr_->setSelectionRotation(transform_matrix_); |
| 156 | cloud_ptr_->setSelectionTranslation(0.0f, 0.0f, 0.0f); |
| 157 | } |
| 158 | |
| 159 | /*void |
| 160 | SelectionTransformTool::getRotateMatrix (int dx, int dy, |
no test coverage detected