98 ConfigOption (int RotationPointType = 0) |
98 ConfigOption (int RotationPointType = 0) |
99 ConfigOption (Vertex CustomRotationPoint = Origin) |
99 ConfigOption (Vertex CustomRotationPoint = Origin) |
100 |
100 |
101 float gridCoordinateSnap() |
101 float gridCoordinateSnap() |
102 { |
102 { |
103 ConfigurationValueBag* config = g_win->configBag(); |
103 switch (Config->grid()) |
104 |
104 { |
105 switch (config->grid()) |
105 case Grid::Coarse: return Config->gridCoarseCoordinateSnap(); |
106 { |
106 case Grid::Medium: return Config->gridMediumCoordinateSnap(); |
107 case Grid::Coarse: return config->gridCoarseCoordinateSnap(); |
107 case Grid::Fine: return Config->gridFineCoordinateSnap(); |
108 case Grid::Medium: return config->gridMediumCoordinateSnap(); |
|
109 case Grid::Fine: return config->gridFineCoordinateSnap(); |
|
110 } |
108 } |
111 |
109 |
112 return 1.0f; |
110 return 1.0f; |
113 } |
111 } |
114 |
112 |
115 float gridAngleSnap() |
113 float gridAngleSnap() |
116 { |
114 { |
117 ConfigurationValueBag* config = g_win->configBag(); |
115 switch (Config->grid()) |
118 |
116 { |
119 switch (config->grid()) |
117 case Grid::Coarse: return Config->gridCoarseAngleSnap(); |
120 { |
118 case Grid::Medium: return Config->gridMediumAngleSnap(); |
121 case Grid::Coarse: return config->gridCoarseAngleSnap(); |
119 case Grid::Fine: return Config->gridFineAngleSnap(); |
122 case Grid::Medium: return config->gridMediumAngleSnap(); |
|
123 case Grid::Fine: return config->gridFineAngleSnap(); |
|
124 } |
120 } |
125 |
121 |
126 return 45.0f; |
122 return 45.0f; |
127 } |
123 } |
128 |
124 |
129 float gridBezierCurveSegments() |
125 float gridBezierCurveSegments() |
130 { |
126 { |
131 ConfigurationValueBag* config = g_win->configBag(); |
127 switch (Config->grid()) |
132 |
|
133 switch (config->grid()) |
|
134 { |
128 { |
135 default: |
129 default: |
136 case Grid::Coarse: return config->gridCoarseBezierCurveSegments(); |
130 case Grid::Coarse: return Config->gridCoarseBezierCurveSegments(); |
137 case Grid::Medium: return config->gridMediumBezierCurveSegments(); |
131 case Grid::Medium: return Config->gridMediumBezierCurveSegments(); |
138 case Grid::Fine: return config->gridFineBezierCurveSegments(); |
132 case Grid::Fine: return Config->gridFineBezierCurveSegments(); |
139 } |
133 } |
140 } |
134 } |
141 |
135 |
142 // ============================================================================= |
136 // ============================================================================= |
143 // |
137 // |
245 |
239 |
246 case RotationPoint::NumValues: |
240 case RotationPoint::NumValues: |
247 break; |
241 break; |
248 } |
242 } |
249 |
243 |
250 Vertex custompoint = g_win->configBag()->customRotationPoint(); |
244 Vertex custompoint = Config->customRotationPoint(); |
251 ui.customX->setValue (custompoint.x()); |
245 ui.customX->setValue (custompoint.x()); |
252 ui.customY->setValue (custompoint.y()); |
246 ui.customY->setValue (custompoint.y()); |
253 ui.customZ->setValue (custompoint.z()); |
247 ui.customZ->setValue (custompoint.z()); |
254 |
248 |
255 if (not dlg->exec()) |
249 if (not dlg->exec()) |
256 return; |
250 return; |
257 |
251 |
258 g_win->configBag()->setRotationPointType (int ( |
252 Config->setRotationPointType (int ( |
259 (ui.objectPoint->isChecked()) ? RotationPoint::ObjectOrigin : |
253 (ui.objectPoint->isChecked()) ? RotationPoint::ObjectOrigin : |
260 (ui.worldPoint->isChecked()) ? RotationPoint::WorldOrigin : |
254 (ui.worldPoint->isChecked()) ? RotationPoint::WorldOrigin : |
261 RotationPoint::CustomPoint)); |
255 RotationPoint::CustomPoint)); |
262 |
256 |
263 custompoint.setX (ui.customX->value()); |
257 custompoint.setX (ui.customX->value()); |
264 custompoint.setY (ui.customY->value()); |
258 custompoint.setY (ui.customY->value()); |
265 custompoint.setZ (ui.customZ->value()); |
259 custompoint.setZ (ui.customZ->value()); |
266 g_win->configBag()->setCustomRotationPoint (custompoint); |
260 Config->setCustomRotationPoint (custompoint); |
267 } |
261 } |
268 |
262 |
269 // ============================================================================= |
263 // ============================================================================= |
270 // |
264 // |
271 QString Join (QList<StringFormatArg> vals, QString delim) |
265 QString Join (QList<StringFormatArg> vals, QString delim) |