X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fforms%2Fdlghatch.cpp;h=79e0711ddf514f5837b1eb47b40f7f671efbbca3;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=b1a8b01500b3aea623d5f92bce05bbb60741e3fb;hpb=27d4a138d23453e93a833e9347444b828a971cb4;p=architektonas diff --git a/src/forms/dlghatch.cpp b/src/forms/dlghatch.cpp index b1a8b01..79e0711 100644 --- a/src/forms/dlghatch.cpp +++ b/src/forms/dlghatch.cpp @@ -3,7 +3,9 @@ // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software +// Portions copyright (C) 2001-2003 RibbonSoft +// Copyright (C) 2010 Underground Software +// See the README and GPLv2 files for licensing and warranty information // // JLH = James L. Hammons // @@ -14,10 +16,10 @@ #include "dlghatch.h" -#include "rs_entitycontainer.h" -#include "rs_hatch.h" -#include "rs_pattern.h" -#include "rs_patternlist.h" +#include "entitycontainer.h" +#include "hatch.h" +#include "pattern.h" +#include "patternlist.h" #include "settings.h" DlgHatch::DlgHatch(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/): @@ -29,7 +31,7 @@ DlgHatch::DlgHatch(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/): hatch = NULL; isNew = false; - preview = new RS_EntityContainer(); + preview = new EntityContainer(); ui.gvPreview->setContainer(preview); ui.gvPreview->setBorders(15, 15, 15, 15); @@ -65,7 +67,7 @@ void DlgHatch::showEvent(QShowEvent * e) ui.gvPreview->zoomAuto(); } -void DlgHatch::setHatch(RS_Hatch & h, bool isNew) +void DlgHatch::setHatch(Hatch & h, bool isNew) { hatch = &h; this->isNew = isNew; @@ -99,7 +101,7 @@ void DlgHatch::setHatch(RS_Hatch & h, bool isNew) QString s; s.setNum(hatch->getScale()); ui.leScale->setText(s); - s.setNum(RS_Math::rad2deg(hatch->getAngle())); + s.setNum(Math::rad2deg(hatch->getAngle())); ui.leAngle->setText(s); } } @@ -111,13 +113,13 @@ void DlgHatch::updateHatch() hatch->setSolid(ui.cbSolid->isChecked()); hatch->setPattern(ui.cbPattern->currentText()); - hatch->setScale(RS_Math::eval(ui.leScale->text())); - hatch->setAngle(RS_Math::deg2rad(RS_Math::eval(ui.leAngle->text()))); + hatch->setScale(Math::eval(ui.leScale->text())); + hatch->setAngle(Math::deg2rad(Math::eval(ui.leAngle->text()))); } void DlgHatch::setPattern(const QString & p) { - if (!RS_PATTERNLIST->contains(p)) + if (!PATTERNLIST->contains(p)) // ui.cbPattern->insertItem(p); ui.cbPattern->addItem(p); @@ -136,7 +138,7 @@ void DlgHatch::updatePreview() updatePreview(NULL); } -void DlgHatch::updatePreview(RS_Pattern *) +void DlgHatch::updatePreview(Pattern *) { if (!preview) return; @@ -151,25 +153,25 @@ void DlgHatch::updatePreview(RS_Pattern *) QString patName = ui.cbPattern->currentText(); bool isSolid = ui.cbSolid->isChecked(); double prevSize; - //double scale = RS_Math::eval(leScale->text(), 1.0); - double angle = RS_Math::deg2rad(RS_Math::eval(ui.leAngle->text(), 0.0)); + //double scale = Math::eval(leScale->text(), 1.0); + double angle = Math::deg2rad(Math::eval(ui.leAngle->text(), 0.0)); - if (pattern != NULL) + if (pattern) prevSize = pattern->getSize().x * 10; else prevSize = 10.0; preview->clear(); - RS_Hatch * prevHatch = new RS_Hatch(preview, RS_HatchData(isSolid, 0.2, angle, patName)); + Hatch * prevHatch = new Hatch(preview, HatchData(isSolid, 0.2, angle, patName)); prevHatch->setPen(hatch->getPen()); - RS_EntityContainer * loop = new RS_EntityContainer(prevHatch); - loop->setPen(RS_Pen(RS2::FlagInvalid)); - loop->addEntity(new RS_Line(loop, RS_LineData(Vector(0.0, 0.0), Vector(10.0, 0.0)))); - loop->addEntity(new RS_Line(loop, RS_LineData(Vector(10.0, 0.0), Vector(10.0, 10.0)))); - loop->addEntity(new RS_Line(loop, RS_LineData(Vector(10.0, 10.0), Vector(0.0, 10.0)))); - loop->addEntity(new RS_Line(loop, RS_LineData(Vector(0.0, 10.0), Vector(0.0, 0.0)))); + EntityContainer * loop = new EntityContainer(prevHatch); + loop->setPen(Pen(RS2::FlagInvalid)); + loop->addEntity(new Line(loop, LineData(Vector(0.0, 0.0), Vector(10.0, 0.0)))); + loop->addEntity(new Line(loop, LineData(Vector(10.0, 0.0), Vector(10.0, 10.0)))); + loop->addEntity(new Line(loop, LineData(Vector(10.0, 10.0), Vector(0.0, 10.0)))); + loop->addEntity(new Line(loop, LineData(Vector(0.0, 10.0), Vector(0.0, 0.0)))); prevHatch->addEntity(loop); preview->addEntity(prevHatch);