|
Krita Source Code Documentation
|
#include <kis_node_shape.h>
Inheritance diagram for KisNodeShape:Classes | |
| struct | Private |
Public Member Functions | |
| QRectF | boundingRect () const override |
| Get the bounding box of the shape. | |
| KisNodeShape (KisNodeSP node) | |
| KisNodeSP | node () |
| void | paint (QPainter &painter) const override |
Paint the shape fill The class extending this one is responsible for painting itself. painter is expected to be preconfigured to work in "document" pixels. | |
| void | setPosition (const QPointF &) override |
| Set the position of the shape in pt. | |
| QSizeF | size () const override |
| Get the size of the shape in pt. | |
| ~KisNodeShape () override | |
Public Member Functions inherited from KoShapeLayer | |
| QRectF | boundingRect () const override |
| Get the bounding box of the shape. | |
| bool | hitTest (const QPointF &position) const override |
| Check if the shape is hit on position. | |
| KoShapeLayer () | |
| The default constructor. | |
| KoShapeLayer (KoShapeContainerModel *model) | |
| void | paintComponent (QPainter &painter) const override |
Public Member Functions inherited from KoShapeContainer | |
| void | addShape (KoShape *shape) |
| bool | inheritsTransform (const KoShape *shape) const |
| bool | isClipped (const KoShape *child) const |
| KoShapeContainer (KoShapeContainerModel *model=0) | |
| KoShapeContainerModel * | model () const |
| void | paint (QPainter &painter) const override |
| reimplemented | |
| Private (const Private &rhs, KoShapeContainer *q) | |
| Private (KoShapeContainer *q) | |
| void | removeShape (KoShape *shape) |
| void | setClipped (const KoShape *child, bool clipping) |
| void | setInheritsTransform (const KoShape *shape, bool inherit) |
| int | shapeCount () const |
| ShapeInterface * | shapeInterface () |
| QList< KoShape * > | shapes () const |
| virtual void | update () const |
| void | update () const override |
| reimplemented | |
| ~KoShapeContainer () override | |
| virtual | ~Private () |
Public Member Functions inherited from KoShape | |
| QRectF | absoluteOutlineRect () const |
| QPointF | absolutePosition (KoFlake::AnchorPosition anchor=KoFlake::Center) const |
| QTransform | absoluteTransformation () const |
| bool | addDependee (KoShape *shape) |
| QString | additionalAttribute (const QString &name) const |
| void | addShapeChangeListener (ShapeChangeListener *listener) |
| KoShapeAnchor * | anchor () const |
| void | applyAbsoluteTransformation (const QTransform &matrix) |
| void | applyTransformation (const QTransform &matrix) |
| virtual QSharedPointer< KoShapeBackground > | background () const |
| virtual ChildZOrderPolicy | childZOrderPolicy () |
| KoClipMask * | clipMask () const |
| Returns the currently set clip mask or 0 if there is no clip mask set. | |
| KoClipPath * | clipPath () const |
| Returns the currently set clip path or 0 if there is no clip path set. | |
| virtual KoShape * | cloneShape () const |
| creates a deep copy of the shape or shape's subtree | |
| KoShape * | cloneShapeAndBakeAbsoluteTransform () const |
creates a deep copy of the shape/shapes tree and bakes the absolute transform of this into the resulting shape. | |
| void | copySettings (const KoShape *shape) |
| QList< KoShape * > | dependees () const |
| Returns list of shapes depending on this shape. | |
| QPointF | documentToShape (const QPointF &point) const |
| Transforms point from document coordinates to shape coordinates. | |
| QRectF | documentToShape (const QRectF &rect) const |
| Transform rect from document coordinates to shape coordinates. | |
| KoFilterEffectStack * | filterEffectStack () const |
| bool | hasAdditionalAttribute (const QString &name) const |
| bool | hasCommonParent (const KoShape *shape) const |
| bool | hasDependee (KoShape *shape) const |
| Returns if the given shape is dependent on this shape. | |
| virtual bool | hasTransparency () const |
| QString | hyperLink () const |
| bool | inheritBackground () const |
| inheritBackground shows if the shape inherits background from its parent | |
| bool | inheritPaintOrder () const |
| inheritPaintOrder | |
| bool | inheritsTransformFromAny (const QList< KoShape * > ancestorsInQuestion) const |
inheritsTransformFromAny checks if the shape inherits transformation from any of the shapes listed in ancestorsInQuestion. The inheritance is checked in recursive way. | |
| bool | inheritStroke () const |
| inheritStroke shows if the shape inherits the stroke from its parent | |
| bool | isContentProtected () const |
| bool | isGeometryProtected () const |
| bool | isPrintable () const |
| bool | isSelectable () const |
| virtual bool | isShapeEditable (bool recursive=true) const |
| checks recursively if the shape or one of its parents is not visible or locked | |
| bool | isVisible (bool recursive=true) const |
| bool | keepAspectRatio () const |
| KoShape () | |
| Constructor. | |
| qreal | minimumHeight () const |
| QString | name () const |
| void | notifyChanged () |
| virtual QPainterPath | outline () const |
| virtual QRectF | outlineRect () const |
| virtual void | paintMarkers (QPainter &painter) const |
| paintStroke paints the shape's markers | |
| virtual QVector< PaintOrder > | paintOrder () const |
| paintOrder | |
| virtual void | paintStroke (QPainter &painter) const |
| paintStroke paints the shape's stroked outline | |
| KoShapeContainer * | parent () const |
| QPointF | position () const |
| Get the position of the shape in pt. | |
| void | removeAdditionalAttribute (const QString &name) |
| void | removeAdditionalStyleAttribute (const char *name) |
| void | removeDependee (KoShape *shape) |
| void | removeShapeChangeListener (ShapeChangeListener *listener) |
| void | rotate (qreal angle) |
| Rotate the shape (relative) | |
| qreal | rotation () const |
| int | runThrough () const |
| void | scale (qreal sx, qreal sy) |
| Scale the shape using the zero-point which is the top-left corner. | |
| void | setAbsolutePosition (const QPointF &newPosition, KoFlake::AnchorPosition anchor=KoFlake::Center) |
| void | setAdditionalAttribute (const QString &name, const QString &value) |
| void | setAdditionalStyleAttribute (const char *name, const QString &value) |
| void | setAnchor (KoShapeAnchor *anchor) |
| virtual void | setBackground (QSharedPointer< KoShapeBackground > background) |
| void | setClipMask (KoClipMask *clipMask) |
| Sets a new clip mask, removing the old one. The mask is owned by the shape. | |
| void | setClipPath (KoClipPath *clipPath) |
| Sets a new clip path, removing the old one. | |
| void | setContentProtected (bool protect) |
| void | setFilterEffectStack (KoFilterEffectStack *filterEffectStack) |
| Sets the new filter effect stack, removing the old one. | |
| void | setGeometryProtected (bool on) |
| void | setHyperLink (const QString &hyperLink) |
| void | setInheritBackground (bool value) |
| setInheritBackground marks a shape as inheriting the background from the parent shape. NOTE: The currently selected background is destroyed. | |
| void | setInheritPaintOrder (bool value) |
| setInheritPaintOrder set inherit paint order. | |
| void | setInheritStroke (bool value) |
| setInheritStroke marks a shape as inheriting the stroke from the parent shape. NOTE: The currently selected stroke is destroyed. | |
| void | setKeepAspectRatio (bool keepAspect) |
| void | setMinimumHeight (qreal height) |
| void | setName (const QString &name) |
| virtual void | setPaintOrder (PaintOrder first, PaintOrder second) |
| setPaintOrder set the paint order. As there's only three entries in any given paintorder, you only need to have the first and second entry to set it. | |
| void | setParent (KoShapeContainer *parent) |
| void | setPrintable (bool on) |
| virtual void | setResolution (qreal xRes, qreal yRes) |
| virtual void | setRunThrough (short int runThrough) |
| void | setSelectable (bool selectable) |
| void | setShadow (KoShapeShadow *shadow) |
| Sets the new shadow, removing the old one. | |
| void | setShapeId (const QString &id) |
| virtual void | setSize (const QSizeF &size) |
| Resize the shape. | |
| virtual void | setStroke (KoShapeStrokeModelSP stroke) |
| void | setTextRunAroundContour (TextRunAroundContour contour) |
| void | setTextRunAroundDistanceBottom (qreal distance) |
| void | setTextRunAroundDistanceLeft (qreal distance) |
| void | setTextRunAroundDistanceRight (qreal distance) |
| void | setTextRunAroundDistanceTop (qreal distance) |
| void | setTextRunAroundSide (TextRunAroundSide side, RunThroughLevel runThrough=Background) |
| void | setTextRunAroundThreshold (qreal threshold) |
| void | setToolDelegates (const QSet< KoShape * > &delegates) |
| void | setTransformation (const QTransform &matrix) |
| void | setTransparency (qreal transparency) |
| void | setUserData (KoShapeUserData *userData) |
| void | setVisible (bool on) |
| void | setZIndex (qint16 zIndex) |
| KoShapeShadow * | shadow () const |
| Returns the currently set shadow or 0 if there is no shadow set. | |
| virtual QPainterPath | shadowOutline () const |
| QString | shapeId () const |
| QPointF | shapeToDocument (const QPointF &point) const |
| Transforms point from shape coordinates to document coordinates. | |
| QRectF | shapeToDocument (const QRectF &rect) const |
| Transforms rect from shape coordinates to document coordinates. | |
| void | shear (qreal sx, qreal sy) |
| Shear the shape The shape will be sheared using the zero-point which is the top-left corner. | |
| virtual KoSnapData | snapData () const |
| Returns additional snap data the shape wants to have snapping to. | |
| virtual KoShapeStrokeModelSP | stroke () const |
| KoInsets | strokeInsets () const |
| TextRunAroundContour | textRunAroundContour () const |
| qreal | textRunAroundDistanceBottom () const |
| qreal | textRunAroundDistanceLeft () const |
| qreal | textRunAroundDistanceRight () const |
| qreal | textRunAroundDistanceTop () const |
| TextRunAroundSide | textRunAroundSide () const |
| qreal | textRunAroundThreshold () const |
| QSet< KoShape * > | toolDelegates () const |
| QTransform | transformation () const |
| Returns the shapes local transformation matrix. | |
| qreal | transparency (bool recursive=false) const |
| virtual void | updateAbsolute (const QRectF &rect) const |
| KoShapeUserData * | userData () const |
| virtual void | waitUntilReady (bool asynchronous=true) const |
| qint16 | zIndex () const |
| virtual | ~KoShape () |
| Destructor. | |
Private Slots | |
| void | editabilityChanged () |
Private Member Functions | |
| bool | checkIfDescendant (KoShapeLayer *activeLayer) |
Private Attributes | |
| Private *const | m_d |
A KisNodeShape is a flake wrapper around Krita nodes. It is used for dealing with currently active node for tools.
Definition at line 24 of file kis_node_shape.h.
| KisNodeShape::KisNodeShape | ( | KisNodeSP | node | ) |
Definition at line 28 of file kis_node_shape.cpp.
References connect(), editabilityChanged(), KIS_NODE_SHAPE_ID, m_d, KisNodeShape::Private::node, node(), KoShape::setSelectable(), and KoShape::setShapeId().
|
override |
Definition at line 43 of file kis_node_shape.cpp.
References KoToolManager::activeCanvasController(), KoSelection::activeLayer(), KoCanvasController::canvas(), KoToolManager::instance(), m_d, KoCanvasBase::selectedShapesProxy(), KoSelectedShapesProxy::selection(), and KoSelection::setActiveLayer().
|
overridevirtual |
Get the bounding box of the shape.
This includes the line width and the shadow of the shape
Reimplemented from KoShape.
Definition at line 119 of file kis_node_shape.cpp.
|
private |
Definition at line 64 of file kis_node_shape.cpp.
References KoShape::parent().
|
privateslot |
Editability of a child depends on the editability of its parent. So when we change one's editability, we need to search for active children and reactivate them
Definition at line 76 of file kis_node_shape.cpp.
References KoToolManager::activeCanvasController(), KoSelection::activeLayer(), KoCanvasController::canvas(), checkIfDescendant(), KisSharedPtr< T >::data(), KoToolManager::instance(), KisBaseNode::isEditable(), KIS_SAFE_ASSERT_RECOVER, m_d, KisNodeShape::Private::node, node(), KoCanvasBase::selectedShapesProxy(), KoSelectedShapesProxy::selection(), KoSelection::setActiveLayer(), KoShape::setGeometryProtected(), and KoShapeContainer::shapes().
| KisNodeSP KisNodeShape::node | ( | ) |
Definition at line 59 of file kis_node_shape.cpp.
References m_d, and KisNodeShape::Private::node.
|
overridevirtual |
Paint the shape fill The class extending this one is responsible for painting itself. painter is expected to be preconfigured to work in "document" pixels.
| painter | used for painting the shape |
Implements KoShape.
Definition at line 128 of file kis_node_shape.cpp.
|
overridevirtual |
Set the position of the shape in pt.
| position | the new position of the shape |
Reimplemented from KoShape.
Definition at line 124 of file kis_node_shape.cpp.
|
overridevirtual |
Get the size of the shape in pt.
The size is in shape coordinates.
Reimplemented from KoShape.
Definition at line 114 of file kis_node_shape.cpp.
References boundingRect().
|
private |
Definition at line 47 of file kis_node_shape.h.