gui.cpp

changeset 56
64899ff3bcb3
parent 55
b08f10e668e5
child 57
6e89589f1fe8
equal deleted inserted replaced
55:b08f10e668e5 56:64899ff3bcb3
407 407
408 // ============================================================================= 408 // =============================================================================
409 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 409 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
410 // ============================================================================= 410 // =============================================================================
411 void ForgeWindow::slot_splitQuads () { 411 void ForgeWindow::slot_splitQuads () {
412 if (qObjList->selectedItems().size() == 0) 412 vector<LDObject*> objs = getSelectedObjects ();
413 return; 413
414 414 // Delete the objects that were being selected
415 QList<QTreeWidgetItem*> const qaItems = qObjList->selectedItems(); 415 for (ulong i = 0; i < (ulong)objs.size(); ++i) {
416 416 LDObject* obj = objs[i];
417 for (ulong i = 0; i < g_CurrentFile->objects.size(); ++i) {
418 LDObject* obj = g_CurrentFile->objects[i];
419 417
420 // Don't even consider non-quads 418 // Don't even consider non-quads
421 if (obj->getType() != OBJ_Quad) 419 if (obj->getType() != OBJ_Quad)
422 continue; 420 continue;
423 421
424 bool bIsSelected = false;
425
426 for (long j = 0; j < qaItems.size(); ++j) {
427 if (qaItems[j] == obj->qObjListEntry) {
428 bIsSelected = true;
429 break;
430 }
431 }
432
433 if (!bIsSelected)
434 continue; // Was not selected
435
436 static_cast<LDQuad*> (obj)->splitToTriangles (); 422 static_cast<LDQuad*> (obj)->splitToTriangles ();
437 i++;// Skip past the second triangle
438 } 423 }
439 424
440 refresh (); 425 refresh ();
441 } 426 }
442 427

mercurial