Krita Source Code Documentation
Loading...
Searching...
No Matches
KisShapeLayer Class Reference

#include <kis_shape_layer.h>

+ Inheritance diagram for KisShapeLayer:

Classes

struct  Private
 

Signals

void currentLayerChanged (const KoShapeLayer *layer)
 
void selectionChanged ()
 
void sigMoveShapes (const QPointF &diff)
 
- Signals inherited from KisNode
void sigNodeChangedInternal ()
 
- Signals inherited from KisBaseNode
void keyframeChannelAdded (KisKeyframeChannel *channel)
 
void opacityChanged (quint8 value)
 

Public Member Functions

bool accept (KisNodeVisitor &) override
 
void accept (KisProcessingVisitor &visitor, KisUndoAdapter *undoAdapter) override
 
bool allowAsChild (KisNodeSP) const override
 
bool antialiased () const
 
KisNodeSP clone () const override
 
KUndo2CommandconvertTo (const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags()) override
 
KisLayerSP createMergedLayerTemplate (KisLayerSP prevLayer) override
 
KUndo2Commandcrop (const QRect &rect) override
 
void fillMergedLayerTemplate (KisLayerSP dstLayer, KisLayerSP prevLayer, bool skipPaintingThisLayer) override
 
void forceUpdateHiddenAreaOnOriginal () override
 
void forceUpdateTimedNode () override
 
bool hasPendingTimedUpdates () const override
 
QIcon icon () const override
 
bool isSelectable () const
 
bool isShapeEditable (bool recursive) const override
 checks recursively if the shape or one of its parents is not visible or locked
 
 KisShapeLayer (const KisShapeLayer &_rhs)
 
 KisShapeLayer (const KisShapeLayer &_rhs, KoShapeControllerBase *controller)
 
 KisShapeLayer (const KisShapeLayer &_rhs, KoShapeControllerBase *controller, std::function< KisShapeLayerCanvasBase *()> canvasFactory)
 
 KisShapeLayer (const KisShapeLayer &baseTemplate, const QList< KoShape * > &newShapes)
 
 KisShapeLayer (KoShapeControllerBase *shapeController, KisImageWSP image, const QString &name, quint8 opacity)
 
bool loadLayer (KoStore *store, QStringList *warnings=0)
 
KisPaintDeviceSP original () const override
 
KisPaintDeviceSP paintDevice () const override
 
void resetCache (const KoColorSpace *colorSpace) override
 
bool saveLayer (KoStore *store) const
 
KisBaseNode::PropertyList sectionModelProperties () const override
 
KoSelectedShapesProxyselectedShapesProxy ()
 selectedShapesProxy
 
void setAntialiased (const bool antialiased)
 
void setImage (KisImageWSP image) override
 
void setParent (KoShapeContainer *parent)
 
KUndo2CommandsetProfile (const KoColorProfile *profile) override
 
void setSectionModelProperties (const KisBaseNode::PropertyList &properties) override
 
void setUserLocked (bool value) override
 
void setVisible (bool visible, bool isLoading=false) override
 
void setX (qint32) override
 
void setY (qint32) override
 
KoShapeManagershapeManager () const
 
QRect theoreticalBoundingRect () const override
 
KUndo2Commandtransform (const QTransform &transform) override
 
KisLayerSP tryCreateInternallyMergedLayerFromMutipleLayers (QList< KisLayerSP > layers) override
 
bool visible (bool recursive=false) const override
 
qint32 x () const override
 
qint32 y () const override
 
 ~KisShapeLayer () override
 
- Public Member Functions inherited from KisExternalLayer
 KisExternalLayer (KisImageWSP image, const QString &name, quint8 opacity)
 
virtual bool supportsPerspectiveTransform () const
 
- Public Member Functions inherited from KisLayer
bool alphaChannelDisabled () const
 
void buildProjectionUpToNode (KisPaintDeviceSP projection, KisNodeSP lastNode, const QRect &rect)
 
QBitArray & channelFlags () const
 
KisFilterMaskSP colorOverlayMask () const
 
const KoColorSpacecolorSpace () const override
 returns the image's colorSpace or null, if there is no image
 
const KoCompositeOpcompositeOp () const override
 returns the layer's composite op for the colorspace of the layer's parent.
 
QImage createThumbnail (qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode, KisThumbnailBoundsMode boundsMode) override
 
QImage createThumbnailForFrame (qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode, KisThumbnailBoundsMode boundsMode) override
 
void disableAlphaChannel (bool disable)
 
QList< KisEffectMaskSPeffectMasks () const
 
QList< KisEffectMaskSPeffectMasks (KisNodeSP lastNode) const
 
QRect exactBounds () const override
 
QRect extent () const override
 
bool hasClones () const
 
bool hasEffectMasks () const
 
virtual KisLayerProjectionPlaneSP internalProjectionPlane () const
 
 KisLayer (const KisLayer &rhs)
 
 KisLayer (KisImageWSP image, const QString &name, quint8 opacity)
 
KisPSDLayerStyleSP layerStyle () const
 
QRect looseUserVisibleBounds () const
 
KisMetaData::StoremetaData ()
 
virtual bool needProjection () const
 
void notifyChildMaskChanged ()
 
KisLayerSP parentLayer () const
 
QRect partialChangeRect (KisNodeSP lastNode, const QRect &rect)
 
 Private (KisLayer *q)
 
KisPaintDeviceSP projection () const override
 
KisAbstractProjectionPlaneSP projectionPlane () const override
 
void registerClone (KisCloneLayerWSP clone)
 
const QList< KisCloneLayerWSPregisteredClones () const
 
virtual KisSelectionSP selection () const
 
virtual KisSelectionMaskSP selectionMask () const
 
virtual void setChannelFlags (const QBitArray &channelFlags)
 
void setLayerStyle (KisPSDLayerStyleSP layerStyle)
 
void setTemporary (bool t)
 
bool temporary () const
 
int thumbnailSeqNo () const override
 
QRect tightUserVisibleBounds () const
 
void unregisterClone (KisCloneLayerWSP clone)
 
void updateClones (const QRect &rect, bool dontInvalidateFrames)
 
 ~KisLayer () override
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 
- Public Member Functions inherited from KisNode
KisNodeSP at (quint32 index) const
 
KisBusyProgressIndicatorbusyProgressIndicator () const
 
quint32 childCount () const
 
QList< KisNodeSPchildNodes (const QStringList &nodeTypes, const KoProperties &properties) const
 
const KisNodefindSymmetricClone (const KisNode *srcRoot, const KisNode *dstRoot, const KisNode *srcTarget)
 
KisNodeSP firstChild () const
 
virtual KisPaintDeviceList getLodCapableDevices () const
 
KisNodeGraphListenergraphListener () const
 
int graphSequenceNumber () const
 
void handleKeyframeChannelFrameAboutToBeRemoved (const KisKeyframeChannel *channel, int time)
 
virtual void handleKeyframeChannelFrameAdded (const KisKeyframeChannel *channel, int time)
 
virtual void handleKeyframeChannelFrameChange (const KisKeyframeChannel *channel, int time)
 
void handleKeyframeChannelFrameHasBeenRemoved (const KisKeyframeChannel *channel, int time)
 
KisFrameChangeUpdateRecipe handleKeyframeChannelUpdateImpl (const KisKeyframeChannel *channel, int time)
 
int index (const KisNodeSP node) const
 
void invalidateFrames (const KisTimeSpan &range, const QRect &rect)
 
 KisNode (const KisNode &rhs)
 
 KisNode (KisImageWSP image)
 
KisNodeSP lastChild () const
 
KisNodeSP nextSibling () const
 
KisNodeProgressProxynodeProgressProxy () const
 
KisNodeSP parent () const
 
KisNodeSP prevSibling () const
 
 Private (KisNode *node)
 
void processDuplicatedClones (const KisNode *srcDuplicationRoot, const KisNode *dstDuplicationRoot, KisNode *node)
 
virtual KisProjectionLeafSP projectionLeaf () const
 
void requestTimeSwitch (int time)
 
virtual void setDirty ()
 
void setDirty (const KisRegion &region)
 
void setDirty (const QRect &rect)
 
virtual void setDirty (const QVector< QRect > &rects)
 
void setDirtyDontResetAnimationCache ()
 
void setDirtyDontResetAnimationCache (const QRect &rect)
 
void setDirtyDontResetAnimationCache (const QVector< QRect > &rects)
 setDirtyDontResetAnimationCache does almost the same thing as usual setDirty() call, but doesn't reset the animation cache (since onion skins are not used when rendering animation.
 
void setGraphListener (KisNodeGraphListener *graphListener)
 
virtual void syncLodCache ()
 
 ~KisNode () override
 
- Public Member Functions inherited from KisBaseNode
bool belongsToIsolatedGroup () const
 
bool check (const KoProperties &properties) const
 
bool collapsed () const
 
int colorLabelIndex () const
 
virtual KisPaintDeviceSP colorSampleSourceDevice () const
 
const QString & compositeOpId () const
 
QImage createPreferredThumbnail (qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio)
 
QImage createPreferredThumbnailForFrame (qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio)
 
void enableAnimation ()
 
KisKeyframeChannelgetKeyframeChannel (const QString &id) const
 
KisKeyframeChannelgetKeyframeChannel (const QString &id, bool create)
 
bool hasEditablePaintDevice () const
 
KisImageWSP image () const
 
bool isAnimated () const
 
bool isEditable (bool checkVisibility=true) const
 
virtual bool isFakeNode () const
 
bool isIsolatedRoot () const
 
bool isPinnedToTimeline () const
 
QMap< QString, KisKeyframeChannel * > keyframeChannels () const
 
 KisBaseNode (const KisBaseNode &rhs)
 
 KisBaseNode (KisImageWSP image)
 
void mergeNodeProperties (const KoProperties &properties)
 
QString name () const
 
const KoPropertiesnodeProperties () const
 
quint8 opacity () const
 
quint8 percentOpacity () const
 
KisThumbnailBoundsMode preferredThumbnailBoundsMode () const
 
 Private (const Private &rhs)
 
 Private (KisImageWSP p_image)
 
void setCollapsed (bool collapsed)
 
void setColorLabelIndex (int index)
 
void setCompositeOpId (const QString &compositeOpId)
 
void setName (const QString &name)
 
void setNodeProperty (const QString &name, const QVariant &value)
 
void setOpacity (quint8 val)
 
void setPercentOpacity (quint8 val)
 
void setPinnedToTimeline (bool pinned)
 
void setPreferredThumbnailBoundsMode (KisThumbnailBoundsMode value) const
 
void setUuid (const QUuid &id)
 
virtual bool supportsKeyframeChannel (const QString &id)
 
bool supportsLodMoves () const
 
virtual bool supportsLodPainting () const
 
virtual void updateSettings ()
 
bool userLocked () const
 
QUuid uuid () const
 
 ~KisBaseNode () override
 
- Public Member Functions inherited from KisShared
bool deref ()
 
bool ref ()
 
int refCount ()
 
QAtomicInt * sharedWeakReference ()
 
- 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)
 
KoShapeContainerModelmodel () 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
 
ShapeInterfaceshapeInterface ()
 
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)
 
KoShapeAnchoranchor () const
 
void applyAbsoluteTransformation (const QTransform &matrix)
 
void applyTransformation (const QTransform &matrix)
 
virtual QSharedPointer< KoShapeBackgroundbackground () const
 
virtual ChildZOrderPolicy childZOrderPolicy ()
 
KoClipMaskclipMask () const
 Returns the currently set clip mask or 0 if there is no clip mask set.
 
KoClipPathclipPath () const
 Returns the currently set clip path or 0 if there is no clip path set.
 
virtual KoShapecloneShape () const
 creates a deep copy of the shape or shape's subtree
 
KoShapecloneShapeAndBakeAbsoluteTransform () 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.
 
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
 
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< PaintOrderpaintOrder () const
 paintOrder
 
virtual void paintStroke (QPainter &painter) const
 paintStroke paints the shape's stroked outline
 
KoShapeContainerparent () 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
 
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 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)
 
virtual void setPosition (const QPointF &position)
 Set the position of the shape in pt.
 
void setPrintable (bool on)
 
virtual void setResolution (qreal xRes, qreal yRes)
 
void setSelectable (bool selectable)
 
void setShapeId (const QString &id)
 
virtual void setSize (const QSizeF &size)
 Resize the shape.
 
virtual void setStroke (KoShapeStrokeModelSP stroke)
 
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)
 
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 QSizeF size () const
 Get the size of the shape in pt.
 
virtual KoSnapData snapData () const
 Returns additional snap data the shape wants to have snapping to.
 
virtual KoShapeStrokeModelSP stroke () const
 
KoInsets strokeInsets () 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
 
KoShapeUserDatauserData () const
 
virtual void waitUntilReady (bool asynchronous=true) const
 
qint16 zIndex () const
 
virtual ~KoShape ()
 Destructor.
 
- Public Member Functions inherited from KisDelayedUpdateNodeInterface
virtual ~KisDelayedUpdateNodeInterface ()
 
- Public Member Functions inherited from KisCroppedOriginalLayerInterface
virtual ~KisCroppedOriginalLayerInterface ()
 

Static Public Member Functions

static QList< KoShape * > createShapesFromSvg (QIODevice *device, const QString &baseXmlDir, const QRectF &rectInPixels, qreal resolutionPPI, KoDocumentResourceManager *resourceManager, bool loadingFromKra, QSizeF *fragmentSize, QStringList *warnings=0, QStringList *errors=0)
 
static bool saveShapesToStore (KoStore *store, QList< KoShape * > shapes, const QSizeF &sizeInPt)
 
- Static Public Member Functions inherited from KoShape
static QRectF absoluteOutlineRect (const QList< KoShape * > &shapes)
 
static QRectF boundingRect (const QList< KoShape * > &shapes)
 
static bool compareShapeZIndex (KoShape *s1, KoShape *s2)
 
static KisHandlePainterHelper createHandlePainterHelperDocument (QPainter *painter, KoShape *shape, qreal handleRadius, int decorationThickness)
 
static KisHandlePainterHelper createHandlePainterHelperView (QPainter *painter, KoShape *shape, const KoViewConverter &converter, qreal handleRadius=0.0, int decorationThickness=1)
 
static QVector< PaintOrderdefaultPaintOrder ()
 default paint order as per SVG specification
 
static QList< KoShape * > linearizeSubtree (const QList< KoShape * > &shapes)
 
static QList< KoShape * > linearizeSubtreeSorted (const QList< KoShape * > &shapes)
 

Protected Member Functions

KisShapeLayerCanvasBasecanvas () const
 
const KoViewConverterconverter () const
 
bool isVisible (bool recursive=true) const
 
 KisShapeLayer (KoShapeControllerBase *shapeController, KisImageWSP image, const QString &name, quint8 opacity, std::function< KisShapeLayerCanvasBase *()> canvasFactory)
 
bool loadSvg (QIODevice *device, const QString &baseXmlDir, QStringList *warnings=0)
 
KoShapeControllerBaseshapeController () const
 
- Protected Member Functions inherited from KisLayer
virtual QRect amortizedProjectionRectForCleanupInChangePass () const
 
QRect applyMasks (const KisPaintDeviceSP source, KisPaintDeviceSP destination, const QRect &requestedRect, KisNodeSP filthyNode, KisNodeSP lastNode, KisRenderPassFlags flags) const
 
bool canMergeAndKeepBlendOptions (KisLayerSP otherLayer)
 
QRect changeRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const override
 
void childNodeChanged (KisNodeSP changedChildNode) override
 
virtual void copyOriginalToProjection (const KisPaintDeviceSP original, KisPaintDeviceSP projection, const QRect &rect) const
 
virtual QRect incomingChangeRect (const QRect &rect) const
 
QRect masksChangeRect (const QList< KisEffectMaskSP > &masks, const QRect &requestedRect, bool &rectVariesFlag) const
 
QRect masksNeedRect (const QList< KisEffectMaskSP > &masks, const QRect &changeRect, QStack< QRect > &applyRects, bool &rectVariesFlag) const
 
QRect needRectForOriginal (const QRect &rect) const
 
virtual QRect outgoingChangeRect (const QRect &rect) const
 
QList< KisEffectMaskSPsearchEffectMasks (KisNodeSP lastNode) const
 
QRect updateProjection (const QRect &rect, KisNodeSP filthyNode, KisRenderPassFlags flags)
 
- Protected Member Functions inherited from KisNode
virtual QRect accessRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const
 
void addKeyframeChannel (KisKeyframeChannel *channel) override
 
void baseNodeChangedCallback () override
 
void baseNodeCollapsedChangedCallback () override
 
void baseNodeInvalidateAllFramesCallback () override
 
virtual KisFrameChangeUpdateRecipe handleKeyframeChannelFrameAboutToBeRemovedImpl (const KisKeyframeChannel *channel, int time)
 
virtual QRect needRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const
 
void notifyParentVisibilityChanged (bool value) override
 
KisBaseNodeSP parentCallback () const override
 
- Protected Member Functions inherited from KisBaseNode
virtual KisKeyframeChannelrequestKeyframeChannel (const QString &id)
 
void setSupportsLodMoves (bool value)
 
- Protected Member Functions inherited from KisShared
 KisShared ()
 
 ~KisShared ()
 
- Protected Member Functions inherited from KoShapeContainer
 KoShapeContainer (const KoShapeContainer &rhs)
 
void setModel (KoShapeContainerModel *model)
 
void setModelInit (KoShapeContainerModel *model)
 
void shapeChanged (ChangeType type, KoShape *shape=0) override
 
virtual void shapeCountChanged ()
 
- Protected Member Functions inherited from KoShape
 KoShape (const KoShape &rhs)
 
QList< ShapeChangeListener * > listeners () const
 
void setSizeImpl (const QSizeF &size) const
 
void shapeChangedPriv (KoShape::ChangeType type)
 
QTransform transform () const
 return the current matrix that contains the rotation/scale/position of this shape
 

Private Slots

void slotImageResolutionChanged ()
 
void slotMoveShapes (const QPointF &diff)
 
void slotTransformShapes (const QTransform &transform)
 

Private Member Functions

void initShapeLayerImpl (KoShapeControllerBase *controller, KisShapeLayerCanvasBase *overrideCanvas)
 
QList< KoShape * > shapesToBeTransformed ()
 

Private Attributes

Private *const m_d
 

Friends

class ShapeLayerContainerModel
 
class TransformShapeLayerDeferred
 

Additional Inherited Members

- Public Types inherited from KisNode
enum  PositionToFilthy { N_ABOVE_FILTHY = 0x08 , N_FILTHY_PROJECTION = 0x20 , N_FILTHY = 0x40 , N_BELOW_FILTHY = 0x80 }
 
- Public Types inherited from KisBaseNode
typedef QList< PropertyPropertyList
 
- Public Types inherited from KoShape
enum  ChangeType {
  PositionChanged , RotationChanged , ScaleChanged , ShearChanged ,
  SizeChanged , GenericMatrixChange , KeepAspectRatioChange , ParentChanged ,
  Deleted , StrokeChanged , BackgroundChanged , BorderChanged ,
  ParameterChanged , ContentChanged , TextContourMarginChanged , ChildChanged ,
  ConnectionPointChanged , ClipPathChanged , ClipMaskChanged , TransparencyChanged
}
 Used by shapeChanged() to select which change was made. More...
 
enum  ChildZOrderPolicy { ChildZDefault , ChildZParentChild = ChildZDefault , ChildZPassThrough }
 Used by compareShapeZIndex() to order shapes. More...
 
enum  PaintOrder { Fill , Stroke , Markers }
 
- Public Attributes inherited from KisLayer
QBitArray channelFlags
 
KisCloneLayersList clonesList
 
KisPSDLayerStyleSP layerStyle
 
KisLayerStyleProjectionPlaneSP layerStyleProjectionPlane
 
KisLayerMasksCache masksCache
 
KisMetaData::StoremetaDataStore {nullptr}
 
KisLayerProjectionPlaneSP projectionPlane
 
KisSafeNodeProjectionStoreSP safeProjection
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 
- Public Attributes inherited from KisNode
KisBusyProgressIndicatorbusyProgressIndicator
 
std::optional< KisFrameChangeUpdateRecipeframeRemovalUpdateRecipe
 
KisNodeGraphListenergraphListener
 
KisNodeProgressProxynodeProgressProxy
 
KisSafeReadNodeList nodes
 
QReadWriteLock nodeSubgraphLock
 
KisNodeWSP parent
 
KisProjectionLeafSP projectionLeaf
 
- Public Attributes inherited from KisBaseNode
bool animated {false}
 
bool collapsed {false}
 
QString compositeOp
 
KisBaseNode::Property hack_visible
 
QUuid id
 
KisImageWSP image
 
QMap< QString, KisKeyframeChannel * > keyframeChannels
 
KisAnimatedOpacityProperty opacityProperty
 
bool pinnedToTimeline {false}
 
KoProperties properties
 
bool supportsLodMoves {false}
 
KisThumbnailBoundsMode thumbnailBoundsMode { KisThumbnailBoundsMode::Precise }
 
- Public Attributes inherited from KoShapeContainer
KoShapeContainerModelmodel
 
KoShapeContainer::ShapeInterface shapeInterface
 
- Static Public Attributes inherited from KoShape
static const qint16 maxZIndex = std::numeric_limits<qint16>::max()
 
static const qint16 minZIndex = std::numeric_limits<qint16>::min()
 

Detailed Description

A KisShapeLayer contains any number of non-krita flakes, such as path shapes, text shapes and anything else people come up with.

The KisShapeLayer has a shapemanager and a canvas of its own. The canvas paints onto the projection, and the projection is what we render in Krita. This means that no matter how many views you have, you cannot have a different view on your shapes per view.

XXX: what about removing shapes?

Definition at line 43 of file kis_shape_layer.h.

Constructor & Destructor Documentation

◆ KisShapeLayer() [1/6]

KisShapeLayer::KisShapeLayer ( KoShapeControllerBase * shapeController,
KisImageWSP image,
const QString & name,
quint8 opacity )

Definition at line 143 of file kis_shape_layer.cc.

147 : KisShapeLayer(controller, image, name, opacity,
148 [&] () { return new KisShapeLayerCanvas(image->colorSpace(), new KisDefaultBounds(image), this);})
149{
150}
const KoColorSpace * colorSpace() const
KisShapeLayer(KoShapeControllerBase *shapeController, KisImageWSP image, const QString &name, quint8 opacity)
QString name() const
Definition KoShape.cpp:955
KisImageWSP image
quint8 opacity() const

References KisImage::colorSpace(), and KisBaseNode::image.

◆ KisShapeLayer() [2/6]

KisShapeLayer::KisShapeLayer ( const KisShapeLayer & _rhs)

Definition at line 152 of file kis_shape_layer.cc.

153 : KisShapeLayer(rhs,
154 rhs.m_d->controller)
155{
156}

◆ KisShapeLayer() [3/6]

KisShapeLayer::KisShapeLayer ( const KisShapeLayer & _rhs,
KoShapeControllerBase * controller )

Definition at line 158 of file kis_shape_layer.cc.

159 : KisShapeLayer(rhs,
160 controller,
161 [&] () {
162 const KisShapeLayerCanvas* shapeLayerCanvas = dynamic_cast<const KisShapeLayerCanvas*>(rhs.m_d->canvas);
163 KIS_ASSERT(shapeLayerCanvas);
164 return new KisShapeLayerCanvas(*shapeLayerCanvas, this);})
165{
166}
#define KIS_ASSERT(cond)
Definition kis_assert.h:33

References KisShapeLayer::Private::canvas, KIS_ASSERT, and m_d.

◆ KisShapeLayer() [4/6]

KisShapeLayer::KisShapeLayer ( const KisShapeLayer & _rhs,
KoShapeControllerBase * controller,
std::function< KisShapeLayerCanvasBase *()> canvasFactory )

The transformations of the added shapes are automatically merged into the transformation of the layer, so we should apply this extra transform separately

Definition at line 168 of file kis_shape_layer.cc.

170 : KisExternalLayer(_rhs)
171 , KoShapeLayer(new ShapeLayerContainerModel(this)) //no _rhs here otherwise both layer have the same KoShapeContainerModel
172 , m_d(new Private())
173{
174 initShapeLayerImpl(controller, canvasFactory());
176
181 const QTransform thisInvertedTransform = this->absoluteTransformation().inverted();
182
184
185 Q_FOREACH (KoShape *shape, _rhs.shapes()) {
186 KoShape *clonedShape = shape->cloneShape();
187 KIS_SAFE_ASSERT_RECOVER(clonedShape) { continue; }
188 clonedShape->setTransformation(shape->absoluteTransformation() * thisInvertedTransform);
189 addShape(clonedShape);
190 }
191
193}
KisExternalLayer(KisImageWSP image, const QString &name, quint8 opacity)
KoShapeManager * shapeManager() const override
Private *const m_d
void initShapeLayerImpl(KoShapeControllerBase *controller, KisShapeLayerCanvasBase *overrideCanvas)
friend class ShapeLayerContainerModel
QList< KoShape * > shapes() const
void addShape(KoShape *shape)
KoShapeLayer()
The default constructor.
void setUpdatesBlocked(bool value)
QTransform absoluteTransformation() const
Definition KoShape.cpp:335
void setTransformation(const QTransform &matrix)
Definition KoShape.cpp:374
virtual KoShape * cloneShape() const
creates a deep copy of the shape or shape's subtree
Definition KoShape.cpp:172
#define KIS_SAFE_ASSERT_RECOVER(cond)
Definition kis_assert.h:126
KisShapeLayerCanvasBase * canvas

References KoShape::absoluteTransformation(), KoShapeContainer::addShape(), KisShapeLayer::Private::canvas, KoShape::cloneShape(), initShapeLayerImpl(), KisShapeLayer::Private::isAntialiased, KIS_SAFE_ASSERT_RECOVER, m_d, KoShape::setTransformation(), KoShapeManager::setUpdatesBlocked(), KisShapeLayerCanvasBase::shapeManager(), and KoShapeContainer::shapes().

◆ KisShapeLayer() [5/6]

KisShapeLayer::KisShapeLayer ( const KisShapeLayer & baseTemplate,
const QList< KoShape * > & newShapes )

Merge constructor

Creates a new layer as a merge of two existing layers. The shapes of baseTemplate are not used. You need to add them into newShapes to be used in the final layer.

newShapes are the shapes used in the new shape layer, they should be z-order sorted homogenized externally before calling this constructor

With current implementation this matrix will always be an identity, because we do not copy the transformation from any of the source layers. But we should handle this anyway, to not be caught by this in the future.

Definition at line 195 of file kis_shape_layer.cc.

196 : KisExternalLayer(baseTemplate)
197 , KoShapeLayer(new ShapeLayerContainerModel(this)) //no _merge here otherwise both layer have the same KoShapeContainerModel
198 , m_d(new Private())
199{
200 // Make sure our new layer is visible otherwise the shapes cannot be painted.
201 setVisible(true);
202
203 m_d->isAntialiased = baseTemplate.m_d->isAntialiased;
204
205 const KisShapeLayerCanvas* shapeLayerCanvas = dynamic_cast<const KisShapeLayerCanvas*>(baseTemplate.canvas());
206 KIS_ASSERT(shapeLayerCanvas);
207 initShapeLayerImpl(baseTemplate.m_d->controller, new KisShapeLayerCanvas(*shapeLayerCanvas, this));
208
214 const QTransform thisInvertedTransform = this->absoluteTransformation().inverted();
215
216 QList<KoShape *> clonedShapes;
217
218 // copy all the new shapes; we expect them to be sorted and homogenized
219
220 const bool isSorted = std::is_sorted(newShapes.begin(), newShapes.end(), KoShape::compareShapeZIndex);
222
223 Q_FOREACH (KoShape *shape, newShapes) {
224 KoShape *clonedShape = shape->cloneShape();
225 KIS_SAFE_ASSERT_RECOVER(clonedShape) { continue; }
226 clonedShape->setTransformation(shape->absoluteTransformation() * thisInvertedTransform);
227 clonedShapes.append(clonedShape);
228 }
229
230 Q_FOREACH (KoShape *shape, clonedShapes) {
231 addShape(shape);
232 }
233}
void setVisible(bool visible, bool isLoading=false) override
KisShapeLayerCanvasBase * canvas() const
static bool compareShapeZIndex(KoShape *s1, KoShape *s2)
Definition KoShape.cpp:393
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130
KoShapeControllerBase * controller

References KoShape::absoluteTransformation(), KoShapeContainer::addShape(), canvas(), KoShape::cloneShape(), KoShape::compareShapeZIndex(), KisShapeLayer::Private::controller, initShapeLayerImpl(), KisShapeLayer::Private::isAntialiased, KIS_ASSERT, KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, KoShape::setTransformation(), and setVisible().

◆ ~KisShapeLayer()

KisShapeLayer::~KisShapeLayer ( )
override

Small hack alert: we should avoid updates on shape deletion

Definition at line 247 of file kis_shape_layer.cc.

248{
253
254 Q_FOREACH (KoShape *shape, shapes()) {
255 shape->setParent(0);
256 delete shape;
257 }
258
259 delete m_d->canvas;
260 delete m_d;
261}
void setParent(KoShapeContainer *parent)
Definition KoShape.cpp:464

References KisShapeLayer::Private::canvas, m_d, KisShapeLayerCanvasBase::prepareForDestroying(), KoShape::setParent(), and KoShapeContainer::shapes().

◆ KisShapeLayer() [6/6]

KisShapeLayer::KisShapeLayer ( KoShapeControllerBase * shapeController,
KisImageWSP image,
const QString & name,
quint8 opacity,
std::function< KisShapeLayerCanvasBase *()> canvasFactory )
protected

Definition at line 235 of file kis_shape_layer.cc.

242 , m_d(new Private())
243{
244 initShapeLayerImpl(controller, canvasFactory());
245}

References initShapeLayerImpl().

Member Function Documentation

◆ accept() [1/2]

bool KisShapeLayer::accept ( KisNodeVisitor & )
overridevirtual

Accept the KisNodeVisitor (for the Visitor design pattern), should call the correct function on the KisNodeVisitor for this node type, so you need to override it for all leaf classes in the node inheritance hierarchy.

return false if the visitor could not successfully act on this node instance.

Reimplemented from KisNode.

Definition at line 505 of file kis_shape_layer.cc.

506{
507 return visitor.visit(this);
508}

References KisNodeVisitor::visit().

◆ accept() [2/2]

void KisShapeLayer::accept ( KisProcessingVisitor & visitor,
KisUndoAdapter * undoAdapter )
overridevirtual

Accept the KisNodeVisitor (for the Visitor design pattern), should call the correct function on the KisProcessingVisitor for this node type, so you need to override it for all leaf classes in the node inheritance hierarchy.

The processing visitor differs from node visitor in the way that it accepts undo adapter, that allows the processing to be multithreaded

Reimplemented from KisNode.

Definition at line 510 of file kis_shape_layer.cc.

511{
512 return visitor.visit(this, undoAdapter);
513}
virtual void visit(KisNode *node, KisUndoAdapter *undoAdapter)=0

References KisProcessingVisitor::visit().

◆ allowAsChild()

bool KisShapeLayer::allowAsChild ( KisNodeSP ) const
overridevirtual

Re-implement this method to add constraints for the subclasses that can be added as children to this node

Returns
false if the given node is not allowed as a child to this node

Implements KisNode.

Definition at line 295 of file kis_shape_layer.cc.

296{
297 return node->inherits("KisMask");
298}

◆ antialiased()

bool KisShapeLayer::antialiased ( ) const

Definition at line 810 of file kis_shape_layer.cc.

811{
812 return m_d->isAntialiased;
813}

References KisShapeLayer::Private::isAntialiased, and m_d.

◆ canvas()

KisShapeLayerCanvasBase * KisShapeLayer::canvas ( ) const
protected

Definition at line 795 of file kis_shape_layer.cc.

796{
797 return m_d->canvas;
798}

References KisShapeLayer::Private::canvas, and m_d.

◆ clone()

KisNodeSP KisShapeLayer::clone ( ) const
inlineoverridevirtual

Implements KisNode.

Definition at line 79 of file kis_shape_layer.h.

79 {
80 return new KisShapeLayer(*this);
81 }

◆ converter()

const KoViewConverter * KisShapeLayer::converter ( ) const
protected

Definition at line 520 of file kis_shape_layer.cc.

521{
522 return m_d->canvas->viewConverter();
523}
const KoViewConverter * viewConverter() const override

References KisShapeLayer::Private::canvas, m_d, and KisShapeLayerCanvasBase::viewConverter().

◆ convertTo()

KUndo2Command * KisShapeLayer::convertTo ( const KoColorSpace * dstColorSpace,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(),
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags() )
overridevirtual

Reimplemented from KisExternalLayer.

Definition at line 779 of file kis_shape_layer.cc.

780{
781 using namespace KisDoSomethingCommandOps;
782
783 KUndo2Command *cmd = new KUndo2Command();
785 m_d->paintDevice->convertTo(dstColorSpace, renderingIntent, conversionFlags, cmd);
787 return cmd;
788}
void convertTo(const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags(), KUndo2Command *parentCommand=nullptr, KoUpdater *progressUpdater=nullptr)
KisPaintDeviceSP paintDevice

References KisPaintDevice::convertTo(), m_d, and KisShapeLayer::Private::paintDevice.

◆ createMergedLayerTemplate()

KisLayerSP KisShapeLayer::createMergedLayerTemplate ( KisLayerSP prevLayer)
overridevirtual

Create and return a layer that is the result of merging this with layer.

This method is designed to be called only within KisImage::mergeLayerDown().

Descendants override this to create specific merged types when possible. The KisLayer one creates a KisPaintLayerSP via a bitBlt, and can work on all layer types.

Descendants that perform their own version do NOT call KisLayer::createMergedLayer

Reimplemented from KisLayer.

Definition at line 378 of file kis_shape_layer.cc.

379{
380 KisLayerSP newLayer;
381
382 KisShapeLayer *prevShape = dynamic_cast<KisShapeLayer*>(prevLayer.data());
383 if (prevShape) {
384 newLayer = tryCreateInternallyMergedLayerFromMutipleLayers({prevLayer, this});
386 }
387
388 return newLayer ? newLayer : KisExternalLayer::createMergedLayerTemplate(prevLayer);
389}
KisLayerSP tryCreateInternallyMergedLayerFromMutipleLayers(QList< KisLayerSP > layers) override
virtual KisLayerSP createMergedLayerTemplate(KisLayerSP prevLayer)
Definition kis_layer.cc:407

References KisLayer::createMergedLayerTemplate(), KisSharedPtr< T >::data(), KIS_SAFE_ASSERT_RECOVER_NOOP, and tryCreateInternallyMergedLayerFromMutipleLayers().

◆ createShapesFromSvg()

QList< KoShape * > KisShapeLayer::createShapesFromSvg ( QIODevice * device,
const QString & baseXmlDir,
const QRectF & rectInPixels,
qreal resolutionPPI,
KoDocumentResourceManager * resourceManager,
bool loadingFromKra,
QSizeF * fragmentSize,
QStringList * warnings = 0,
QStringList * errors = 0 )
static

We set default text version to 1, it will make all the files not having an explicit krita:textVersion tag load as "legacy" files with the bug.

The tag is not needed when loading from pure SVG, because most probably they were not saved by a buggy Krita version.

Definition at line 599 of file kis_shape_layer.cc.

600{
601
602 QString errorMsg;
603 int errorLine = 0;
604 int errorColumn;
605
606 QDomDocument doc = SvgParser::createDocumentFromSvg(device, &errorMsg, &errorLine, &errorColumn);
607 if (doc.isNull()) {
608 errKrita << "Parsing error in contents.svg! Aborting!" << Qt::endl
609 << " In line: " << errorLine << ", column: " << errorColumn << Qt::endl
610 << " Error message: " << errorMsg << Qt::endl;
611
612 if (errors) {
613 *errors << i18n("Parsing error in the main document at line %1, column %2\nError message: %3"
614 , errorLine , errorColumn , errorMsg);
615 }
616 return QList<KoShape*>();
617 }
618
619 SvgParser parser(resourceManager);
620 parser.setXmlBaseDir(baseXmlDir);
621 parser.setResolution(rectInPixels /* px */, resolutionPPI /* ppi */);
622
623 if (loadingFromKra) {
632 parser.setDefaultKraTextVersion(1);
633 }
634
635 QList<KoShape *> result = parser.parseSvg(doc.documentElement(), fragmentSize);
636
637 if (warnings) {
638 *warnings = parser.warnings();
639 }
640
641 return result;
642}
static QDomDocument createDocumentFromSvg(QIODevice *device, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0)
#define errKrita
Definition kis_debug.h:107

References SvgParser::createDocumentFromSvg(), errKrita, SvgParser::parseSvg(), SvgParser::setDefaultKraTextVersion(), SvgParser::setResolution(), SvgParser::setXmlBaseDir(), and SvgParser::warnings().

◆ crop()

KUndo2Command * KisShapeLayer::crop ( const QRect & rect)
overridevirtual

Reimplemented from KisExternalLayer.

Definition at line 706 of file kis_shape_layer.cc.

707{
708 QPoint oldPos(x(), y());
709 QPoint newPos = oldPos - rect.topLeft();
710
711 return new KisNodeMoveCommand2(this, oldPos, newPos);
712}
qint32 y() const override
qint32 x() const override

References x(), and y().

◆ currentLayerChanged

void KisShapeLayer::currentLayerChanged ( const KoShapeLayer * layer)
signal

◆ fillMergedLayerTemplate()

void KisShapeLayer::fillMergedLayerTemplate ( KisLayerSP dstLayer,
KisLayerSP prevLayer,
bool skipPaintingThisLayer )
overridevirtual

Reimplemented from KisLayer.

Definition at line 391 of file kis_shape_layer.cc.

392{
393 if (!dynamic_cast<KisShapeLayer*>(dstLayer.data())) {
394 KisLayer::fillMergedLayerTemplate(dstLayer, prevLayer, skipPaintingThisLayer);
395 }
396}
virtual void fillMergedLayerTemplate(KisLayerSP dstLayer, KisLayerSP prevLayer, bool skipPaintingThisLayer=false)
Definition kis_layer.cc:422

References KisSharedPtr< T >::data(), and KisLayer::fillMergedLayerTemplate().

◆ forceUpdateHiddenAreaOnOriginal()

void KisShapeLayer::forceUpdateHiddenAreaOnOriginal ( )
overridevirtual

Force regeneration of the hidden part of original() device (the one outside image bounds). After regeneration is completed, the layer will Q_EMIT dirty signals itself, so no manual forced update is needed.

Implements KisCroppedOriginalLayerInterface.

Definition at line 568 of file kis_shape_layer.cc.

569{
571}
virtual void forceRepaintWithHiddenAreas()

References KisShapeLayer::Private::canvas, KisShapeLayerCanvasBase::forceRepaintWithHiddenAreas(), and m_d.

◆ forceUpdateTimedNode()

void KisShapeLayer::forceUpdateTimedNode ( )
overridevirtual

Forces a repaint of a shape layer without waiting for an event loop calling a delayed timer update. If you want to see the result of the shape layer right here and right now, you should do:

shapeLayer->setDirty(); shapeLayer->image()->waitForDone(); shapeLayer->forceUpdateTimedNode(); shapeLayer->image()->waitForDone();

Implements KisDelayedUpdateNodeInterface.

Definition at line 558 of file kis_shape_layer.cc.

559{
561}
virtual void forceRepaint()=0

References KisShapeLayer::Private::canvas, KisShapeLayerCanvasBase::forceRepaint(), and m_d.

◆ hasPendingTimedUpdates()

bool KisShapeLayer::hasPendingTimedUpdates ( ) const
overridevirtual
Returns
true if there are any pending updates in the delayed queue

Implements KisDelayedUpdateNodeInterface.

Definition at line 563 of file kis_shape_layer.cc.

564{
565 return m_d->canvas->hasPendingUpdates();
566}
virtual bool hasPendingUpdates() const =0

References KisShapeLayer::Private::canvas, KisShapeLayerCanvasBase::hasPendingUpdates(), and m_d.

◆ icon()

QIcon KisShapeLayer::icon ( ) const
overridevirtual
Returns
the icon used to represent the node type, for instance in the layerbox and in the menu.

Reimplemented from KisExternalLayer.

Definition at line 404 of file kis_shape_layer.cc.

405{
406 return KisIconUtils::loadIcon("vectorLayer");
407}
QIcon loadIcon(const QString &name)

References KisIconUtils::loadIcon().

◆ initShapeLayerImpl()

void KisShapeLayer::initShapeLayerImpl ( KoShapeControllerBase * controller,
KisShapeLayerCanvasBase * overrideCanvas )
private

Definition at line 263 of file kis_shape_layer.cc.

265{
266 setSupportsLodMoves(false);
268
270
272
273 m_d->canvas = canvas;
274 m_d->canvas->moveToThread(this->thread());
275 m_d->controller = controller;
276
277 m_d->canvas->shapeManager()->selection()->disconnect(this);
278
279 connect(m_d->canvas->selectedShapesProxy(), SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
281 this, SIGNAL(currentLayerChanged(const KoShapeLayer*)));
282
283 connect(this, SIGNAL(sigMoveShapes(QPointF)), SLOT(slotMoveShapes(QPointF)));
284
287 model->setAssociatedRootShapeManager(m_d->canvas->shapeManager());
288
289 if (this->image()) {
290 m_d->imageConnections.addUniqueConnection(this->image(), SIGNAL(sigResolutionChanged(double, double)), this, SLOT(slotImageResolutionChanged()));
292 }
293}
virtual KisPaintDeviceSP projection() const =0
KoSelectedShapesProxy * selectedShapesProxy() const override
selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged...
void slotMoveShapes(const QPointF &diff)
void selectionChanged()
void currentLayerChanged(const KoShapeLayer *layer)
void slotImageResolutionChanged()
void sigMoveShapes(const QPointF &diff)
void addUniqueConnection(Sender sender, Signal signal, Receiver receiver, Method method)
KoShapeContainerModel * model
KoSelection * selection
void setShapeId(const QString &id)
Definition KoShape.cpp:885
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
const QString KIS_SHAPE_LAYER_ID
void setSupportsLodMoves(bool value)
KisSignalAutoConnectionsStore imageConnections

References KisSignalAutoConnectionsStore::addUniqueConnection(), KisShapeLayer::Private::canvas, canvas(), KisShapeLayer::Private::controller, currentLayerChanged(), KisBaseNode::image, KisShapeLayer::Private::imageConnections, KIS_SAFE_ASSERT_RECOVER_RETURN, KIS_SHAPE_LAYER_ID, m_d, KoShapeContainer::model, KisShapeLayer::Private::paintDevice, KisShapeLayerCanvasBase::projection(), KisShapeLayerCanvasBase::selectedShapesProxy(), KoShapeManager::selection, selectionChanged(), KoShape::setShapeId(), KisBaseNode::setSupportsLodMoves(), KisShapeLayerCanvasBase::shapeManager(), sigMoveShapes(), slotImageResolutionChanged(), and slotMoveShapes().

◆ isSelectable()

bool KisShapeLayer::isSelectable ( ) const
inline

Definition at line 94 of file kis_shape_layer.h.

94 {
95 return false;
96 }

◆ isShapeEditable()

bool KisShapeLayer::isShapeEditable ( bool recursive) const
overridevirtual

checks recursively if the shape or one of its parents is not visible or locked

Reimplemented from KoShape.

Definition at line 550 of file kis_shape_layer.cc.

551{
552 return KoShapeLayer::isShapeEditable(recursive) && isEditable(true);
553}
virtual bool isShapeEditable(bool recursive=true) const
checks recursively if the shape or one of its parents is not visible or locked
Definition KoShape.cpp:970
bool isEditable(bool checkVisibility=true) const

References KisBaseNode::isEditable(), and KoShape::isShapeEditable().

◆ isVisible()

bool KoShape::isVisible ( bool recursive = true) const
protected

Returns current visibility state of this shape. Being visible means being painted, as well as being used for things like guidelines or searches.

Parameters
recursivewhen true, checks visibility recursively
Returns
current visibility state of this shape.
See also
isGeometryProtected(), isContentProtected(), isSelectable()

Definition at line 406 of file KoShape.cpp.

803{
804 if (!recursive)
805 return s->visible;
806
807 if (!s->visible)
808 return false;
809
810 KoShapeContainer * parentShape = parent();
811
812 if (parentShape) {
813 return parentShape->isVisible(true);
814 }
815
816 return true;
817}
KoShapeContainer * parent
Definition KoShape_p.h:95
QSharedDataPointer< SharedData > s
Definition KoShape.h:977
bool isVisible(bool recursive=true) const
Definition KoShape.cpp:802

◆ loadLayer()

bool KisShapeLayer::loadLayer ( KoStore * store,
QStringList * warnings = 0 )

Definition at line 679 of file kis_shape_layer.cc.

680{
681 if (!store) {
682 warnKrita << "No store backend";
683 return false;
684 }
685
686 if (store->open("content.svg")) {
687 KoStoreDevice storeDev(store);
688 storeDev.open(QIODevice::ReadOnly);
689
690 loadSvg(&storeDev, "", warnings);
691
692 store->close();
693
694 return true;
695 }
696
697 return false;
698
699}
bool loadSvg(QIODevice *device, const QString &baseXmlDir, QStringList *warnings=0)
bool close()
Definition KoStore.cpp:156
bool open(const QString &name)
Definition KoStore.cpp:109
#define warnKrita
Definition kis_debug.h:87

References KoStore::close(), loadSvg(), KoStore::open(), KoStoreDevice::open(), and warnKrita.

◆ loadSvg()

bool KisShapeLayer::loadSvg ( QIODevice * device,
const QString & baseXmlDir,
QStringList * warnings = 0 )
protected

Definition at line 655 of file kis_shape_layer.cc.

656{
657 QSizeF fragmentSize; // unused!
658 KisImageSP image = this->image();
659
660 // FIXME: we handle xRes() only!
662 const qreal resolutionPPI = 72.0 * image->xRes();
663
665 createShapesFromSvg(device, baseXmlDir,
666 image->bounds(), resolutionPPI,
668 true,
669 &fragmentSize,
670 warnings);
671
672 Q_FOREACH (KoShape *shape, shapes) {
673 addShape(shape);
674 }
675
676 return true;
677}
double xRes() const
double yRes() const
QRect bounds() const override
static QList< KoShape * > createShapesFromSvg(QIODevice *device, const QString &baseXmlDir, const QRectF &rectInPixels, qreal resolutionPPI, KoDocumentResourceManager *resourceManager, bool loadingFromKra, QSizeF *fragmentSize, QStringList *warnings=0, QStringList *errors=0)
virtual KoDocumentResourceManager * resourceManager() const
static bool qFuzzyCompare(half p1, half p2)

References KoShapeContainer::addShape(), KisImage::bounds(), KisShapeLayer::Private::controller, createShapesFromSvg(), KisBaseNode::image, KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, qFuzzyCompare(), KoShapeControllerBase::resourceManager(), KoShapeContainer::shapes(), KisImage::xRes(), and KisImage::yRes().

◆ original()

KisPaintDeviceSP KisShapeLayer::original ( ) const
overridevirtual

Return the layer data before the effect masks have had their go at it.

Implements KisLayer.

Definition at line 409 of file kis_shape_layer.cc.

410{
411 return m_d->paintDevice;
412}

References m_d, and KisShapeLayer::Private::paintDevice.

◆ paintDevice()

KisPaintDeviceSP KisShapeLayer::paintDevice ( ) const
overridevirtual

Return the paintdevice you can use to change pixels on. For a paint layer these will be paint pixels, for an adjustment layer or a mask the selection paint device.

Returns
the paint device to paint on. Can be 0 if the actual node type does not support painting.

Implements KisBaseNode.

Definition at line 414 of file kis_shape_layer.cc.

415{
416 return 0;
417}

◆ resetCache()

void KisShapeLayer::resetCache ( const KoColorSpace * colorSpace)
overridevirtual

Reimplemented from KisExternalLayer.

Definition at line 701 of file kis_shape_layer.cc.

702{
704}
virtual void resetCache(const KoColorSpace *colorSpace)=0
const KoColorSpace * colorSpace() const override
returns the image's colorSpace or null, if there is no image
Definition kis_layer.cc:225

References KisShapeLayer::Private::canvas, KisLayer::colorSpace(), m_d, and KisShapeLayerCanvasBase::resetCache().

◆ saveLayer()

bool KisShapeLayer::saveLayer ( KoStore * store) const

Definition at line 645 of file kis_shape_layer.cc.

646{
647 // FIXME: we handle xRes() only!
648
649 const QSizeF sizeInPx = image()->bounds().size();
650 const QSizeF sizeInPt(sizeInPx.width() / image()->xRes(), sizeInPx.height() / image()->yRes());
651
652 return saveShapesToStore(store, this->shapes(), sizeInPt);
653}
static bool saveShapesToStore(KoStore *store, QList< KoShape * > shapes, const QSizeF &sizeInPt)

References KisImage::bounds(), KisBaseNode::image, saveShapesToStore(), and KoShapeContainer::shapes().

◆ saveShapesToStore()

bool KisShapeLayer::saveShapesToStore ( KoStore * store,
QList< KoShape * > shapes,
const QSizeF & sizeInPt )
static

Definition at line 578 of file kis_shape_layer.cc.

579{
580 if (!store->open("content.svg")) {
581 return false;
582 }
583
584 KoStoreDevice storeDev(store);
585 storeDev.open(QIODevice::WriteOnly);
586
587 std::sort(shapes.begin(), shapes.end(), KoShape::compareShapeZIndex);
588
589 SvgWriter writer(shapes);
590 writer.save(storeDev, sizeInPt);
591
592 if (!store->close()) {
593 return false;
594 }
595
596 return true;
597}
Implements exporting shapes to SVG.
Definition SvgWriter.h:33

References KoStore::close(), KoShape::compareShapeZIndex(), KoStore::open(), KoStoreDevice::open(), SvgWriter::save(), and KoShapeContainer::shapes().

◆ sectionModelProperties()

KisBaseNode::PropertyList KisShapeLayer::sectionModelProperties ( ) const
overridevirtual

Return a the properties of this base node (locked, visible etc, with the right icons for their representation and their state.

Subclasses can extend this list with new properties, like opacity for layers or visualized for masks.

The order of properties is, unfortunately, for now, important, so take care which properties superclasses of your class define.

KisBaseNode defines visible = 0, locked = 1 KisLayer defines opacity = 2, compositeOp = 3 KisMask defines active = 2 (KisMask does not inherit kislayer)

Reimplemented from KisLayer.

Definition at line 315 of file kis_shape_layer.cc.

316{
318
320
321 return l;
322}
static KisBaseNode::Property getProperty(const KoID &id, bool state)
bool antialiased() const
KisBaseNode::PropertyList sectionModelProperties() const override
Definition kis_layer.cc:272

References KisLayerPropertiesIcons::antialiased, antialiased(), KisLayerPropertiesIcons::getProperty(), and KisLayer::sectionModelProperties().

◆ selectedShapesProxy()

KoSelectedShapesProxy * KisShapeLayer::selectedShapesProxy ( )

selectedShapesProxy

Returns
returns the selectedShapesProxy of the KoCanvasBase of this layer, used for certain undo commands.

Definition at line 573 of file kis_shape_layer.cc.

574{
575 return m_d->canvas->selectedShapesProxy();
576}

References KisShapeLayer::Private::canvas, m_d, and KisShapeLayerCanvasBase::selectedShapesProxy().

◆ selectionChanged

void KisShapeLayer::selectionChanged ( )
signal

These signals are forwarded from the local shape manager This is done because we switch KoShapeManager and therefore KoSelection in KisCanvas2, so we need to connect local managers to the UI as well.

See also
comment in the constructor of KisCanvas2

◆ setAntialiased()

void KisShapeLayer::setAntialiased ( const bool antialiased)

Definition at line 815 of file kis_shape_layer.cc.

816{
817 const bool oldAntialiased = m_d->isAntialiased;
818
819 if (antialiased != oldAntialiased) {
821 // is it the best way to rerender the vector layer?
823 }
824}

References antialiased(), KisShapeLayer::Private::canvas, KisLayer::colorSpace(), KisShapeLayer::Private::isAntialiased, m_d, and KisShapeLayerCanvasBase::resetCache().

◆ setImage()

void KisShapeLayer::setImage ( KisImageWSP image)
overridevirtual

Set the image this layer belongs to.

Reimplemented from KisLayer.

Definition at line 300 of file kis_shape_layer.cc.

301{
303 KisLayer::setImage(_image);
304 m_d->canvas->setImage(_image);
305 if (m_d->paintDevice) {
307 }
308 if (_image) {
309 m_d->imageConnections.addUniqueConnection(_image, SIGNAL(sigResolutionChanged(double, double)), this, SLOT(slotImageResolutionChanged()));
311 }
312}
void setDefaultBounds(KisDefaultBoundsBaseSP bounds)
virtual void setImage(KisImageWSP image)
void setImage(KisImageWSP image) override
Definition kis_layer.cc:378

References KisSignalAutoConnectionsStore::addUniqueConnection(), KisShapeLayer::Private::canvas, KisSignalAutoConnectionsStore::clear(), KisShapeLayer::Private::imageConnections, m_d, KisShapeLayer::Private::paintDevice, KisPaintDevice::setDefaultBounds(), KisShapeLayerCanvasBase::setImage(), KisLayer::setImage(), and slotImageResolutionChanged().

◆ setParent()

void KisShapeLayer::setParent ( KoShapeContainer * parent)

Definition at line 398 of file kis_shape_layer.cc.

399{
400 Q_UNUSED(parent);
402}
#define KIS_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:75

References KIS_ASSERT_RECOVER_RETURN, and KoShape::Private::parent.

◆ setProfile()

KUndo2Command * KisShapeLayer::setProfile ( const KoColorProfile * profile)
overridevirtual

Reimplemented from KisExternalLayer.

Definition at line 767 of file kis_shape_layer.cc.

768{
769 using namespace KisDoSomethingCommandOps;
770
771 KUndo2Command *cmd = new KUndo2Command();
773 m_d->paintDevice->setProfile(profile, cmd);
775
776 return cmd;
777}
bool setProfile(const KoColorProfile *profile, KUndo2Command *parentCommand)

References m_d, KisShapeLayer::Private::paintDevice, and KisPaintDevice::setProfile().

◆ setSectionModelProperties()

void KisShapeLayer::setSectionModelProperties ( const KisBaseNode::PropertyList & properties)
overridevirtual

Change the section model properties.

Reimplemented from KisLayer.

Definition at line 324 of file kis_shape_layer.cc.

325{
326 Q_FOREACH (const KisBaseNode::Property &property, properties) {
327 if (property.name == i18n("Anti-aliasing")) {
328 setAntialiased(property.state.toBool());
329 }
330 }
331
333}
void setAntialiased(const bool antialiased)
KoProperties properties
void setSectionModelProperties(const KisBaseNode::PropertyList &properties) override
Definition kis_layer.cc:297

References KisBaseNode::Property::name, KisBaseNode::properties, setAntialiased(), KisLayer::setSectionModelProperties(), and KisBaseNode::Property::state.

◆ setUserLocked()

void KisShapeLayer::setUserLocked ( bool l)
overridevirtual

Set the locked status of this node. Locked nodes cannot be edited.

Reimplemented from KisBaseNode.

Definition at line 544 of file kis_shape_layer.cc.

545{
548}
float value(const T *src, size_t ch)
void setGeometryProtected(bool on)
Definition KoShape.cpp:842
virtual void setUserLocked(bool l)

References KoShape::setGeometryProtected(), KisBaseNode::setUserLocked(), and value().

◆ setVisible()

void KisShapeLayer::setVisible ( bool visible,
bool loading = false )
overridevirtual

Set the visible status of this node. Visible nodes are active in the graph (except for selections masks which can be active while hidden), that is to say, they are taken into account when merging. Invisible nodes play no role in the final image , but will be modified when modifying all layers, for instance when cropping.

Toggling the visibility of a node will not automatically lead to recomposition.

Parameters
visiblethe new visibility state
isLoadingif true, the property is set during loading.

Reimplemented from KisBaseNode.

Definition at line 530 of file kis_shape_layer.cc.

531{
532 const bool oldVisible = this->visible(false);
533
536
537 if (visible && !oldVisible &&
539
541 }
542}
virtual void rerenderAfterBeingInvisible()=0
bool visible(bool recursive=false) const override
void setVisible(bool on)
Definition KoShape.cpp:795
virtual void setVisible(bool visible, bool loading=false)

References KisShapeLayer::Private::canvas, KisShapeLayerCanvasBase::hasChangedWhileBeingInvisible(), m_d, KisShapeLayerCanvasBase::rerenderAfterBeingInvisible(), KoShape::setVisible(), KisBaseNode::setVisible(), and visible().

◆ setX()

void KisShapeLayer::setX ( qint32 )
overridevirtual

Set the x offset of this layer in the image place. Re-implement this where it makes sense, by default it does nothing. It should not move child nodes.

Reimplemented from KisLayer.

Definition at line 434 of file kis_shape_layer.cc.

435{
436 qint32 delta = x - this->x();
437 QPointF diff = QPointF(m_d->canvas->viewConverter()->viewToDocumentX(delta), 0);
438 Q_EMIT sigMoveShapes(diff);
439
440 // Save new value to satisfy LSP
441 m_d->x = x;
442}
virtual qreal viewToDocumentX(qreal viewX) const

References KisShapeLayer::Private::canvas, m_d, sigMoveShapes(), KisShapeLayerCanvasBase::viewConverter(), KoViewConverter::viewToDocumentX(), KisShapeLayer::Private::x, and x().

◆ setY()

void KisShapeLayer::setY ( qint32 )
overridevirtual

Set the y offset of this layer in the image place. Re-implement this where it makes sense, by default it does nothing. It should not move child nodes.

Reimplemented from KisLayer.

Definition at line 444 of file kis_shape_layer.cc.

445{
446 qint32 delta = y - this->y();
447 QPointF diff = QPointF(0, m_d->canvas->viewConverter()->viewToDocumentY(delta));
448 Q_EMIT sigMoveShapes(diff);
449
450 // Save new value to satisfy LSP
451 m_d->y = y;
452}
virtual qreal viewToDocumentY(qreal viewY) const

References KisShapeLayer::Private::canvas, m_d, sigMoveShapes(), KisShapeLayerCanvasBase::viewConverter(), KoViewConverter::viewToDocumentY(), KisShapeLayer::Private::y, and y().

◆ shapeController()

KoShapeControllerBase * KisShapeLayer::shapeController ( ) const
protected

Definition at line 790 of file kis_shape_layer.cc.

791{
792 return m_d->controller;
793}

References KisShapeLayer::Private::controller, and m_d.

◆ shapeManager()

KoShapeManager * KisShapeLayer::shapeManager ( ) const

Definition at line 515 of file kis_shape_layer.cc.

516{
517 return m_d->canvas->shapeManager();
518}

References KisShapeLayer::Private::canvas, m_d, and KisShapeLayerCanvasBase::shapeManager().

◆ shapesToBeTransformed()

QList< KoShape * > KisShapeLayer::shapesToBeTransformed ( )
private

Definition at line 469 of file kis_shape_layer.cc.

470{
472
473 // We expect that **all** the shapes inherit the transform from its parent
474
475 // SANITY_CHECK: we expect all the shapes inside the
476 // shape layer to inherit transform!
477 Q_FOREACH (KoShape *shape, shapes) {
478 if (shape->parent()) {
480 break;
481 }
482 }
483 }
484
485 shapes << this;
486 filterTransformableShapes(shapes);
487 return shapes;
488}
KoShapeManager * shapeManager() const
bool inheritsTransform(const KoShape *shape) const
QList< KoShape * > shapes
KoShapeContainer * parent() const
Definition KoShape.cpp:862

References KoShapeContainer::inheritsTransform(), KIS_SAFE_ASSERT_RECOVER, KoShape::parent(), shapeManager(), KoShapeContainer::shapes(), and KoShapeManager::shapes.

◆ sigMoveShapes

void KisShapeLayer::sigMoveShapes ( const QPointF & diff)
signal

A signal + slot to synchronize UI and image threads. Image thread emits the signal, UI thread performs the action

◆ slotImageResolutionChanged

void KisShapeLayer::slotImageResolutionChanged ( )
privateslot

Definition at line 800 of file kis_shape_layer.cc.

801{
804 if (this->image()) {
805 model->setResolution(image()->xRes() * 72.0, image()->yRes() * 72.0);
806 }
807}
void setResolution(qreal xRes, qreal yRes)

References KisBaseNode::image, KIS_SAFE_ASSERT_RECOVER_RETURN, KoShapeContainer::model, and ShapeLayerContainerModel::setResolution().

◆ slotMoveShapes

void KisShapeLayer::slotMoveShapes ( const QPointF & diff)
privateslot

Definition at line 490 of file kis_shape_layer.cc.

491{
493 if (shapes.isEmpty()) return;
494
495 KoShapeMoveCommand cmd(shapes, diff);
496 cmd.redo();
497}
QList< KoShape * > shapesToBeTransformed()
The undo / redo command for shape moving.

References KoShapeMoveCommand::redo(), KoShapeContainer::shapes(), and shapesToBeTransformed().

◆ slotTransformShapes

void KisShapeLayer::slotTransformShapes ( const QTransform & transform)
privateslot

Definition at line 499 of file kis_shape_layer.cc.

500{
501 KoShapeTransformCommand cmd({this}, {transformation()}, {newTransform});
502 cmd.redo();
503}
void redo() override
redo the command
QTransform transformation() const
Returns the shapes local transformation matrix.
Definition KoShape.cpp:383

References KoShapeTransformCommand::redo(), and KoShape::transformation().

◆ theoreticalBoundingRect()

QRect KisShapeLayer::theoreticalBoundingRect ( ) const
overridevirtual

Some external layers use original() only as a projection and render some internal state into it, e.g. using KisSpontaneousProjection asynchronously. theoreticalBoundingRect() is used to get real bounding rect of a layer without relying on original().

Reimplemented from KisExternalLayer.

Definition at line 419 of file kis_shape_layer.cc.

420{
421 return kisGrowRect(m_d->canvas->viewConverter()->documentToView(this->boundingRect()).toAlignedRect(), 1);
422}
virtual QPointF documentToView(const QPointF &documentPoint) const
T kisGrowRect(const T &rect, U offset)
Definition kis_global.h:186

References KisShapeLayer::Private::canvas, KoViewConverter::documentToView(), kisGrowRect(), m_d, and KisShapeLayerCanvasBase::viewConverter().

◆ transform()

KUndo2Command * KisShapeLayer::transform ( const QTransform & transform)
overridevirtual

We cannot transform shapes in the worker thread. Therefor we Q_EMIT blocking-queued signal to transform them in the GUI thread and then return.

Reimplemented from KisExternalLayer.

Definition at line 749 of file kis_shape_layer.cc.

750{
752 if (shapes.isEmpty()) return 0;
753 KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(shapes.size() == 1 && shapes.first() == this, 0);
754
759 const KisImageViewConverter *converter = dynamic_cast<const KisImageViewConverter*>(this->converter());
760 KIS_ASSERT(converter);
761 QTransform docSpaceTransform = converter->documentToView() *
763
764 return new TransformShapeLayerDeferred(this, docSpaceTransform);
765}
friend class TransformShapeLayerDeferred
const KoViewConverter * converter() const
QTransform transform() const
return the current matrix that contains the rotation/scale/position of this shape
Definition KoShape.cpp:950
virtual QPointF viewToDocument(const QPointF &viewPoint) const
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
Definition kis_assert.h:129

References converter(), KoViewConverter::documentToView(), KIS_ASSERT, KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, KoShapeContainer::shapes(), shapesToBeTransformed(), KoShape::transform(), TransformShapeLayerDeferred, and KoViewConverter::viewToDocument().

◆ tryCreateInternallyMergedLayerFromMutipleLayers()

KisLayerSP KisShapeLayer::tryCreateInternallyMergedLayerFromMutipleLayers ( QList< KisLayerSP > layers)
overridevirtual

Try create a layer of this type from multiple layers (of the same type).

The implementation will check if all the layers passed as layer have the same type, verify if they could be merged in a non-rasterizing fasion, merge them and return the layer of the proper type.

Currently only used for merging a set of shape layers into a single shape layer.

Reimplemented from KisLayer.

Definition at line 335 of file kis_shape_layer.cc.

336{
337 // NOTE: layers.first() may possibly point to `this`!
338
339 QList<KisShapeLayer*> shapeLayers;
340 Q_FOREACH(KisLayerSP layer, layers) {
341 KisShapeLayer *shapeLayer = dynamic_cast<KisShapeLayer*>(layer.data());
342 if (!shapeLayer) return nullptr;
343
344 shapeLayers << shapeLayer;
345 }
346
347 QList<KoShape*> allShapes;
349 Q_FOREACH(KisShapeLayer *layer, shapeLayers) {
350 QList<KoShape*> shapes = layer->shapes();
351 std::sort(shapes.begin(), shapes.end(), KoShape::compareShapeZIndex);
352
353 Q_FOREACH(KoShape *shape, shapes) {
354 allShapes << shape;
355 allIndexedShapes << shape;
356 }
357 }
358
359 allIndexedShapes = KoShapeReorderCommand::homogenizeZIndexesLazy(allIndexedShapes);
360
361 KoShapeReorderCommand cmd(allIndexedShapes);
362 cmd.redo();
363
364 KisLayerSP newLayer = new KisShapeLayer(*this, allShapes);
365
366 newLayer->setCompositeOpId(this->compositeOpId());
367 if (!this->channelFlags().isEmpty()) {
368 newLayer->setChannelFlags(this->channelFlags());
369 }
370
371 newLayer->setCompositeOpId(this->compositeOpId());
372 newLayer->setPinnedToTimeline(this->isPinnedToTimeline());
373 newLayer->setColorLabelIndex(this->colorLabelIndex());
374
375 return newLayer;
376}
This command allows you to change the zIndex of a number of shapes.
static QList< KoShapeReorderCommand::IndexedShape > homogenizeZIndexesLazy(QList< IndexedShape > shapes)
void setPinnedToTimeline(bool pinned)
const QString & compositeOpId() const
bool isPinnedToTimeline() const
void setColorLabelIndex(int index)
int colorLabelIndex() const
void setCompositeOpId(const QString &compositeOpId)
QBitArray channelFlags
Definition kis_layer.cc:167
virtual void setChannelFlags(const QBitArray &channelFlags)
Definition kis_layer.cc:342

References KisLayer::channelFlags, KisBaseNode::colorLabelIndex(), KoShape::compareShapeZIndex(), KisBaseNode::compositeOpId(), KisSharedPtr< T >::data(), KoShapeReorderCommand::homogenizeZIndexesLazy(), KisBaseNode::isPinnedToTimeline(), KisShapeLayer(), KoShapeReorderCommand::redo(), KisLayer::setChannelFlags(), KisBaseNode::setColorLabelIndex(), KisBaseNode::setCompositeOpId(), KisBaseNode::setPinnedToTimeline(), and KoShapeContainer::shapes().

◆ visible()

bool KisShapeLayer::visible ( bool recursive = false) const
overridevirtual
Returns
true if this node is visible (i.e, active (except for selection masks where visible and active properties are different)) in the graph
Parameters
boolrecursive if true, check whether all parents of this node are visible as well.

Reimplemented from KisBaseNode.

Definition at line 525 of file kis_shape_layer.cc.

526{
527 return KisExternalLayer::visible(recursive);
528}
virtual bool visible(bool recursive=false) const

References KisBaseNode::visible().

◆ x()

qint32 KisShapeLayer::x ( ) const
overridevirtual
Returns
the x-offset of this layer in the image plane.

Reimplemented from KisLayer.

Definition at line 424 of file kis_shape_layer.cc.

425{
426 return m_d->x;
427}

References m_d, and KisShapeLayer::Private::x.

◆ y()

qint32 KisShapeLayer::y ( ) const
overridevirtual
Returns
the y-offset of this layer in the image plane.

Reimplemented from KisLayer.

Definition at line 429 of file kis_shape_layer.cc.

430{
431 return m_d->y;
432}

References m_d, and KisShapeLayer::Private::y.

Friends And Related Symbol Documentation

◆ ShapeLayerContainerModel

friend class ShapeLayerContainerModel
friend

Definition at line 185 of file kis_shape_layer.h.

◆ TransformShapeLayerDeferred

friend class TransformShapeLayerDeferred
friend

Definition at line 191 of file kis_shape_layer.h.

Member Data Documentation

◆ m_d

Private* const KisShapeLayer::m_d
private

Definition at line 223 of file kis_shape_layer.h.


The documentation for this class was generated from the following files: