|
Swiftray
1.0
|
A base class for shape objects that contains transform and parent information. More...
#include <shape.h>
Public Types | |
| enum class | Type { None , Path , Bitmap , Text , Group } |
Public Member Functions | |
| Shape () noexcept | |
| virtual | ~Shape () |
| void | applyTransform (const QTransform &transform) |
| QRectF | boundingRect () const |
| virtual shared_ptr< Shape > | clone () const |
| void | flushCache () |
| QTransform | globalTransform () const |
| bool | hasLayer () const |
| virtual bool | hitTest (QPointF global_coord, qreal tolerance) const |
| virtual bool | hitTest (QRectF global_coord_rect) const |
| bool | isLayerLocked () const |
| bool | isParentSelected () const |
| Layer * | layer () const |
| virtual | operator QString () |
| virtual void | paint (QPainter *painter) const |
| Shape * | parent () const |
| QPointF | pos () const |
| QPolygonF | rotatedBBox () const |
| qreal | rotation () const |
| bool | selected () const |
| void | setLayer (Layer *layer) |
| void | setParent (Shape *parent) |
| void | setRotation (qreal r) |
| void | setSelected (bool selected) |
| void | setTempTransform (const QTransform &transform) |
| void | setTransform (const QTransform &transform) |
| const QTransform & | tempTransform () const |
| const QTransform & | transform () const |
| virtual Type | type () const |
| qreal | x () const |
| qreal | y () const |
Protected Member Functions | |
| virtual void | calcBoundingBox () const |
Protected Attributes | |
| QRectF | bbox_ |
| QPolygonF | rotated_bbox_ |
| bool | selected_ |
| QTransform | temp_transform_ |
| QTransform | transform_ |
Friends | |
| class | DocumentSerializer |
A base class for shape objects that contains transform and parent information.
|
strong |
|
noexcept |
|
virtual |
| void Shape::applyTransform | ( | const QTransform & | transform | ) |
Combine current transform with a new transform.
| transform | The new transform |
| QRectF Shape::boundingRect | ( | ) | const |
|
protectedvirtual |
Calculate bounding box of the shape if the cache is invalid
|
virtual |
Reimplemented in TextShape, PathShape, GroupShape, and BitmapShape.
| void Shape::flushCache | ( | ) |
| QTransform Shape::globalTransform | ( | ) | const |
| bool Shape::hasLayer | ( | ) | const |
|
virtual |
Reimplemented in PathShape, GroupShape, and BitmapShape.
|
virtual |
Reimplemented in PathShape, GroupShape, and BitmapShape.
| bool Shape::isLayerLocked | ( | ) | const |
Whether the layer of the object is locked
| bool Shape::isParentSelected | ( | ) | const |
| Layer * Shape::layer | ( | ) | const |
|
virtual |
|
virtual |
Reimplemented in TextShape, PathShape, GroupShape, and BitmapShape.
| Shape * Shape::parent | ( | ) | const |
| QPointF Shape::pos | ( | ) | const |
| QPolygonF Shape::rotatedBBox | ( | ) | const |
| qreal Shape::rotation | ( | ) | const |
| bool Shape::selected | ( | ) | const |
| void Shape::setLayer | ( | Layer * | layer | ) |
| void Shape::setParent | ( | Shape * | parent | ) |
| void Shape::setRotation | ( | qreal | r | ) |
| void Shape::setSelected | ( | bool | selected | ) |
| void Shape::setTempTransform | ( | const QTransform & | transform | ) |
Set temporarily transform that hasn't been commited during moving / rotating / scaling stage for displaying objects.
| transform | The new transform |
| void Shape::setTransform | ( | const QTransform & | transform | ) |
Set current transform to a new transform.
| transform | The new transform |
| const QTransform & Shape::tempTransform | ( | ) | const |
| const QTransform & Shape::transform | ( | ) | const |
|
virtual |
Returns shape type in Shape::Type
Reimplemented in TextShape, PathShape, GroupShape, and BitmapShape.
| qreal Shape::x | ( | ) | const |
| qreal Shape::y | ( | ) | const |
|
friend |
|
mutableprotected |
Cached bounding box
|
mutableprotected |
Cached bounding box with rotation
|
protected |
Whether the object is selected by user
|
protected |
Temporarily transform that hasn't been commited during moving / rotating / scaling stage for displaying objects.
|
protected |
Shape transform including offset, scale, rotate and kew