src/extprogs.cpp

changeset 538
2f85d4d286e5
parent 526
b29b6fc45ba9
child 539
72ad83a67165
equal deleted inserted replaced
537:1add0ee96fb3 538:2f85d4d286e5
185 { writeObjects (selection(), fname); 185 { writeObjects (selection(), fname);
186 } 186 }
187 187
188 // ============================================================================= 188 // =============================================================================
189 // ----------------------------------------------------------------------------- 189 // -----------------------------------------------------------------------------
190 void writeColorGroup (const short colnum, str fname) 190 void writeColorGroup (const int colnum, str fname)
191 { QList<LDObject*> objects; 191 { QList<LDObject*> objects;
192 192
193 for (LDObject* obj : LDFile::current()->objects()) 193 for (LDObject* obj : LDFile::current()->objects())
194 { if (obj->isColored() == false || obj->color() != colnum) 194 { if (obj->isColored() == false || obj->color() != colnum)
195 continue; 195 continue;
252 return true; 252 return true;
253 } 253 }
254 254
255 // ============================================================================= 255 // =============================================================================
256 // ----------------------------------------------------------------------------- 256 // -----------------------------------------------------------------------------
257 static void insertOutput (str fname, bool replace, QList<short> colorsToReplace) 257 static void insertOutput (str fname, bool replace, QList<int> colorsToReplace)
258 { 258 {
259 #ifndef RELEASE 259 #ifndef RELEASE
260 QFile::copy (fname, "./debug_lastOutput"); 260 QFile::copy (fname, "./debug_lastOutput");
261 #endif // RELEASE 261 #endif // RELEASE
262 262
272 272
273 // If we replace the objects, delete the selection now. 273 // If we replace the objects, delete the selection now.
274 if (replace) 274 if (replace)
275 g_win->deleteSelection(); 275 g_win->deleteSelection();
276 276
277 for (const short colnum : colorsToReplace) 277 for (const int colnum : colorsToReplace)
278 g_win->deleteByColor (colnum); 278 g_win->deleteByColor (colnum);
279 279
280 // Insert the new objects 280 // Insert the new objects
281 LDFile::current()->clearSelection(); 281 LDFile::current()->clearSelection();
282 282
288 288
289 LDFile::current()->addObject (obj); 289 LDFile::current()->addObject (obj);
290 obj->select(); 290 obj->select();
291 } 291 }
292 292
293 g_win->fullRefresh(); 293 g_win->doFullRefresh();
294 } 294 }
295 295
296 // ============================================================================= 296 // =============================================================================
297 // Interface for Ytruder 297 // Interface for Ytruder
298 // ----------------------------------------------------------------------------- 298 // -----------------------------------------------------------------------------
408 makeColorSelector (ui.cmb_cutcol); 408 makeColorSelector (ui.cmb_cutcol);
409 ui.cb_repeat->setWhatsThis ("If this is set, " APPNAME " runs Intersector a second time with inverse files to cut the " 409 ui.cb_repeat->setWhatsThis ("If this is set, " APPNAME " runs Intersector a second time with inverse files to cut the "
410 " cutter group with the input group. Both groups are cut by the intersection."); 410 " cutter group with the input group. Both groups are cut by the intersection.");
411 ui.cb_edges->setWhatsThis ("Makes " APPNAME " try run Isecalc to create edgelines for the intersection."); 411 ui.cb_edges->setWhatsThis ("Makes " APPNAME " try run Isecalc to create edgelines for the intersection.");
412 412
413 short inCol, cutCol; 413 int inCol, cutCol;
414 const bool repeatInverse = ui.cb_repeat->isChecked(); 414 const bool repeatInverse = ui.cb_repeat->isChecked();
415 415
416 forever 416 forever
417 { if (!dlg->exec()) 417 { if (!dlg->exec())
418 return; 418 return;
495 Ui::CovererUI ui; 495 Ui::CovererUI ui;
496 ui.setupUi (dlg); 496 ui.setupUi (dlg);
497 makeColorSelector (ui.cmb_col1); 497 makeColorSelector (ui.cmb_col1);
498 makeColorSelector (ui.cmb_col2); 498 makeColorSelector (ui.cmb_col2);
499 499
500 short in1Col, in2Col; 500 int in1Col, in2Col;
501 501
502 forever 502 forever
503 { if (!dlg->exec()) 503 { if (!dlg->exec())
504 return; 504 return;
505 505
552 ui.setupUi (dlg); 552 ui.setupUi (dlg);
553 553
554 makeColorSelector (ui.cmb_col1); 554 makeColorSelector (ui.cmb_col1);
555 makeColorSelector (ui.cmb_col2); 555 makeColorSelector (ui.cmb_col2);
556 556
557 short in1Col, in2Col; 557 int in1Col, in2Col;
558 558
559 // Run the dialog and validate input 559 // Run the dialog and validate input
560 forever 560 forever
561 { if (!dlg->exec()) 561 { if (!dlg->exec())
562 return; 562 return;

mercurial