]> Shamusworld >> Repos - architektonas/blobdiff - src/mainapp/graphicview.cpp
Removed unnecessary RS_ prefix from classes and whatnot.
[architektonas] / src / mainapp / graphicview.cpp
index afb20a0d1ecc3ef133c6cb6cf77995eaf4f009d6..4c8ba107be210da42b9afbcfab09937f1ea8ec5e 100644 (file)
@@ -41,10 +41,10 @@ GraphicView::GraphicView(): background(), foreground()
        previousOffsetX = 0;
        previousOffsetY = 0;
        container = NULL;
-       eventHandler = new RS_EventHandler(this);
+       eventHandler = new EventHandler(this);
        gridColor = Qt::gray;
-       metaGridColor = RS_Color(64, 64, 64);
-       grid = new RS_Grid(this);
+       metaGridColor = Color(64, 64, 64);
+       grid = new Grid(this);
        updateEnabled = 0;
        zoomFrozen = false;
        draftMode = false;
@@ -157,23 +157,23 @@ void GraphicView::adjustZoomControls()
  * Sets the background color. Note that applying the background
  * color for the widget is up to the implementing class.
  */
-void GraphicView::setBackground(const RS_Color & bg)
+void GraphicView::setBackground(const Color & bg)
 {
        background = bg;
 
        // bright background:
        if (bg.red() + bg.green() + bg.blue() > 380)
 //             foreground = Qt::black;
-               foreground = RS_Color(0, 0, 0);
+               foreground = Color(0, 0, 0);
        else
 //             foreground = Qt::white;
-               foreground = RS_Color(255, 255, 255);
+               foreground = Color(255, 255, 255);
 }
 
 /**
  * @return Current background color.
  */
-RS_Color GraphicView::getBackground()
+Color GraphicView::getBackground()
 {
        return background;
 }
@@ -181,7 +181,7 @@ RS_Color GraphicView::getBackground()
 /**
  * @return Current foreground color.
  */
-RS_Color GraphicView::getForeground()
+Color GraphicView::getForeground()
 {
        return foreground;
 }
@@ -189,7 +189,7 @@ RS_Color GraphicView::getForeground()
 /**
  * Sets the grid color.
  */
-void GraphicView::setGridColor(const RS_Color & c)
+void GraphicView::setGridColor(const Color & c)
 {
        gridColor = c;
 }
@@ -197,7 +197,7 @@ void GraphicView::setGridColor(const RS_Color & c)
 /**
  * Sets the meta grid color.
  */
-void GraphicView::setMetaGridColor(const RS_Color & c)
+void GraphicView::setMetaGridColor(const Color & c)
 {
        metaGridColor = c;
 }
@@ -205,7 +205,7 @@ void GraphicView::setMetaGridColor(const RS_Color & c)
 /**
  * Sets the selection color.
  */
-void GraphicView::setSelectedColor(const RS_Color & c)
+void GraphicView::setSelectedColor(const Color & c)
 {
        selectedColor = c;
 }
@@ -213,7 +213,7 @@ void GraphicView::setSelectedColor(const RS_Color & c)
 /**
  * Sets the highlight color.
  */
-void GraphicView::setHighlightedColor(const RS_Color & c)
+void GraphicView::setHighlightedColor(const Color & c)
 {
        highlightedColor = c;
 }
@@ -226,7 +226,7 @@ void GraphicView::setMouseCursor(RS2::CursorType /*c*/)
 {
 }
 
-RS_EntityContainer * GraphicView::getContainer()
+EntityContainer * GraphicView::getContainer()
 {
        return container;
 }
@@ -333,7 +333,7 @@ bool GraphicView::isZoomFrozen()
  * Sets the pointer to the graphic which contains the entities
  * which are visualized by this widget.
  */
-void GraphicView::setContainer(RS_EntityContainer * container)
+void GraphicView::setContainer(EntityContainer * container)
 {
        this->container = container;
 }
@@ -465,12 +465,12 @@ ActionInterface * GraphicView::getCurrentAction()
  */
 void GraphicView::setCurrentAction(ActionInterface * action)
 {
-       RS_DEBUG->print("GraphicView::setCurrentAction");
+       DEBUG->print("GraphicView::setCurrentAction");
 
        if (eventHandler)
                eventHandler->setCurrentAction(action);
 
-       RS_DEBUG->print("GraphicView::setCurrentAction: OK");
+       DEBUG->print("GraphicView::setCurrentAction: OK");
 }
 
 /**
@@ -499,8 +499,8 @@ void GraphicView::back()
 {
        if (eventHandler && eventHandler->hasAction())
                eventHandler->back();
-       else if (RS_DIALOGFACTORY)
-               RS_DIALOGFACTORY->requestPreviousMenu();
+       else if (DIALOGFACTORY)
+               DIALOGFACTORY->requestPreviousMenu();
 }
 
 /**
@@ -528,7 +528,7 @@ void GraphicView::mousePressEvent(QMouseEvent * e)
  */
 void GraphicView::mouseReleaseEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("GraphicView::mouseReleaseEvent");
+       DEBUG->print("GraphicView::mouseReleaseEvent");
 
        if (!eventHandler)
                return;
@@ -543,7 +543,7 @@ void GraphicView::mouseReleaseEvent(QMouseEvent * e)
                e->accept();
        }
 
-       RS_DEBUG->print("GraphicView::mouseReleaseEvent: OK");
+       DEBUG->print("GraphicView::mouseReleaseEvent: OK");
 }
 
 /**
@@ -552,14 +552,14 @@ void GraphicView::mouseReleaseEvent(QMouseEvent * e)
  */
 void GraphicView::mouseMoveEvent(QMouseEvent * e)
 {
-       RS_DEBUG->print("GraphicView::mouseMoveEvent begin");
+       DEBUG->print("GraphicView::mouseMoveEvent begin");
 
        Drawing * graphic = NULL;
 
        if (container->rtti() == RS2::EntityGraphic)
                graphic = (Drawing *)container;
 
-       RS_DEBUG->print("GraphicView::mouseMoveEvent 001");
+       DEBUG->print("GraphicView::mouseMoveEvent 001");
 
        if (e)
        {
@@ -567,23 +567,23 @@ void GraphicView::mouseMoveEvent(QMouseEvent * e)
                my = e->y();
        }
 
-       RS_DEBUG->print("GraphicView::mouseMoveEvent 002");
+       DEBUG->print("GraphicView::mouseMoveEvent 002");
 
        if (eventHandler)
                eventHandler->mouseMoveEvent(e);
 
-       RS_DEBUG->print("GraphicView::mouseMoveEvent 003");
+       DEBUG->print("GraphicView::mouseMoveEvent 003");
 
        if (!eventHandler || !eventHandler->hasAction() && graphic)
        {
                Vector mouse = toGraph(Vector(mx, my));
                Vector relMouse = mouse - getRelativeZero();
 
-               if (RS_DIALOGFACTORY)
-                       RS_DIALOGFACTORY->updateCoordinateWidget(mouse, relMouse);
+               if (DIALOGFACTORY)
+                       DIALOGFACTORY->updateCoordinateWidget(mouse, relMouse);
        }
 
-       RS_DEBUG->print("GraphicView::mouseMoveEvent end");
+       DEBUG->print("GraphicView::mouseMoveEvent end");
 }
 
 /**
@@ -629,7 +629,7 @@ void GraphicView::keyReleaseEvent(QKeyEvent * e)
 /**
  * Called by the actual GUI class which implements a command line.
  */
-void GraphicView::commandEvent(RS_CommandEvent * e)
+void GraphicView::commandEvent(CommandEvent * e)
 {
        if (eventHandler)
                eventHandler->commandEvent(e);
@@ -660,7 +660,7 @@ void GraphicView::zoomIn(double f, const Vector & center)
 {
        if (f < 1.0e-6)
        {
-               RS_DEBUG->print(RS_Debug::D_WARNING, "GraphicView::zoomIn: invalid factor");
+               DEBUG->print(Debug::D_WARNING, "GraphicView::zoomIn: invalid factor");
                return;
        }
 
@@ -714,7 +714,7 @@ void GraphicView::zoomOut(double f, const Vector & center)
 {
        if (f < 1.0e-6)
        {
-               RS_DEBUG->print(RS_Debug::D_WARNING,
+               DEBUG->print(Debug::D_WARNING,
                        "GraphicView::zoomOut: invalid factor");
                return;
        }
@@ -732,7 +732,7 @@ void GraphicView::zoomOutX(double f)
 {
        if (f < 1.0e-6)
        {
-               RS_DEBUG->print(RS_Debug::D_WARNING,
+               DEBUG->print(Debug::D_WARNING,
                        "GraphicView::zoomOutX: invalid factor");
                return;
        }
@@ -755,7 +755,7 @@ void GraphicView::zoomOutY(double f)
 {
        if (f < 1.0e-6)
        {
-               RS_DEBUG->print(RS_Debug::D_WARNING, "GraphicView::zoomOutY: invalid factor");
+               DEBUG->print(Debug::D_WARNING, "GraphicView::zoomOutY: invalid factor");
                return;
        }
 
@@ -779,7 +779,7 @@ void GraphicView::zoomOutY(double f)
  */
 void GraphicView::zoomAuto(bool axis, bool keepAspectRatio)
 {
-       RS_DEBUG->print("GraphicView::zoomAuto");
+       DEBUG->print("GraphicView::zoomAuto");
 
        if (simulationRunning)
                return;
@@ -814,12 +814,12 @@ void GraphicView::zoomAuto(bool axis, bool keepAspectRatio)
                else
                        fy = 1.0;
 
-               RS_DEBUG->print("f: %f/%f", fx, fy);
+               DEBUG->print("f: %f/%f", fx, fy);
 
                if (keepAspectRatio)
                        fx = fy = std::min(fx, fy);
 
-               RS_DEBUG->print("f: %f/%f", fx, fy);
+               DEBUG->print("f: %f/%f", fx, fy);
 
                if (fx < RS_TOLERANCE)
                        fx = fy = 1.0;
@@ -827,22 +827,22 @@ void GraphicView::zoomAuto(bool axis, bool keepAspectRatio)
                setFactorX(fx);
                setFactorY(fy);
 
-               RS_DEBUG->print("f: %f/%f", fx, fy);
+               DEBUG->print("f: %f/%f", fx, fy);
 
-               RS_DEBUG->print("adjustOffsetControls");
+               DEBUG->print("adjustOffsetControls");
                adjustOffsetControls();
-               RS_DEBUG->print("adjustZoomControls");
+               DEBUG->print("adjustZoomControls");
                adjustZoomControls();
-               RS_DEBUG->print("centerOffsetX");
+               DEBUG->print("centerOffsetX");
                centerOffsetX();
-               RS_DEBUG->print("centerOffsetY");
+               DEBUG->print("centerOffsetY");
                centerOffsetY();
-               RS_DEBUG->print("updateGrid");
+               DEBUG->print("updateGrid");
                updateGrid();
                redraw();
        }
 
-       RS_DEBUG->print("GraphicView::zoomAuto OK");
+       DEBUG->print("GraphicView::zoomAuto OK");
 }
 
 /**
@@ -850,7 +850,7 @@ void GraphicView::zoomAuto(bool axis, bool keepAspectRatio)
  */
 void GraphicView::zoomPrevious()
 {
-       RS_DEBUG->print("GraphicView::zoomPrevious");
+       DEBUG->print("GraphicView::zoomPrevious");
 
        if (simulationRunning)
                return;
@@ -909,12 +909,12 @@ void GraphicView::zoomAutoY(bool axis)
                double maxY = RS_MINDOUBLE;
                bool noChange = false;
 
-               for(RS_Entity * e=container->firstEntity(RS2::ResolveNone);
+               for(Entity * e=container->firstEntity(RS2::ResolveNone);
                        e!=NULL; e = container->nextEntity(RS2::ResolveNone))
                {
                        if (e->rtti() == RS2::EntityLine)
                        {
-                               RS_Line * l = (RS_Line *)e;
+                               Line * l = (Line *)e;
                                double x1, x2;
                                x1 = toGuiX(l->getStartpoint().x);
                                x2 = toGuiX(l->getEndpoint().x);
@@ -958,7 +958,7 @@ void GraphicView::zoomAutoY(bool axis)
                        updateGrid();
                }
 
-               RS_DEBUG->print("Auto zoom y ok");
+               DEBUG->print("Auto zoom y ok");
        }
 }
 
@@ -1101,7 +1101,7 @@ void GraphicView::zoomScroll(RS2::Direction direction)
  */
 void GraphicView::zoomPage()
 {
-       RS_DEBUG->print("GraphicView::zoomPage");
+       DEBUG->print("GraphicView::zoomPage");
 
        if (container == NULL)
                return;
@@ -1129,11 +1129,11 @@ void GraphicView::zoomPage()
        else
                fy = 1.0;
 
-       RS_DEBUG->print("f: %f/%f", fx, fy);
+       DEBUG->print("f: %f/%f", fx, fy);
 
        fx = fy = std::min(fx, fy);
 
-       RS_DEBUG->print("f: %f/%f", fx, fy);
+       DEBUG->print("f: %f/%f", fx, fy);
 
        if (fx < RS_TOLERANCE)
                fx = fy = 1.0;
@@ -1141,7 +1141,7 @@ void GraphicView::zoomPage()
        setFactorX(fx);
        setFactorY(fy);
 
-       RS_DEBUG->print("f: %f/%f", fx, fy);
+       DEBUG->print("f: %f/%f", fx, fy);
 
        centerOffsetX();
        centerOffsetY();
@@ -1156,14 +1156,14 @@ void GraphicView::zoomPage()
  */
 void GraphicView::drawWindow(Vector v1, Vector v2)
 {
-       RS_DEBUG->print("GraphicView::drawWindow() begin");
+       DEBUG->print("GraphicView::drawWindow() begin");
 
        if (simulationRunning)
                return;
 
        if (container)
        {
-               for(RS_Entity * se=container->firstEntity(RS2::ResolveNone); se!=NULL;
+               for(Entity * se=container->firstEntity(RS2::ResolveNone); se!=NULL;
                        se=container->nextEntity(RS2::ResolveNone))
                {
                        if (se->isInWindow(v1, v2))
@@ -1171,7 +1171,7 @@ void GraphicView::drawWindow(Vector v1, Vector v2)
                }
        }
 
-       RS_DEBUG->print("GraphicView::drawWindow() end");
+       DEBUG->print("GraphicView::drawWindow() end");
 }
 
 /**
@@ -1212,7 +1212,7 @@ void GraphicView::drawIt()
                drawMetaGrid();
 
        // drawing entities:
-//#warning "!!! This looks like a bug, no match for 'drawEntity(RS_Entity *, bool) !!!"
+//#warning "!!! This looks like a bug, no match for 'drawEntity(Entity *, bool) !!!"
 // and indeed it *is* a bug... true is converted to 1.0 here. Dumb, dumb, dumb.
        drawEntity(container);//, true);
 
@@ -1232,7 +1232,7 @@ void GraphicView::drawIt()
  * Sets the pen of the painter object to the suitable pen for the given
  * entity.
  */
-void GraphicView::setPenForEntity(RS_Entity * e)
+void GraphicView::setPenForEntity(Entity * e)
 {
        if (drawingMode == RS2::ModePreview /*|| draftMode==true*/)
                return;
@@ -1242,7 +1242,7 @@ void GraphicView::setPenForEntity(RS_Entity * e)
 
        // set color of entity
        // Getting pen from entity (or layer)
-       RS_Pen pen = e->getPen(true);
+       Pen pen = e->getPen(true);
 
        int w = pen.getWidth();
 
@@ -1258,7 +1258,7 @@ void GraphicView::setPenForEntity(RS_Entity * e)
 
                if (graphic)
                {
-                       uf = RS_Units::convert(1.0, RS2::Millimeter, graphic->getUnit());
+                       uf = Units::convert(1.0, RS2::Millimeter, graphic->getUnit());
 
                        if ((isPrinting() || isPrintPreview()) && graphic->getPaperScale() > 1.0e-6)
                                wf = 1.0 / graphic->getPaperScale();
@@ -1273,7 +1273,7 @@ void GraphicView::setPenForEntity(RS_Entity * e)
        }
 
        // prevent drawing with 1-width which is slow:
-       if (RS_Math::round(pen.getScreenWidth()) == 1)
+       if (Math::round(pen.getScreenWidth()) == 1)
                pen.setScreenWidth(0.0);
 
        // prevent background color on background drawing:
@@ -1284,14 +1284,14 @@ void GraphicView::setPenForEntity(RS_Entity * e)
        if (e->isSelected())
        {
                pen.setLineType(RS2::DotLine);
-               //pen.setColor(RS_Color(0xa5,0x47,0x47));
+               //pen.setColor(Color(0xa5,0x47,0x47));
                pen.setColor(selectedColor);
        }
 
        // this entity is highlighted:
        if (e->isHighlighted())
        {
-               //pen.setColor(RS_Color(0x73, 0x93, 0x73));
+               //pen.setColor(Color(0x73, 0x93, 0x73));
                pen.setColor(highlightedColor);
        }
 
@@ -1311,9 +1311,9 @@ void GraphicView::setPenForEntity(RS_Entity * e)
  *        lines e.g. in splines).
  * @param db Double buffering on (recommended) / off
  */
-void GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db)
+void GraphicView::drawEntity(Entity * e, double patternOffset, bool db)
 {
-       //RS_DEBUG->print("GraphicView::drawEntity() begin");
+       //DEBUG->print("GraphicView::drawEntity() begin");
 
        // update is diabled:
        if (!isUpdateEnabled())
@@ -1338,18 +1338,18 @@ void GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db)
 //}
 
        //drawRecursion++;
-       //RS_DEBUG->print("recursion 1: %d", drawRecursion);
+       //DEBUG->print("recursion 1: %d", drawRecursion);
 
        // set pen (color):
        setPenForEntity(e);
 
-       //RS_DEBUG->print("draw plain");
+       //DEBUG->print("draw plain");
        if (draftMode)
        {
                // large texts as rectangles:
                if (e->rtti() == RS2::EntityText)
                {
-                       if (toGuiDX(((RS_Text *)e)->getHeight()) < 4 || e->countDeep() > 100)
+                       if (toGuiDX(((Text *)e)->getHeight()) < 4 || e->countDeep() > 100)
                                painter->drawRect(toGui(e->getMin()), toGui(e->getMax()));
                        else
                                drawEntityPlain(e, patternOffset);
@@ -1378,7 +1378,7 @@ void GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db)
                        for(int i=0; i<s.getNumber(); ++i)
                        {
                                int sz = -1;
-                               RS_Color col = RS_Color(0, 0, 255);
+                               Color col = Color(0, 0, 255);
 
                                if (e->rtti() == RS2::EntityPolyline)
                                {
@@ -1388,13 +1388,13 @@ void GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db)
                                                {
                                                        sz = 4;
 //                                                     col = QColor(0, 64, 255);
-                                                       col = RS_Color(0, 64, 255);
+                                                       col = Color(0, 64, 255);
                                                }
                                                else
                                                {
                                                        sz = 3;
 //                                                     col = QColor(0, 0, 128);
-                                                       col = RS_Color(0, 0, 128);
+                                                       col = Color(0, 0, 128);
                                                }
                                        }
                                }
@@ -1407,15 +1407,15 @@ void GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db)
                }
        }
 
-       //RS_DEBUG->print("draw plain OK");
-       //RS_DEBUG->print("GraphicView::drawEntity() end");
+       //DEBUG->print("draw plain OK");
+       //DEBUG->print("GraphicView::drawEntity() end");
 }
 
 /**
  * Draws an entity.
  * The painter must be initialized and all the attributes (pen) must be set.
  */
-void GraphicView::drawEntityPlain(RS_Entity * e, double patternOffset/*= 0.0*/)
+void GraphicView::drawEntityPlain(Entity * e, double patternOffset/*= 0.0*/)
 {
 //Problems can still occur here when passing in a deleted object... It won't be
 //NULL, but it will cause a segfault here...
@@ -1455,7 +1455,7 @@ void GraphicView::simulateIt()
                drawGrid();
 
        // drawing entities:
-       RS_Pen pen(foreground, RS2::Width00, RS2::SolidLine);
+       Pen pen(foreground, RS2::Width00, RS2::SolidLine);
        simulateEntity(container, pen);
 
        // drawing zero points:
@@ -1473,16 +1473,16 @@ void GraphicView::simulateIt()
  *
  * @param smooth If true, the entity will be drawn slowly (pixel by pixel).
  */
-void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen)
+void GraphicView::simulateEntity(Entity * e, const Pen & pen)
 {
        if (!painter || !e)
                return;
 
        if (e->isContainer())
        {
-               RS_EntityContainer * ec = (RS_EntityContainer *)e;
+               EntityContainer * ec = (EntityContainer *)e;
 
-               for(RS_Entity * en=ec->firstEntity(RS2::ResolveNone);
+               for(Entity * en=ec->firstEntity(RS2::ResolveNone);
                        en!=NULL; en=ec->nextEntity(RS2::ResolveNone))
                {
                        if (en->isVisible() && en->isUndone() == false)
@@ -1490,26 +1490,26 @@ void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen)
                                // draw rapid move:
                                if (en->isAtomic() && simulationRapid)
                                {
-                                       Vector sp = ((RS_AtomicEntity *)en)->getStartpoint();
+                                       Vector sp = ((AtomicEntity *)en)->getStartpoint();
 
                                        if (sp.distanceTo(simulationLast) > 1.0e-4)
                                        {
-                                               RS_Pen rpen(RS_Color(0, 0, 255), RS2::Width00, RS2::SolidLine);
-                                               RS_Line rapidLine(NULL, RS_LineData(simulationLast, sp));
+                                               Pen rpen(Color(0, 0, 255), RS2::Width00, RS2::SolidLine);
+                                               Line rapidLine(NULL, LineData(simulationLast, sp));
                                                simulateEntity(&rapidLine, rpen);
                                        }
                                }
 
                                if (en->isHighlighted())
                                {
-                                       RS_Pen hpen(highlightedColor, RS2::Width00, RS2::SolidLine);
+                                       Pen hpen(highlightedColor, RS2::Width00, RS2::SolidLine);
                                        simulateEntity(en, hpen);
                                }
                                else
                                        simulateEntity(en, pen);
 
                                if (en->isAtomic())
-                                       simulationLast = ((RS_AtomicEntity *)en)->getEndpoint();
+                                       simulationLast = ((AtomicEntity *)en)->getEndpoint();
 
                                if (!simulationSmooth)
                                        simulationDelay(true);
@@ -1524,7 +1524,7 @@ void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen)
                        {
                        case RS2::EntityLine:
                        {
-                               RS_Line * line = (RS_Line *)e;
+                               Line * line = (Line *)e;
                                drawLineSmooth(toGui(line->getStartpoint()), toGui(line->getEndpoint()), pen);
                                        //simulationSpeed);
                        }
@@ -1532,7 +1532,7 @@ void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen)
 
                        case RS2::EntityArc:
                        {
-                               RS_Arc * arc = (RS_Arc *)e;
+                               Arc * arc = (Arc *)e;
                                drawArcSmooth(toGui(arc->getCenter()), toGuiDX(arc->getRadius()),
                                        arc->getAngle1(), arc->getAngle2(), arc->isReversed(), pen);
                        }
@@ -1540,7 +1540,7 @@ void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen)
 
                        case RS2::EntityCircle:
                        {
-                               RS_Circle * circle = (RS_Circle *)e;
+                               Circle * circle = (Circle *)e;
                                drawArcSmooth(toGui(circle->getCenter()), toGuiDX(circle->getRadius()),
                                        0.0, 2.0 * M_PI, false, pen);
                        }
@@ -1607,31 +1607,31 @@ void GraphicView::simulationDelay(bool step)
 /**
  * Draws a line slowly from (x1, y1) to (x2, y2). This is used for simulation only.
  */
-void GraphicView::drawLineSmooth(const Vector & p1, const Vector & p2, const RS_Pen & pen)
+void GraphicView::drawLineSmooth(const Vector & p1, const Vector & p2, const Pen & pen)
 {
        double alpha = p1.angleTo(p2);
        double xStep, yStep;
        bool  xIsOne;
 
-       if (RS_Math::cmpDouble(alpha, 0.0) || RS_Math::cmpDouble(alpha, 2 * M_PI))
+       if (Math::cmpDouble(alpha, 0.0) || Math::cmpDouble(alpha, 2 * M_PI))
        {
                xStep = 1.0;
                yStep = 0.0;
                xIsOne = true;
        }
-       else if (RS_Math::cmpDouble(alpha, M_PI / 2.0))
+       else if (Math::cmpDouble(alpha, M_PI / 2.0))
        {
                xStep = 0.0;
                yStep = 1.0;
                xIsOne = false;
        }
-       else if (RS_Math::cmpDouble(alpha, M_PI))
+       else if (Math::cmpDouble(alpha, M_PI))
        {
                xStep = -1.0;
                yStep = 0.0;
                xIsOne = true;
        }
-       else if (RS_Math::cmpDouble(alpha, M_PI / 2.0 * 3.0))
+       else if (Math::cmpDouble(alpha, M_PI / 2.0 * 3.0))
        {
                xStep = 0.0;
                yStep = -1.0;
@@ -1680,7 +1680,7 @@ void GraphicView::drawLineSmooth(const Vector & p1, const Vector & p2, const RS_
 }
 
 void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1, double a2, bool rev,
-       const RS_Pen & pen)
+       const Pen & pen)
 {
        if (radius <= 1.4)
        {
@@ -1689,10 +1689,10 @@ void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1,
        }
        else
        {
-               int ix1 = RS_Math::round(center.x + cos(a1) * radius);
-               int iy1 = RS_Math::round(center.y - sin(a1) * radius);
-               int ix2 = RS_Math::round(center.x + cos(a2) * radius);
-               int iy2 = RS_Math::round(center.y - sin(a2) * radius);
+               int ix1 = Math::round(center.x + cos(a1) * radius);
+               int iy1 = Math::round(center.y - sin(a1) * radius);
+               int ix2 = Math::round(center.x + cos(a2) * radius);
+               int iy2 = Math::round(center.y - sin(a2) * radius);
                int k2x = 0;            // Next point on circle
                int k2y = 0;            //
                int k1x = ix1;          // Prev point on circle
@@ -1718,8 +1718,8 @@ void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1,
 
                        for(a=a1+aStep; a<=a2cp; a+=aStep)
                        {
-                               k2x = RS_Math::round(center.x+cos(a)*radius);
-                               k2y = RS_Math::round(center.y-sin(a)*radius);
+                               k2x = Math::round(center.x+cos(a)*radius);
+                               k2y = Math::round(center.y-sin(a)*radius);
                                painter->setPen(pen);
 
                                if ((k2x >= 0 && k2x <= painter->getWidth()
@@ -1747,8 +1747,8 @@ void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1,
 
                        for(a=a1-aStep; a>=a2cp; a-=aStep)
                        {
-                               k2x = RS_Math::round(center.x + cos(a) * radius);
-                               k2y = RS_Math::round(center.y - sin(a) * radius);
+                               k2x = Math::round(center.x + cos(a) * radius);
+                               k2y = Math::round(center.y - sin(a) * radius);
                                painter->setPen(pen);
 
                                if ((k2x >=0 && k2x <= painter->getWidth()
@@ -1774,7 +1774,7 @@ void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1,
  * @return Pointer to the static pattern struct that belongs to the
  * given pattern type or NULL.
  */
-RS_LineTypePattern * GraphicView::getPattern(RS2::LineType t)
+LineTypePattern * GraphicView::getPattern(RS2::LineType t)
 {
        switch (t)
        {
@@ -1873,10 +1873,10 @@ void GraphicView::drawAbsoluteZero()
 
        int zr = 20;
 
-//     RS_Pen p(Qt::red, RS2::Width00, RS2::SolidLine);
+//     Pen p(Qt::red, RS2::Width00, RS2::SolidLine);
 //Using Qt::red doesn't seem to work here...
-//It's because Qt colors and RS_Color are not 100% compatible...
-       RS_Pen p(RS_Color(255, 0, 0), RS2::Width00, RS2::SolidLine);
+//It's because Qt colors and Color are not 100% compatible...
+       Pen p(Color(255, 0, 0), RS2::Width00, RS2::SolidLine);
        painter->setPen(p);
 
        painter->drawLine(Vector(toGuiX(0.0) - zr, toGuiY(0.0)),
@@ -1911,7 +1911,7 @@ void GraphicView::drawRelativeZero()
 #endif
 
 //Using Qt::red doesn't seem to work here...
-       RS_Pen p(RS_Color(255, 0, 0), RS2::Width00, RS2::SolidLine);
+       Pen p(Color(255, 0, 0), RS2::Width00, RS2::SolidLine);
        painter->setPen(p);
 //This doesn't work--this is NOT a QPainter!
 //     painter->setBrush(Qt::NoBrush);
@@ -1951,7 +1951,7 @@ void GraphicView::drawPaper()
                return;
 
        // draw paper:
-       painter->setPen(RS_Pen(Qt::gray));
+       painter->setPen(Pen(Qt::gray));
 
        Vector pinsbase = graphic->getPaperInsertionBase();
        Vector size = graphic->getPaperSize();
@@ -1961,19 +1961,19 @@ void GraphicView::drawPaper()
        Vector v2 = toGui((size - pinsbase) / scale);
 
        // gray background:
-       painter->fillRect(0,0, getWidth(), getHeight(), RS_Color(200, 200, 200));
+       painter->fillRect(0,0, getWidth(), getHeight(), Color(200, 200, 200));
 
        // shadow
        painter->fillRect((int)(v1.x) + 6, (int)(v1.y) + 6,
-               (int)((v2.x - v1.x)), (int)((v2.y - v1.y)), RS_Color(64, 64, 64));
+               (int)((v2.x - v1.x)), (int)((v2.y - v1.y)), Color(64, 64, 64));
 
        // border:
        painter->fillRect((int)(v1.x), (int)(v1.y),
-               (int)((v2.x - v1.x)), (int)((v2.y - v1.y)), RS_Color(64, 64, 64));
+               (int)((v2.x - v1.x)), (int)((v2.y - v1.y)), Color(64, 64, 64));
 
        // paper
        painter->fillRect((int)(v1.x) + 1, (int)(v1.y) - 1,
-               (int)((v2.x - v1.x)) - 2, (int)((v2.y - v1.y)) + 2, RS_Color(255, 255, 255));
+               (int)((v2.x - v1.x)) - 2, (int)((v2.y - v1.y)) + 2, Color(255, 255, 255));
 }
 
 /**
@@ -2021,7 +2021,7 @@ void GraphicView::drawMetaGrid()
        if (!painter)
                return;
 
-       RS_Pen pen(metaGridColor, RS2::Width00, RS2::DotLine);
+       Pen pen(metaGridColor, RS2::Width00, RS2::DotLine);
        painter->setPen(pen);
 
        // draw meta grid:
@@ -2050,7 +2050,7 @@ void GraphicView::updateGrid()
                grid->update();
 }
 
-RS_Grid * GraphicView::getGrid()
+Grid * GraphicView::getGrid()
 {
        return grid;
 }
@@ -2080,7 +2080,7 @@ void GraphicView::setDefaultSnapMode(RS2::SnapMode sm)
                eventHandler->setSnapMode(sm);
 
        //OK, the above sets the snap mode in the snapper that's derived from
-       //the RS_ActionInterface and RS_Snapper. So the following should fix
+       //the RS_ActionInterface and Snapper. So the following should fix
        //us up, hm notwithstanding. [and it does. :-)]
        //hm.
        snapper.setSnapMode(sm);
@@ -2154,7 +2154,7 @@ double GraphicView::toGuiDY(double d)
  */
 Vector GraphicView::toGraph(Vector v)
 {
-       return Vector(toGraphX(RS_Math::round(v.x)), toGraphY(RS_Math::round(v.y)), 0.0);
+       return Vector(toGraphX(Math::round(v.x)), toGraphY(Math::round(v.y)), 0.0);
 }
 
 /**
@@ -2243,7 +2243,7 @@ void GraphicView::moveRelativeZero(const Vector & pos)
        setRelativeZero(pos);
 }
 
-RS_EventHandler * GraphicView::getEventHandler()
+EventHandler * GraphicView::getEventHandler()
 {
        return eventHandler;
 }