Author: aschnell Date: Wed Jan 28 12:17:12 2009 New Revision: 55108 URL: http://svn.opensuse.org/viewcvs/yast?rev=55108&view=rev Log: - cleanup Modified: trunk/qt-graph/src/QY2Graph.cc trunk/qt-graph/src/QY2Graph.h Modified: trunk/qt-graph/src/QY2Graph.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/src/QY2Graph.cc?rev=55108&r1=55107&r2=55108&view=diff ============================================================================== --- trunk/qt-graph/src/QY2Graph.cc (original) +++ trunk/qt-graph/src/QY2Graph.cc Wed Jan 28 12:17:12 2009 @@ -105,18 +105,18 @@ QPointF -QY2Graph::gToQ(const point& p, bool trans) const +QY2Graph::gToQ(const point& p, bool upside_down) const { QPointF tmp(p.x, p.y); - return trans ? QPointF(tmp.x(), size.height() - tmp.y()) : QPointF(tmp.x(), -tmp.y()); + return upside_down ? QPointF(tmp.x(), size.height() - tmp.y()) : QPointF(tmp.x(), -tmp.y()); } QPointF -QY2Graph::gToQ(const pointf& p, bool trans) const +QY2Graph::gToQ(const pointf& p, bool upside_down) const { QPointF tmp(p.x, p.y); - return trans ? QPointF(tmp.x(), size.height() - tmp.y()) : QPointF(tmp.x(), -tmp.y()); + return upside_down ? QPointF(tmp.x(), size.height() - tmp.y()) : QPointF(tmp.x(), -tmp.y()); } @@ -155,7 +155,7 @@ QPainterPath -QY2Graph::haha3(const bezier& bezier) const +QY2Graph::makeBezier(const bezier& bezier) const { QPainterPath path; path.moveTo(gToQ(bezier.list[0])); @@ -234,7 +234,7 @@ QPolygonF -QY2Graph::haha1(node_t* node) const +QY2Graph::makeShapeHelper(node_t* node) const { const polygon_t* poly = (polygon_t*) ND_shape_info(node); @@ -254,7 +254,7 @@ QPainterPath -QY2Graph::haha2(node_t* node) const +QY2Graph::makeShape(node_t* node) const { QPainterPath path; @@ -266,14 +266,14 @@ (strcmp(name, "polygon") == 0) || (strcmp(name, "diamond") == 0)) { - QPolygonF polygon = haha1(node); + QPolygonF polygon = makeShapeHelper(node); polygon.append(polygon[0]); path.addPolygon(polygon); } else if ((strcmp(name, "ellipse") == 0) || (strcmp(name, "circle") == 0)) { - QPolygonF polygon = haha1(node); + QPolygonF polygon = makeShapeHelper(node); path.addEllipse(QRectF(polygon[0], polygon[1])); } else @@ -337,7 +337,7 @@ drawLabel(ND_label(node), &painter); painter.end(); - QY2Node* item = new QY2Node(haha2(node), picture); + QY2Node* item = new QY2Node(makeShape(node), picture); item->setPos(gToQ(ND_coord_i(node))); @@ -364,7 +364,7 @@ QColor color(aggetToQColor(edge, "color", Qt::black)); - QPainterPath path(haha3(bz)); + QPainterPath path(makeBezier(bz)); QPicture picture; QPainter painter; Modified: trunk/qt-graph/src/QY2Graph.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/src/QY2Graph.h?rev=55108&r1=55107&r2=55108&view=diff ============================================================================== --- trunk/qt-graph/src/QY2Graph.h (original) +++ trunk/qt-graph/src/QY2Graph.h Wed Jan 28 12:17:12 2009 @@ -66,32 +66,22 @@ QSizeF size; - /** - * Transform graphviz point into Qt QPointF. - */ - QPointF gToQ(const point& p, bool trans = true) const; - - /** - * Transform graphviz pointf into Qt QPointF. - */ - QPointF gToQ(const pointf& p, bool trans = true) const; + QPointF gToQ(const point& p, bool upside_down = true) const; + QPointF gToQ(const pointf& p, bool upside_down = true) const; QString aggetToQString(void* obj, const char* name, const QString& fallback) const; - QColor aggetToQColor(void* obj, const char* name, const QColor& fallback) const; - Qt::PenStyle aggetToQPenStyle(void* obj, const char* name, const Qt::PenStyle fallback) const; - void drawArrow(const QLineF& line, const QColor& color, QPainter* painter) const; - - QPolygonF haha1(node_t* node) const; + QPainterPath makeShape(node_t* node) const; + QPolygonF makeShapeHelper(node_t* node) const; - QPainterPath haha2(node_t* node) const; - - QPainterPath haha3(const bezier& bezier) const; + QPainterPath makeBezier(const bezier& bezier) const; void drawLabel(const textlabel_t* textlabel, QPainter* painter) const; + void drawArrow(const QLineF& line, const QColor& color, QPainter* painter) const; + }; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org