15 * You should have received a copy of the GNU General Public License |
15 * You should have received a copy of the GNU General Public License |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 */ |
17 */ |
18 |
18 |
19 #include "../lddocument.h" |
19 #include "../lddocument.h" |
20 #include "../mathfunctions.h" |
|
21 #include "../mainwindow.h" |
20 #include "../mainwindow.h" |
22 #include "movetoolset.h" |
21 #include "movetoolset.h" |
23 #include "ui_rotationpointdialog.h" |
22 #include "ui_rotationpointdialog.h" |
24 #include "../grid.h" |
23 #include "../grid.h" |
25 #include "../canvas.h" |
24 #include "../canvas.h" |
|
25 #include "../algorithms/geometry.h" |
26 |
26 |
27 MoveToolset::MoveToolset (MainWindow* parent) : |
27 MoveToolset::MoveToolset (MainWindow* parent) : |
28 Toolset (parent) {} |
28 Toolset (parent) {} |
29 |
29 |
30 void MoveToolset::moveSelection (bool up) |
30 void MoveToolset::moveSelection (bool up) |
119 return (pi * grid()->angleSnap()) / 180; |
119 return (pi * grid()->angleSnap()) / 180; |
120 } |
120 } |
121 |
121 |
122 void MoveToolset::rotateXPos() |
122 void MoveToolset::rotateXPos() |
123 { |
123 { |
124 math()->rotateObjects (1, 0, 0, getRotateActionAngle(), selectedObjects().toList().toVector()); |
124 rotateObjects(1, 0, 0, getRotateActionAngle(), selectedObjects().toList().toVector()); |
125 } |
125 } |
126 |
126 |
127 void MoveToolset::rotateYPos() |
127 void MoveToolset::rotateYPos() |
128 { |
128 { |
129 math()->rotateObjects (0, 1, 0, getRotateActionAngle(), selectedObjects().toList().toVector()); |
129 rotateObjects(0, 1, 0, getRotateActionAngle(), selectedObjects().toList().toVector()); |
130 } |
130 } |
131 |
131 |
132 void MoveToolset::rotateZPos() |
132 void MoveToolset::rotateZPos() |
133 { |
133 { |
134 math()->rotateObjects (0, 0, 1, getRotateActionAngle(), selectedObjects().toList().toVector()); |
134 rotateObjects(0, 0, 1, getRotateActionAngle(), selectedObjects().toList().toVector()); |
135 } |
135 } |
136 |
136 |
137 void MoveToolset::rotateXNeg() |
137 void MoveToolset::rotateXNeg() |
138 { |
138 { |
139 math()->rotateObjects (-1, 0, 0, getRotateActionAngle(), selectedObjects().toList().toVector()); |
139 rotateObjects(-1, 0, 0, getRotateActionAngle(), selectedObjects().toList().toVector()); |
140 } |
140 } |
141 |
141 |
142 void MoveToolset::rotateYNeg() |
142 void MoveToolset::rotateYNeg() |
143 { |
143 { |
144 math()->rotateObjects (0, -1, 0, getRotateActionAngle(), selectedObjects().toList().toVector()); |
144 rotateObjects(0, -1, 0, getRotateActionAngle(), selectedObjects().toList().toVector()); |
145 } |
145 } |
146 |
146 |
147 void MoveToolset::rotateZNeg() |
147 void MoveToolset::rotateZNeg() |
148 { |
148 { |
149 math()->rotateObjects (0, 0, -1, getRotateActionAngle(), selectedObjects().toList().toVector()); |
149 rotateObjects(0, 0, -1, getRotateActionAngle(), selectedObjects().toList().toVector()); |
150 } |
150 } |
151 |
151 |
152 void MoveToolset::configureRotationPoint() |
152 void MoveToolset::configureRotationPoint() |
153 { |
153 { |
154 QDialog* dialog = new QDialog; |
154 QDialog* dialog = new QDialog; |
155 Ui_RotPointUI ui; |
155 Ui_RotPointUI ui; |
156 ui.setupUi(dialog); |
156 ui.setupUi(dialog); |
157 |
157 |
158 switch (RotationPoint(config::rotationPointType())) |
158 switch (static_cast<RotationPoint>(config::rotationPointType())) |
159 { |
159 { |
160 case ObjectOrigin: |
160 case ObjectOrigin: |
161 ui.objectPoint->setChecked (true); |
161 ui.objectPoint->setChecked (true); |
162 break; |
162 break; |
163 |
163 |