Changeset 846 for trunk/src/gui/painting/qpathclipper_p.h
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/painting/qpathclipper_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 88 88 89 89 static bool pathToRect(const QPainterPath &path, QRectF *rect = 0); 90 static QPainterPath intersect(const QPainterPath &path, const QRectF &rect); 90 91 91 92 private: … … 148 149 int second; 149 150 150 qreal angle; 151 qreal invAngle; 152 153 const QBezier *bezier; 154 qreal t0; 155 qreal t1; 151 double angle; 152 double invAngle; 156 153 157 154 int next(Traversal traversal, Direction direction) const; … … 182 179 183 180 struct Segment { 184 Segment(int pathId, int vertexA, int vertexB , int bezierIndex = -1)181 Segment(int pathId, int vertexA, int vertexB) 185 182 : path(pathId) 186 , bezier(bezierIndex)187 183 , va(vertexA) 188 184 , vb(vertexB) … … 192 188 193 189 int path; 194 int bezier;195 190 196 191 // vertices … … 205 200 206 201 207 QPathSegments( );202 QPathSegments(int reserve); 208 203 209 204 void setPath(const QPainterPath &path); … … 216 211 const Segment &segmentAt(int index) const; 217 212 const QLineF lineAt(int index) const; 218 const QBezier *bezierAt(int index) const;219 213 const QRectF &elementBounds(int index) const; 220 214 int pathId(int index) const; … … 231 225 QDataBuffer<QPointF> m_points; 232 226 QDataBuffer<Segment> m_segments; 233 QDataBuffer<QBezier> m_beziers;234 227 QDataBuffer<Intersection> m_intersections; 235 228 … … 272 265 TraversalStatus next(const TraversalStatus &status) const; 273 266 274 int addEdge(const QPointF &a, const QPointF &b , const QBezier *bezier = 0, qreal t0 = 0, qreal t1 = 1);275 int addEdge(int vertexA, int vertexB , const QBezier *bezier = 0, qreal t0 = 0, qreal t1 = 1);267 int addEdge(const QPointF &a, const QPointF &b); 268 int addEdge(int vertexA, int vertexB); 276 269 277 270 bool isInside(qreal x, qreal y) const; … … 285 278 void printNode(int i, FILE *handle); 286 279 287 QBezier bezierFromIndex(int index) const;288 289 280 void removeEdge(int ei); 290 void addBezierEdge(const QBezier *bezier, const QPointF &a, const QPointF &b, qreal alphaA, qreal alphaB, int path);291 void addBezierEdge(const QBezier *bezier, int vertexA, int vertexB, qreal alphaA, qreal alphaB, int path);292 281 293 282 int insert(const QPathVertex &vertex); … … 312 301 , angle(0) 313 302 , invAngle(0) 314 , bezier(0)315 , t0(0)316 , t1(0)317 303 { 318 304 m_next[0][0] = -1; … … 360 346 } 361 347 362 inline QPathSegments::QPathSegments() 348 inline QPathSegments::QPathSegments(int reserve) : 349 m_points(reserve), 350 m_segments(reserve), 351 m_intersections(reserve) 363 352 { 364 353 } … … 394 383 const Segment &segment = m_segments.at(index); 395 384 return QLineF(m_points.at(segment.va), m_points.at(segment.vb)); 396 }397 398 inline const QBezier *QPathSegments::bezierAt(int index) const399 {400 const Segment &segment = m_segments.at(index);401 if (segment.bezier >= 0)402 return &m_beziers.at(segment.bezier);403 else404 return 0;405 385 } 406 386
Note:
See TracChangeset
for help on using the changeset viewer.