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; |