135 delete inlineobj; |
135 delete inlineobj; |
136 |
136 |
137 LDObject* newobj = parseLine (line); |
137 LDObject* newobj = parseLine (line); |
138 LDFile::current()->insertObj (idx++, newobj); |
138 LDFile::current()->insertObj (idx++, newobj); |
139 g_win->sel() << newobj; |
139 g_win->sel() << newobj; |
|
140 g_win->R()->compileObject( inlineobj ); |
140 } |
141 } |
141 |
142 |
142 // Delete the subfile now as it's been inlined. |
143 // Delete the subfile now as it's been inlined. |
143 LDFile::current()->forgetObject (obj); |
144 LDFile::current()->forgetObject (obj); |
144 delete obj; |
145 delete obj; |
145 } |
146 } |
146 |
147 |
147 g_win->fullRefresh(); |
148 g_win->refresh(); |
148 } |
149 } |
149 |
150 |
150 DEFINE_ACTION (Inline, CTRL (I)) { |
151 DEFINE_ACTION (Inline, CTRL (I)) { |
151 doInline (false); |
152 doInline (false); |
152 } |
153 } |
177 // Replace the quad with the first triangle and add the second triangle |
178 // Replace the quad with the first triangle and add the second triangle |
178 // after the first one. |
179 // after the first one. |
179 LDFile::current()->setObject (index, triangles[0]); |
180 LDFile::current()->setObject (index, triangles[0]); |
180 LDFile::current()->insertObj (index + 1, triangles[1]); |
181 LDFile::current()->insertObj (index + 1, triangles[1]); |
181 |
182 |
|
183 for( LDTriangleObject* t : triangles ) |
|
184 g_win->R()->compileObject( t ); |
|
185 |
182 // Delete this quad now, it has been split. |
186 // Delete this quad now, it has been split. |
183 delete obj; |
187 delete obj; |
184 |
188 |
185 num++; |
189 num++; |
186 } |
190 } |
187 |
191 |
188 log ("%1 quadrilaterals split", num); |
192 log ("%1 quadrilaterals split", num); |
189 g_win->fullRefresh(); |
193 g_win->refresh(); |
190 } |
194 } |
191 |
195 |
192 // ============================================================================= |
196 // ============================================================================= |
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
194 // ============================================================================= |
198 // ============================================================================= |
494 sprintf (valstr, "%.3f", v[ax]); |
498 sprintf (valstr, "%.3f", v[ax]); |
495 v[ax] = atof (valstr); |
499 v[ax] = atof (valstr); |
496 } |
500 } |
497 |
501 |
498 obj->setVertex (i, v); |
502 obj->setVertex (i, v); |
|
503 g_win->R()->compileObject( obj ); |
499 num += 3; |
504 num += 3; |
500 } |
505 } |
501 |
506 |
502 log (ForgeWindow::tr ("Rounded %1 coordinates"), num); |
507 log (ForgeWindow::tr ("Rounded %1 coordinates"), num); |
503 g_win->fullRefresh(); |
508 g_win->refresh(); |
504 } |
509 } |
505 |
510 |
506 // ============================================================================= |
511 // ============================================================================= |
507 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
512 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
508 // ============================================================================= |
513 // ============================================================================= |
517 |
522 |
518 if (obj->getType() == LDObject::Line || obj->getType() == LDObject::CondLine) |
523 if (obj->getType() == LDObject::Line || obj->getType() == LDObject::CondLine) |
519 col = edgecolor; |
524 col = edgecolor; |
520 |
525 |
521 obj->setColor (col); |
526 obj->setColor (col); |
|
527 g_win->R()->compileObject( obj ); |
522 num++; |
528 num++; |
523 } |
529 } |
524 |
530 |
525 log (ForgeWindow::tr ("%1 objects uncolored"), num); |
531 log (ForgeWindow::tr ("%1 objects uncolored"), num); |
526 g_win->fullRefresh(); |
532 g_win->refresh(); |
527 } |
533 } |
528 |
534 |
529 // ============================================================================= |
535 // ============================================================================= |
530 DEFINE_ACTION (ReplaceCoords, CTRL (R)) { |
536 DEFINE_ACTION (ReplaceCoords, CTRL (R)) { |
531 QDialog* dlg = new QDialog (g_win); |
537 QDialog* dlg = new QDialog (g_win); |
562 num++; |
568 num++; |
563 } |
569 } |
564 } |
570 } |
565 |
571 |
566 obj->setVertex (i, v); |
572 obj->setVertex (i, v); |
|
573 g_win->R()->compileObject( obj ); |
567 } |
574 } |
568 |
575 |
569 log (ForgeWindow::tr ("Altered %1 values"), num); |
576 log (ForgeWindow::tr ("Altered %1 values"), num); |
570 g_win->fullRefresh(); |
577 g_win->refresh(); |
571 } |
578 } |
572 |
579 |
573 // ================================================================================================ |
580 // ================================================================================================ |
574 DEFINE_ACTION (Flip, CTRL_SHIFT (F)) { |
581 DEFINE_ACTION (Flip, CTRL_SHIFT (F)) { |
575 QDialog* dlg = new QDialog; |
582 QDialog* dlg = new QDialog; |