190 { |
190 { |
191 case LDObject::ELine: |
191 case LDObject::ELine: |
192 case LDObject::ECondLine: |
192 case LDObject::ECondLine: |
193 case LDObject::ETriangle: |
193 case LDObject::ETriangle: |
194 case LDObject::EQuad: |
194 case LDObject::EQuad: |
195 |
|
196 // Apply coordinates |
195 // Apply coordinates |
197 if (obj) |
196 if (obj != null) |
198 { |
197 { |
199 for (int i = 0; i < coordCount / 3; ++i) |
198 for (int i = 0; i < coordCount / 3; ++i) |
200 for (int j = 0; j < 3; ++j) |
199 { |
201 dsb_coords[ (i * 3) + j]->setValue (obj->vertex (i).getCoordinate (j)); |
200 obj->vertex (i).apply ([&](Axis ax, double value) |
202 } |
201 { |
203 |
202 dsb_coords[(i * 3) + ax]->setValue (value); |
|
203 }); |
|
204 } |
|
205 } |
204 break; |
206 break; |
205 |
207 |
206 case LDObject::EComment: |
208 case LDObject::EComment: |
207 layout->addWidget (le_comment, 0, 1); |
209 layout->addWidget (le_comment, 0, 1); |
208 break; |
210 break; |
228 QLabel* lb_matrix = new QLabel ("Matrix:"); |
230 QLabel* lb_matrix = new QLabel ("Matrix:"); |
229 le_matrix = new QLineEdit; |
231 le_matrix = new QLineEdit; |
230 // le_matrix->setValidator (new QDoubleValidator); |
232 // le_matrix->setValidator (new QDoubleValidator); |
231 Matrix defaultMatrix = g_identity; |
233 Matrix defaultMatrix = g_identity; |
232 |
234 |
233 if (mo) |
235 if (mo != null) |
234 { |
236 { |
235 for_axes (ax) |
237 mo->position().apply ([&](Axis ax, double value) |
236 dsb_coords[ax]->setValue (mo->position()[ax]); |
238 { |
|
239 dsb_coords[ax]->setValue (value); |
|
240 }); |
237 |
241 |
238 defaultMatrix = mo->transform(); |
242 defaultMatrix = mo->transform(); |
239 } |
243 } |
240 |
244 |
241 le_matrix->setText (defaultMatrix.toString()); |
245 le_matrix->setText (defaultMatrix.toString()); |