|
Krita Source Code Documentation
|
#include <KoShapeContainerModel.h>
Inheritance diagram for KoShapeContainerModel:Public Member Functions | |
| virtual void | add (KoShape *shape)=0 |
| virtual void | childChanged (KoShape *shape, KoShape::ChangeType type) |
| virtual void | containerChanged (KoShapeContainer *container, KoShape::ChangeType type)=0 |
| virtual int | count () const =0 |
| void | deleteOwnedShapes () |
| virtual bool | inheritsTransform (const KoShape *shape) const =0 |
| virtual bool | isClipped (const KoShape *shape) const =0 |
| KoShapeContainerModel () | |
| default constructor | |
| virtual void | proposeMove (KoShape *shape, QPointF &move) |
| virtual void | remove (KoShape *shape)=0 |
| virtual void | setClipped (const KoShape *shape, bool clipping)=0 |
| virtual void | setInheritsTransform (const KoShape *shape, bool inherit)=0 |
| virtual void | shapeHasBeenAddedToHierarchy (KoShape *shape, KoShapeContainer *addedToSubtree) |
| virtual QList< KoShape * > | shapes () const =0 |
| virtual void | shapeToBeRemovedFromHierarchy (KoShape *shape, KoShapeContainer *removedFromSubtree) |
| virtual | ~KoShapeContainerModel () |
| destructor | |
Protected Member Functions | |
| KoShapeContainerModel (const KoShapeContainerModel &rhs) | |
The interface for the container model. This class has no implementation, but only pure virtual methods. You can find a fully implemented model using KoShapeContainerDefaultModel. Extending this class and implementing all methods allows you to implement a custom data-backend for the KoShapeContainer.
Definition at line 27 of file KoShapeContainerModel.h.
| KoShapeContainerModel::KoShapeContainerModel | ( | ) |
|
virtual |
|
protected |
Definition at line 67 of file KoShapeContainerModel.cpp.
Add a shape to this models store.
| shape | the shape to be managed in the container. |
Implemented in ShapeGroupContainerModel, SimpleShapeContainerModel, ShapeLayerContainerModel, KisShapeSelectionModel, and KoTosContainerModel.
|
virtual |
This method is called when one of the shape shapes has been modified. When a shape is rotated, moved or scaled/skewed this method will be called to inform the container of such a change. The change has already happened at the time this method is called. The base implementation notifies the grand parent of the shape that there was a change in a shape. A reimplementation if this function should call this method when overriding the function.
| shape | the shape that has been changed |
| type | this enum shows which change the shape has had. |
Reimplemented in KisShapeSelectionModel, and ShapeGroupContainerModel.
Definition at line 39 of file KoShapeContainerModel.cpp.
References KoShape::ChildChanged, childChanged(), KoShapeContainer::model, and KoShape::parent().
|
pure virtual |
This method is called as a notification that one of the properties of the container changed. This can be one of size, position, rotation and skew. Note that clipped children will automatically get all these changes, the model does not have to do anything for that.
| container | the actual container that changed. |
| type | this enum shows which change the container has had. |
Implemented in SimpleShapeContainerModel, KisShapeSelectionModel, and KoTosContainerModel.
|
pure virtual |
Return the current number of children registered.
Implemented in KoTosContainerModel, SimpleShapeContainerModel, and KisShapeSelectionModel.
| void KoShapeContainerModel::deleteOwnedShapes | ( | ) |
Definition at line 21 of file KoShapeContainerModel.cpp.
References count(), KIS_SAFE_ASSERT_RECOVER_NOOP, KoShape::setParent(), and shapes().
|
pure virtual |
Returns if the shape inherits the container transform.
A shape that inherits the transform of the parent container will have its share / rotation / skew etc be calculated as being the product of both its own local transformation and also that of its parent container. If you set this to true and rotate the container, the shape will get that rotation as well automatically.
| shape | the shape for which the property will be returned. |
Implemented in KoTosContainerModel, SimpleShapeContainerModel, and KisShapeSelectionModel.
|
pure virtual |
Returns if the argument shape has its 'clipping' property set.
A shape that is clipped by the container will have its visible portion limited to the area where it intersects with the container. If a shape is positioned or sized such that it would be painted outside of the KoShape::outline() of its parent container, setting this property to true will clip the shape painting to the container outline.
| shape | the shape for which the property will be returned. |
Implemented in KisShapeSelectionModel, KoTosContainerModel, and SimpleShapeContainerModel.
This method is called when the user tries to move a shape that is a shape of the container this model represents. The shape itself is not yet moved; it is proposed to be moved over the param move distance. You can alter the value of the move to affect the actual distance moved. The default implementation does nothing.
| shape | the shape of this container that the user is trying to move. |
| move | the distance that the user proposes to move shape from the current position. |
Reimplemented in SimpleShapeContainerModel.
Definition at line 33 of file KoShapeContainerModel.cpp.
Remove a shape to be completely separated from the model.
| shape | the shape to be removed. |
Implemented in ShapeGroupContainerModel, ShapeLayerContainerModel, KisShapeSelectionModel, KoTosContainerModel, and SimpleShapeContainerModel.
|
pure virtual |
Set the argument shape to have its 'clipping' property set.
A shape that is clipped by the container will have its visible portion limited to the area where it intersects with the container. If a shape is positioned or sized such that it would be painted outside of the KoShape::outline() of its parent container, setting this property to true will clip the shape painting to the container outline.
| shape | the shape for which the property will be changed. |
| clipping | the new value |
Implemented in KisShapeSelectionModel, KoTosContainerModel, and SimpleShapeContainerModel.
|
pure virtual |
Set the shape to inherit the container transform.
A shape that inherits the transform of the parent container will have its share / rotation / skew etc be calculated as being the product of both its own local transformation and also that of its parent container. If you set this to true and rotate the container, the shape will get that rotation as well automatically.
| shape | the shape for which the property will be changed. |
| inherit | the new value |
Implemented in KoTosContainerModel, KisShapeSelectionModel, and SimpleShapeContainerModel.
|
virtual |
Reimplemented in SimpleShapeContainerModel.
Definition at line 51 of file KoShapeContainerModel.cpp.
References KoShape::parent().
Return the list of all shapes of this model
Implemented in KoTosContainerModel, SimpleShapeContainerModel, and KisShapeSelectionModel.
|
virtual |
Reimplemented in SimpleShapeContainerModel.
Definition at line 59 of file KoShapeContainerModel.cpp.
References KoShape::parent().