[Uml-devel] branches/work/soc-umbrello/umbrello/widgets

Andi Fischer andi.fischer at hispeed.ch
Thu Jul 5 09:40:47 UTC 2012


SVN commit 1304109 by fischer:

QPointF replaced by UMLScenePoint to reduce the diff to trunk.

 M  +6 -6      associationline.cpp  
 M  +12 -13    associationline.h  


--- branches/work/soc-umbrello/umbrello/widgets/associationline.cpp #1304108:1304109
@@ -330,7 +330,7 @@
  * Returns the point with a given index.
  * @return point at given index
  */
-QPointF AssociationLine::point(int index) const
+UMLScenePoint AssociationLine::point(int index) const
 {
     if ((index < 0) | (index > m_points.size() - 1)) {
         uError() << "Index " << index << " out of range [0.." << m_points.size() - 1 << "].";
@@ -344,7 +344,7 @@
  * Sets the point value at given index to \a point.  Also changes
  * the bounding rect appropriately.
  */
-void AssociationLine::setPoint(int index, const QPointF& point)
+void AssociationLine::setPoint(int index, const UMLScenePoint &point)
 {
     if (m_points.at(index) == point) {
         return; // Nothing to change
@@ -357,7 +357,7 @@
 /**
  * Shortcut for point(0).
  */
-QPointF AssociationLine::startPoint() const
+UMLScenePoint AssociationLine::startPoint() const
 {
     return m_points.at(0);
 }
@@ -365,7 +365,7 @@
 /**
  * Shortcut for point(count()-1).
  */
-QPointF AssociationLine::endPoint() const
+UMLScenePoint AssociationLine::endPoint() const
 {
     return m_points.at(m_points.size()-1);
 }
@@ -374,7 +374,7 @@
  * Inserts the passed in \a point at the \a index passed in and
  * recalculates the bounding rect.
  */
-void AssociationLine::insertPoint(int index, const QPointF& point)
+void AssociationLine::insertPoint(int index, const UMLScenePoint &point)
 {
     m_associationWidget->prepareGeometryChange();
     m_points.insert(index, point);
@@ -517,7 +517,7 @@
 /**
  * Sets the start and end points to passed parameters.
  */
-void AssociationLine::setEndPoints(const QPointF& start, const QPointF& end)
+void AssociationLine::setEndPoints(const UMLScenePoint &start, const UMLScenePoint &end)
 {
     int size = m_points.size();
 
--- branches/work/soc-umbrello/umbrello/widgets/associationline.h #1304108:1304109
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2011                                               *
+ *   copyright (C) 2002-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -13,18 +13,17 @@
 
 #include "umlscene.h"
 
-#include <QtGui/QBrush>
-#include <QtGui/QGraphicsObject>
-#include <QtGui/QPen>
+#include <QBrush>
+#include <QGraphicsObject>
+#include <QPen>
 
-// Forward declarations
+// forward declarations
 class AssociationWidget;
 class QDomDocument;
 class QDomElement;
 class UMLWidget;
 class RegionPair;
 
-
 typedef QPair<QPointF, QPointF> SymbolEndPoints;
 
 /**
@@ -112,12 +111,12 @@
         AssociationLine(AssociationWidget *assoc);
         virtual ~AssociationLine();
 
-        QPointF point(int index) const;
-        void setPoint(int index, const QPointF& point);
-        QPointF startPoint() const;
-        QPointF endPoint() const;
+        UMLScenePoint point(int index) const;
+        void setPoint(int index, const UMLScenePoint& point);
+        UMLScenePoint startPoint() const;
+        UMLScenePoint endPoint() const;
 
-        void insertPoint(int index, const QPointF& point);
+        void insertPoint(int index, const UMLScenePoint& point);
         void removePoint(int index);
 
         int count() const;
@@ -125,13 +124,13 @@
 
         void optimizeLinePoints();
 
-        int closestPointIndex(const QPointF& point, qreal delta = AssociationLine::Delta) const;
+        int closestPointIndex(const UMLScenePoint& point, qreal delta = AssociationLine::Delta) const;
         int segmentIndex(const QPointF& point, qreal delta = AssociationLine::Delta) const;
 
         bool isEndPointIndex(int index) const;
         bool isEndSegmentIndex(int index) const;
 
-        void setEndPoints(const QPointF &start, const QPointF &end);
+        void setEndPoints(const UMLScenePoint &start, const UMLScenePoint &end);
 
         bool loadFromXMI(QDomElement &qElement);
         void saveToXMI(QDomDocument &qDoc, QDomElement &qElement);




More information about the umbrello-devel mailing list