|
Krita Source Code Documentation
|
Enumerations | |
| enum | AnchorPosition { TopLeft , Top , TopRight , Left , Center , Right , BottomLeft , Bottom , BottomRight , NoAnchor , NumAnchorPositions } |
| enum | CanvasResource { HotPosition = 1410100299 } |
| enum | CoordinateSystem { UserSpaceOnUse , ObjectBoundingBox } |
| enum | FillType { None , Solid , Gradient , Pattern , MeshGradient } |
| enum | FillVariant { Fill , StrokeFill } |
| enum | MarkerPosition { StartMarker , MidMarker , EndMarker } |
| enum | SelectionHandle { TopMiddleHandle , TopRightHandle , RightMiddleHandle , BottomRightHandle , BottomMiddleHandle , BottomLeftHandle , LeftMiddleHandle , TopLeftHandle , NoHandle } |
| Enum determining which handle is meant, used in KoInteractionTool. More... | |
| enum | SelectionType { FullSelection , StrippedSelection , TopLevelSelection } |
| the selection type for KoSelection::selectedObjects() More... | |
| enum | ShapeSelection { Selected , Unselected , NextUnselected , ShapeOnTop } |
| enum | StyleType { Background , Foreground } |
Functions | |
| KRITAFLAKE_EXPORT QPointF | anchorToPoint (AnchorPosition anchor, const QRectF rect, bool *valid=0) |
| KRITAFLAKE_EXPORT QGradient * | cloneGradient (const QGradient *gradient) |
| clones the given gradient | |
| template<class Policy > | |
| bool | compareShapePropertiesEqual (const QList< KoShape * > shapes) |
| template<class Policy > | |
| bool | compareShapePropertiesEqual (const QList< KoShape * > shapes, const Policy &policy) |
| CoordinateSystem | coordinatesFromString (const QString &value, CoordinateSystem defaultValue) |
| QString | coordinateToString (CoordinateSystem value) |
| KRITAFLAKE_EXPORT QGradient * | mergeGradient (const QGradient *coordsSource, const QGradient *fillSource) |
| template<typename ModifyFunction > | |
| auto | modifyShapesStrokes (QList< KoShape * > shapes, ModifyFunction modifyFunction) -> decltype(modifyFunction(KoShapeStrokeSP()),(KUndo2Command *)(0)) |
| KRITAFLAKE_EXPORT void | resizeShape (KoShape *shape, qreal scaleX, qreal scaleY, const QPointF &absoluteStillPoint, bool useGlobalMode) |
| KRITAFLAKE_EXPORT void | resizeShapeCommon (KoShape *shape, qreal scaleX, qreal scaleY, const QPointF &absoluteStillPoint, bool useGlobalMode, bool usePostScaling, const QTransform &postScalingCoveringTransform) |
| KRITAFLAKE_EXPORT void | scaleShape (KoShape *shape, qreal scaleX, qreal scaleY, const QPointF &absoluteStillPoint, const QTransform &postScalingCoveringTransform) |
| KRITAFLAKE_EXPORT void | scaleShapeGlobal (KoShape *shape, qreal scaleX, qreal scaleY, const QPointF &absoluteStillPoint) |
| KRITAFLAKE_EXPORT Qt::Orientation | significantScaleOrientation (qreal scaleX, qreal scaleY) |
| KRITAFLAKE_EXPORT QPointF | toAbsolute (const QPointF &relative, const QSizeF &size) |
| KRITAFLAKE_EXPORT QPointF | toRelative (const QPointF &absolute, const QSizeF &size) |
Flake reference
| Enumerator | |
|---|---|
| UserSpaceOnUse | |
| ObjectBoundingBox | |
Definition at line 14 of file KoFlakeCoordinateSystem.h.
| enum KoFlake::FillType |
| enum KoFlake::FillVariant |
| Enumerator | |
|---|---|
| Fill | |
| StrokeFill | |
| Enumerator | |
|---|---|
| StartMarker | |
| MidMarker | |
| EndMarker | |
Enum determining which handle is meant, used in KoInteractionTool.
| Enumerator | |
|---|---|
| TopMiddleHandle | The handle that is at the top - center of a selection. |
| TopRightHandle | The handle that is at the top - right of a selection. |
| RightMiddleHandle | The handle that is at the right - center of a selection. |
| BottomRightHandle | The handle that is at the bottom right of a selection. |
| BottomMiddleHandle | The handle that is at the bottom center of a selection. |
| BottomLeftHandle | The handle that is at the bottom left of a selection. |
| LeftMiddleHandle | The handle that is at the left center of a selection. |
| TopLeftHandle | The handle that is at the top left of a selection. |
| NoHandle | Value to indicate no handle. |
Definition at line 55 of file KoFlake.h.
the selection type for KoSelection::selectedObjects()
| Enumerator | |
|---|---|
| FullSelection | Create a list of all user-shapes in the selection. This excludes KoShapeGroup grouping objects that may be selected. |
| StrippedSelection | Create a stripped list, without children if the container is also in the list. |
| TopLevelSelection | Create a list, much like the StrippedSelection, but have the KoShapeGroup instead of all of its children if one is selected. |
Definition at line 48 of file KoFlake.h.
Used to change the behavior of KoShapeManager::shapeAt()
Definition at line 70 of file KoFlake.h.
| enum KoFlake::StyleType |
Used to see which style type is active
| Enumerator | |
|---|---|
| Background | the background / fill style is active |
| Foreground | the foreground / stroke style is active |
| QPointF KoFlake::anchorToPoint | ( | AnchorPosition | anchor, |
| const QRectF | rect, | ||
| bool * | valid = 0 ) |
Definition at line 329 of file KoFlake.cpp.
References KIS_SAFE_ASSERT_RECOVER_NOOP, and KisAlgebra2D::relativeToAbsolute().
| QGradient * KoFlake::cloneGradient | ( | const QGradient * | gradient | ) |
clones the given gradient
Definition at line 17 of file KoFlake.cpp.
| bool KoFlake::compareShapePropertiesEqual | ( | const QList< KoShape * > | shapes | ) |
Definition at line 71 of file KoFlakeUtils.h.
| bool KoFlake::compareShapePropertiesEqual | ( | const QList< KoShape * > | shapes, |
| const Policy & | policy ) |
Definition at line 47 of file KoFlakeUtils.h.
|
inline |
Definition at line 19 of file KoFlakeCoordinateSystem.h.
References ObjectBoundingBox, UserSpaceOnUse, and value().
|
inline |
Definition at line 32 of file KoFlakeCoordinateSystem.h.
References ObjectBoundingBox, and value().
| QGradient * KoFlake::mergeGradient | ( | const QGradient * | coordsSource, |
| const QGradient * | fillSource ) |
Definition at line 54 of file KoFlake.cpp.
References kisDistance().
| auto KoFlake::modifyShapesStrokes | ( | QList< KoShape * > | shapes, |
| ModifyFunction | modifyFunction ) -> decltype(modifyFunction(KoShapeStrokeSP()), (KUndo2Command*)(0)) |
Definition at line 21 of file KoFlakeUtils.h.
References KoShape::stroke(), and toQShared().
| void KoFlake::resizeShape | ( | KoShape * | shape, |
| qreal | scaleX, | ||
| qreal | scaleY, | ||
| const QPointF & | absoluteStillPoint, | ||
| bool | useGlobalMode ) |
The basic idea of such global scaling:
1) We choose two the most distant points of the original outline rect 2) Calculate their expected position if transformed using uniformGlobalTransform 3) NOTE1: we do not transform the entire shape using uniformGlobalTransform, because it will cause massive shearing. We transform only two points and adjust other points using dumb scaling. 4) NOTE2: given that scale transform is much more simpler than uniformGlobalTransform, we cannot guarantee equivalent changes on both globalScaleX and globalScaleY at the same time. We can guarantee only one of them. Therefore we select the most "important" axis and guarantee scale along it. The scale along the other direction is not controlled. 5) After we have the two most distant points, we can just calculate the scale by dividing difference between their expected and original positions. This formula can be derived from equation:
localPoint_i * ScaleMatrix = localPoint_i * UniformGlobalTransform = expectedPoint_i
NOTE: when resizing a shape we expect top-left corner in parent's coordinates to keep it's position.
Definition at line 209 of file KoFlake.cpp.
References KoShape::absoluteTransformation(), KoShape::outlineRect(), KoShape::setSize(), KoShape::setTransformation(), significantScaleOrientation(), KoShape::size(), and KoShape::transformation().
| void KoFlake::resizeShapeCommon | ( | KoShape * | shape, |
| qreal | scaleX, | ||
| qreal | scaleY, | ||
| const QPointF & | absoluteStillPoint, | ||
| bool | useGlobalMode, | ||
| bool | usePostScaling, | ||
| const QTransform & | postScalingCoveringTransform ) |
Definition at line 313 of file KoFlake.cpp.
References resizeShape(), scaleShape(), and scaleShapeGlobal().
| void KoFlake::scaleShape | ( | KoShape * | shape, |
| qreal | scaleX, | ||
| qreal | scaleY, | ||
| const QPointF & | absoluteStillPoint, | ||
| const QTransform & | postScalingCoveringTransform ) |
Definition at line 176 of file KoFlake.cpp.
References KoShape::setTransformation(), and KoShape::transformation().
| void KoFlake::scaleShapeGlobal | ( | KoShape * | shape, |
| qreal | scaleX, | ||
| qreal | scaleY, | ||
| const QPointF & | absoluteStillPoint ) |
Definition at line 192 of file KoFlake.cpp.
References KoShape::absoluteTransformation(), KoShape::setTransformation(), and KoShape::transformation().
| Qt::Orientation KoFlake::significantScaleOrientation | ( | qreal | scaleX, |
| qreal | scaleY ) |
Definition at line 168 of file KoFlake.cpp.
| QPointF KoFlake::toAbsolute | ( | const QPointF & | relative, |
| const QSizeF & | size ) |
Convert relative size to absolute size
| relative | relative position |
| size | for which the absolute position needs to be calculated |
Definition at line 121 of file KoFlake.cpp.
| QPointF KoFlake::toRelative | ( | const QPointF & | absolute, |
| const QSizeF & | size ) |
Convert absolute to relative position
| absolute | absolute position |
| size | for which the relative position needs to be calculated |
Definition at line 115 of file KoFlake.cpp.