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 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 06/11/2010 Created this file. :-)
15 #include "dlgdimlinear.h"
17 #include "rs_dimlinear.h"
21 DlgDimLinear::DlgDimLinear(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/):
22 QDialog(parent, flags)
27 DlgDimLinear::~DlgDimLinear()
31 void DlgDimLinear::setDim(RS_DimLinear & d)
34 ui.wPen->setPen(dim->getPen(false), true, false, "Pen");
35 Drawing * graphic = dim->getGraphic();
38 ui.cbLayer->init(*(graphic->getLayerList()), false, false);
40 RS_Layer * lay = dim->getLayer(false);
43 ui.cbLayer->setLayer(*lay);
45 ui.wLabel->setLabel(dim->getLabel(false));
46 ui.leAngle->setText(QString("%1").arg(RS_Math::rad2deg(dim->getAngle())));
49 void DlgDimLinear::updateDim()
51 dim->setLabel(ui.wLabel->getLabel());
52 dim->setAngle(RS_Math::deg2rad(RS_Math::eval(ui.leAngle->text(), 0.0)));