3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 06/11/2010 Created this file. :-)
23 DlgArc::DlgArc(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
24 QDialog(parent, flags)
33 void DlgArc::setArc(Arc & a)
36 //pen = arc->getPen();
37 ui.wPen->setPen(arc->getPen(false), true, false, "Pen");
38 Drawing * graphic = arc->getGraphic();
41 ui.cbLayer->init(*(graphic->getLayerList()), false, false);
43 Layer * lay = arc->getLayer(false);
46 ui.cbLayer->setLayer(*lay);
49 s.setNum(arc->getCenter().x);
50 ui.leCenterX->setText(s);
51 s.setNum(arc->getCenter().y);
52 ui.leCenterY->setText(s);
53 s.setNum(arc->getRadius());
54 ui.leRadius->setText(s);
55 s.setNum(Math::rad2deg(arc->getAngle1()));
56 ui.leAngle1->setText(s);
57 s.setNum(Math::rad2deg(arc->getAngle2()));
58 ui.leAngle2->setText(s);
59 ui.cbReversed->setChecked(arc->isReversed());
62 void DlgArc::updateArc()
64 arc->setCenter(Vector(Math::eval(ui.leCenterX->text()),
65 Math::eval(ui.leCenterY->text())));
66 arc->setRadius(Math::eval(ui.leRadius->text()));
67 arc->setAngle1(Math::deg2rad(Math::eval(ui.leAngle1->text())));
68 arc->setAngle2(Math::deg2rad(Math::eval(ui.leAngle2->text())));
69 arc->setReversed(ui.cbReversed->isChecked());
70 arc->setPen(ui.wPen->getPen());
71 arc->setLayer(ui.cbLayer->currentText());
72 arc->calculateEndpoints();
73 arc->calculateBorders();