Warning, file /office/calligra/libs/flake/KoPathShape_p.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2009 Thomas Zander <zander@kde.org> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Library General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2 of the License, or (at your option) any later version. 0008 * 0009 * This library is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 * Library General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Library General Public License 0015 * along with this library; see the file COPYING.LIB. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 #ifndef KOPATHSHAPEPRIVATE_H 0020 #define KOPATHSHAPEPRIVATE_H 0021 0022 #include "KoTosContainer_p.h" 0023 #include "KoMarkerData.h" 0024 0025 class KoPathShapePrivate : public KoTosContainerPrivate 0026 { 0027 public: 0028 explicit KoPathShapePrivate(KoPathShape *q); 0029 0030 QRectF handleRect(const QPointF &p, qreal radius) const; 0031 /// Applies the viewbox transformation defined in the given element 0032 void applyViewboxTransformation(const KoXmlElement &element); 0033 0034 void map(const QTransform &matrix); 0035 0036 void updateLast(KoPathPoint **lastPoint); 0037 0038 /// closes specified subpath 0039 void closeSubpath(KoSubpath *subpath); 0040 /// close-merges specified subpath 0041 void closeMergeSubpath(KoSubpath *subpath); 0042 0043 /** 0044 * @brief Saves the node types 0045 * 0046 * This is inspired by inkscape and uses the same mechanism as they do. 0047 * The only difference is that they use sodipodi:nodeTypes as element and 0048 * we use calligra:nodeTyes as attribute. 0049 * This attribute contains of a string which has the node type of each point 0050 * in it. The following node types exist: 0051 * 0052 * c corner 0053 * s smooth 0054 * z symmetric 0055 * 0056 * The first point of a path is always of the type c. 0057 * If the path is closed the type of the first point is saved in the last element 0058 * E.g. you have a closed path with 2 points in it. The first one (start/end of path) 0059 * is symmetric and the second one is smooth that will result in the nodeType="czs" 0060 * So if there is a closed sub path the nodeTypes contain one more entry then there 0061 * are points. That is due to the first and the last point of a closed sub path get 0062 * merged into one when they are on the same position. 0063 * 0064 * @return The node types as string 0065 */ 0066 QString nodeTypes() const; 0067 0068 /** 0069 * @brief Loads node types 0070 */ 0071 void loadNodeTypes(const KoXmlElement &element); 0072 0073 /** 0074 * @brief Returns subpath at given index 0075 * @param subpathIndex the index of the subpath to return 0076 * @return subPath on success, or 0 when subpathIndex is out of bounds 0077 */ 0078 KoSubpath *subPath(int subpathIndex) const; 0079 #ifndef NDEBUG 0080 /// \internal 0081 void paintDebug(QPainter &painter); 0082 /** 0083 * @brief print debug information about a the points of the path 0084 */ 0085 void debugPath() const; 0086 #endif 0087 0088 Qt::FillRule fillRule; 0089 0090 Q_DECLARE_PUBLIC(KoPathShape) 0091 0092 KoMarkerData startMarker; 0093 KoMarkerData endMarker; 0094 }; 0095 0096 #endif