X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fpaintinterface.cpp;fp=src%2Fbase%2Fpaintinterface.cpp;h=fdcbee464204887a8f361419573fdab84eb9cada;hb=16354e0421b316a62c6b9f7b0b4f3b8cf6f06284;hp=1fd77511ada5b3d6e28a6893d4f1d3c0c905671d;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/base/paintinterface.cpp b/src/base/paintinterface.cpp index 1fd7751..fdcbee4 100644 --- a/src/base/paintinterface.cpp +++ b/src/base/paintinterface.cpp @@ -47,7 +47,7 @@ void PaintInterface::createArc(QPolygon & pa, const Vector& cp, double radius, { if (radius < 1.0e-6) { - RS_DEBUG->print(RS_Debug::D_WARNING, "PaintInterface::createArc: invalid radius: %f", radius); + DEBUG->print(Debug::D_WARNING, "PaintInterface::createArc: invalid radius: %f", radius); return; } @@ -120,7 +120,7 @@ void PaintInterface::drawRect(const Vector & p1, const Vector & p2) drawLine(Vector(p1.x, p2.y), Vector(p1.x, p1.y)); } -void PaintInterface::drawHandle(const Vector & p, const RS_Color & c, int size) +void PaintInterface::drawHandle(const Vector & p, const Color & c, int size) { if (size < 0) size = 2; @@ -147,12 +147,12 @@ void PaintInterface::setOffset(const Vector & o) int PaintInterface::toScreenX(double x) { - return RS_Math::round(offset.x + x); + return Math::round(offset.x + x); } int PaintInterface::toScreenY(double y) { - return RS_Math::round(offset.y + y); + return Math::round(offset.y + y); } /** @@ -339,7 +339,7 @@ void PaintInterface::drawArc(const Vector & cp, double radius, double a1, double */ void PaintInterface::drawArcMac(const Vector& cp, double radius, double a1, double a2, bool reversed) { - RS_DEBUG->print("PaintInterface::drawArcMac"); + DEBUG->print("PaintInterface::drawArcMac"); if (radius <= 0.5) drawGridPoint(cp); else @@ -411,7 +411,7 @@ void PaintInterface::drawCircle(const Vector & cp, double radius) if (drawingMode == RS2::ModeXOR && radius < 500) { // This is _very_ slow for large arcs: - painter->drawEllipse(toScreenX(cp.x - radius), toScreenY(cp.y - radius), RS_Math::round(2.0 * radius), RS_Math::round(2.0 * radius)); + painter->drawEllipse(toScreenX(cp.x - radius), toScreenY(cp.y - radius), Math::round(2.0 * radius), Math::round(2.0 * radius)); } else { @@ -422,7 +422,7 @@ void PaintInterface::drawCircle(const Vector & cp, double radius) #endif } #else -// painter->drawEllipse(toScreenX(cp.x - radius), toScreenY(cp.y - radius), RS_Math::round(2.0 * radius), RS_Math::round(2.0 * radius)); +// painter->drawEllipse(toScreenX(cp.x - radius), toScreenY(cp.y - radius), Math::round(2.0 * radius), Math::round(2.0 * radius)); painter->drawEllipse(QPointF(cp.x, cp.y), radius, radius); #endif } @@ -498,7 +498,7 @@ void PaintInterface::drawImg(QImage & img, const Vector & pos, QMatrix wm; wm.translate(pos.x, pos.y); wm.scale(factor.x, factor.y); - wm.rotate(RS_Math::rad2deg(-angle)); + wm.rotate(Math::rad2deg(-angle)); painter->setWorldMatrix(wm); if (fabs(angle) < 1.0e-4) @@ -509,7 +509,7 @@ void PaintInterface::drawImg(QImage & img, const Vector & pos, painter->restore(); } -void PaintInterface::fillRect(int x1, int y1, int w, int h, const RS_Color & col) +void PaintInterface::fillRect(int x1, int y1, int w, int h, const Color & col) { painter->fillRect(x1, y1, w, h, col); } @@ -539,33 +539,33 @@ int PaintInterface::getHeight() void PaintInterface::setPreviewPen() { - setPen(RS_Color(0, 255, 255)); + setPen(Color(0, 255, 255)); } -RS_Pen PaintInterface::getPen() +Pen PaintInterface::getPen() { return lpen; } -void PaintInterface::setPen(const RS_Pen & pen) +void PaintInterface::setPen(const Pen & pen) { lpen = pen; if (drawingMode == RS2::ModeBW) - lpen.setColor(RS_Color(0, 0, 0)); + lpen.setColor(Color(0, 0, 0)); - QPen p(lpen.getColor(), RS_Math::round(lpen.getScreenWidth()), RS2::rsToQtLineType(lpen.getLineType())); + QPen p(lpen.getColor(), Math::round(lpen.getScreenWidth()), RS2::rsToQtLineType(lpen.getLineType())); p.setJoinStyle(Qt::RoundJoin); p.setCapStyle(Qt::RoundCap); painter->setPen(p); } -void PaintInterface::setPen(const RS_Color & color) +void PaintInterface::setPen(const Color & color) { if (drawingMode == RS2::ModeBW) { - lpen.setColor(RS_Color(0, 0, 0)); - painter->setPen(RS_Color(0, 0, 0)); + lpen.setColor(Color(0, 0, 0)); + painter->setPen(Color(0, 0, 0)); } else { @@ -584,11 +584,11 @@ void PaintInterface::setPen(int r, int g, int b) void PaintInterface::disablePen(void) { - lpen = RS_Pen(RS2::FlagInvalid); + lpen = Pen(RS2::FlagInvalid); painter->setPen(Qt::NoPen); } -void PaintInterface::setBrush(const RS_Color & color) +void PaintInterface::setBrush(const Color & color) { if (drawingMode == RS2::ModeBW) painter->setBrush(QColor(0, 0, 0)); @@ -598,7 +598,7 @@ void PaintInterface::setBrush(const RS_Color & color) void PaintInterface::disableBrush(void) { -// lpen = RS_Pen(RS2::FlagInvalid); +// lpen = Pen(RS2::FlagInvalid); painter->setBrush(Qt::NoBrush); }