X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmainapp%2Fgraphicview.cpp;h=77c74042ec3198c1e1f34f68f00662f54c53cbad;hb=f34fe4370628985ef1a4a4527cfa85165624e27c;hp=5475dfd1b6577b3bc439ccb17fc9edb8b32144ba;hpb=d774c2655ba2c3657a565f325411144452392277;p=architektonas diff --git a/src/mainapp/graphicview.cpp b/src/mainapp/graphicview.cpp index 5475dfd..77c7404 100644 --- a/src/mainapp/graphicview.cpp +++ b/src/mainapp/graphicview.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 // @@ -361,10 +363,10 @@ bool GraphicView::isGridOn() { if (container) { - Drawing * g = container->getGraphic(); + Drawing * d = container->getGraphic(); - if (g) - return g->isGridOn(); + if (d) + return d->isGridOn(); } return true; @@ -1409,18 +1411,6 @@ void GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db) //RS_DEBUG->print("GraphicView::drawEntity() end"); } -/** - * Deletes an entity with the background color. - * Might be recusively called e.g. for polylines. - */ -void GraphicView::deleteEntity(RS_Entity * e) -{ -#warning "!!! This is part of obsolete rendering !!!" - setDeleteMode(true); - drawEntity(e); - setDeleteMode(false); -} - /** * Draws an entity. * The painter must be initialized and all the attributes (pen) must be set. @@ -1485,15 +1475,15 @@ void GraphicView::simulateIt() */ void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen) { - if (painter == NULL || e == NULL) + if (!painter || !e) return; if (e->isContainer()) { RS_EntityContainer * ec = (RS_EntityContainer *)e; - for(RS_Entity* en=ec->firstEntity(RS2::ResolveNone); - en!=NULL; en = ec->nextEntity(RS2::ResolveNone)) + for(RS_Entity * en=ec->firstEntity(RS2::ResolveNone); + en!=NULL; en=ec->nextEntity(RS2::ResolveNone)) { if (en->isVisible() && en->isUndone() == false) { @@ -1923,18 +1913,20 @@ void GraphicView::drawRelativeZero() //Using Qt::red doesn't seem to work here... RS_Pen p(RS_Color(255, 0, 0), RS2::Width00, RS2::SolidLine); painter->setPen(p); - painter->setXORMode(); +//This doesn't work--this is NOT a QPainter! +// painter->setBrush(Qt::NoBrush); +// painter->setBackgroundMode(Qt::TransparentMode); // will that do it??? + painter->disableBrush(); +// painter->setXORMode(); int zr = 5; painter->drawLine(Vector(toGuiX(relativeZero.x) - zr, toGuiY(relativeZero.y)), Vector(toGuiX(relativeZero.x) + zr, toGuiY(relativeZero.y))); - painter->drawLine(Vector(toGuiX(relativeZero.x), toGuiY(relativeZero.y) - zr), Vector(toGuiX(relativeZero.x), toGuiY(relativeZero.y) + zr)); - painter->drawCircle(toGui(relativeZero), zr); - painter->setNormalMode(); +// painter->setNormalMode(); } /** @@ -2118,7 +2110,7 @@ Vector GraphicView::toGui(Vector v) * @param visible Pointer to a boolean which will contain true * after the call if the coordinate is within the visible range. */ -double GraphicView::toGuiX(double x, bool * visible) +double GraphicView::toGuiX(double x, bool * visible/*= NULL*/) { if (visible != NULL) {