src/primitives.cpp

changeset 969
b1742ee91d5b
parent 968
4b93b7963456
child 970
c8aae45afd85
equal deleted inserted replaced
968:4b93b7963456 969:b1742ee91d5b
687 // If the current value is 16 and we switch to hi-res, default the 687 // If the current value is 16 and we switch to hi-res, default the
688 // spinbox to 48. 688 // spinbox to 48.
689 if (on and ui->sb_segs->value() == LowResolution) 689 if (on and ui->sb_segs->value() == LowResolution)
690 ui->sb_segs->setValue (HighResolution); 690 ui->sb_segs->setValue (HighResolution);
691 } 691 }
692
693 // =============================================================================
694 //
695 void MainWindow::slot_actionMakePrimitive()
696 {
697 PrimitivePrompt* dlg = new PrimitivePrompt (g_win);
698
699 if (not dlg->exec())
700 return;
701
702 int segs = dlg->ui->sb_segs->value();
703 int divs = dlg->ui->cb_hires->isChecked() ? HighResolution : LowResolution;
704 int num = dlg->ui->sb_ringnum->value();
705 PrimitiveType type =
706 dlg->ui->rb_circle->isChecked() ? Circle :
707 dlg->ui->rb_cylinder->isChecked() ? Cylinder :
708 dlg->ui->rb_disc->isChecked() ? Disc :
709 dlg->ui->rb_ndisc->isChecked() ? DiscNeg :
710 dlg->ui->rb_ring->isChecked() ? Ring : Cone;
711
712 LDDocument* f = GeneratePrimitive (type, segs, divs, num);
713 f->setImplicit (false);
714 g_win->save (f, false);
715 }

mercurial