Krita Source Code Documentation
Loading...
Searching...
No Matches
KisShapeLayerCanvasBase Class Referenceabstract

#include <kis_shape_layer_canvas.h>

+ Inheritance diagram for KisShapeLayerCanvasBase:

Public Member Functions

void addCommand (KUndo2Command *command) override
 
const QWidget * canvasWidget () const override
 
QWidget * canvasWidget () override
 
virtual void forceRepaint ()=0
 
virtual void forceRepaintWithHiddenAreas ()
 
void gridSize (QPointF *offset, QSizeF *spacing) const override
 
bool hasChangedWhileBeingInvisible ()
 
virtual bool hasPendingUpdates () const =0
 
 KisShapeLayerCanvasBase (const KisShapeLayerCanvasBase &rhs, KisShapeLayer *parent)
 
 KisShapeLayerCanvasBase (KisShapeLayer *parent)
 
void prepareForDestroying ()
 
virtual KisPaintDeviceSP projection () const =0
 
virtual void rerenderAfterBeingInvisible ()=0
 
virtual void resetCache (const KoColorSpace *colorSpace)=0
 
KoSelectedShapesProxyselectedShapesProxy () const override
 selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged() and selectionContentChanged() signals. While shapeManager() can change throughout the life time of the canvas, selectedShapesProxy() is guaranteed to stay the same.
 
void setCursor (const QCursor &) override
 
virtual void setImage (KisImageWSP image)
 
KoShapeManagershapeManager () const override
 
bool snapToGrid () const override
 
KoToolProxytoolProxy () const override
 
KoUnit unit () const override
 
const KoViewConverterviewConverter () const override
 
KoViewConverterviewConverter () override
 
- Public Member Functions inherited from KoCanvasBase
KoCanvasControllercanvasController () const
 
virtual bool canvasIsOpenGL () const
 
virtual void clipToDocument (const KoShape *shape, QPointF &move) const
 
virtual void disconnectCanvasObserver (QObject *object)
 
virtual QPoint documentOrigin () const
 
 KoCanvasBase (KoShapeControllerBase *shapeController, KoCanvasResourceProvider *sharedResourceManager=0)
 
 Private ()
 
KoCanvasResourceProviderresourceManager () const
 
void setCanvasController (KoCanvasController *controller)
 called by KoCanvasController to set the controller that handles this canvas.
 
KoShapeControllershapeController () const
 
KoSnapGuidesnapGuide () const
 
virtual void updateCanvas (const QRectF &rc)=0
 
virtual QPointF viewToDocument (const QPointF &viewPoint) const
 
 ~KoCanvasBase () override
 
 ~Private ()
 

Protected Attributes

bool m_hasChangedWhileBeingInvisible {false}
 
bool m_isDestroying {false}
 
QScopedPointer< KoSelectedShapesProxym_selectedShapesProxy
 
QScopedPointer< KoShapeManagerm_shapeManager
 
KisImageViewConverter m_viewConverter
 

Additional Inherited Members

- Public Attributes inherited from KoCanvasBase
KoCanvasControllercontroller
 
bool isResourceManagerShared
 
QPointer< KoCanvasResourceProviderresourceManager
 
QPointer< KoShapeControllershapeController
 
KoSnapGuidesnapGuide
 

Detailed Description

Definition at line 33 of file kis_shape_layer_canvas.h.

Constructor & Destructor Documentation

◆ KisShapeLayerCanvasBase() [1/2]

KisShapeLayerCanvasBase::KisShapeLayerCanvasBase ( KisShapeLayer * parent)

Definition at line 40 of file kis_shape_layer_canvas.cpp.

41 : KoCanvasBase(0)
45{
46 m_shapeManager->selection()->setActiveLayer(parent);
47}
QScopedPointer< KoSelectedShapesProxy > m_selectedShapesProxy
KisImageViewConverter m_viewConverter
QScopedPointer< KoShapeManager > m_shapeManager

References m_shapeManager.

◆ KisShapeLayerCanvasBase() [2/2]

KisShapeLayerCanvasBase::KisShapeLayerCanvasBase ( const KisShapeLayerCanvasBase & rhs,
KisShapeLayer * parent )

Definition at line 49 of file kis_shape_layer_canvas.cpp.

50 : KoCanvasBase(0)
54{
56 m_shapeManager->selection()->setActiveLayer(parent);
57}
void setImage(KisImageWSP image)

References m_shapeManager, m_viewConverter, and KisImageViewConverter::setImage().

Member Function Documentation

◆ addCommand()

void KisShapeLayerCanvasBase::addCommand ( KUndo2Command * command)
overridevirtual

Adds a command to the history. Call this for each command you create. This will also execute the command. This means, most of the application's code will look like MyCommand * cmd = new MyCommand( parameters ); canvas.addCommand( cmd );

Note that the command history takes ownership of the command, it will delete it when the undo limit is reached, or when deleting the command history itself.

Parameters
commandthe command to add

Implements KoCanvasBase.

Definition at line 97 of file kis_shape_layer_canvas.cpp.

98{
99 KIS_SAFE_ASSERT_RECOVER_NOOP(false); // This should never be called as this canvas should have no tools.
100}
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References KIS_SAFE_ASSERT_RECOVER_NOOP.

◆ canvasWidget() [1/2]

const QWidget * KisShapeLayerCanvasBase::canvasWidget ( ) const
overridevirtual

Return the widget that will be added to the scrollArea.

Implements KoCanvasBase.

Definition at line 114 of file kis_shape_layer_canvas.cpp.

115{
116 return 0;
117}

◆ canvasWidget() [2/2]

QWidget * KisShapeLayerCanvasBase::canvasWidget ( )
overridevirtual

Return the widget that will be added to the scrollArea.

Implements KoCanvasBase.

Definition at line 109 of file kis_shape_layer_canvas.cpp.

110{
111 return 0;
112}

◆ forceRepaint()

virtual void KisShapeLayerCanvasBase::forceRepaint ( )
pure virtual

◆ forceRepaintWithHiddenAreas()

virtual void KisShapeLayerCanvasBase::forceRepaintWithHiddenAreas ( )
inlinevirtual

Reimplemented in KisShapeLayerCanvas.

Definition at line 46 of file kis_shape_layer_canvas.h.

46{ forceRepaint(); }
virtual void forceRepaint()=0

References forceRepaint().

◆ gridSize()

void KisShapeLayerCanvasBase::gridSize ( QPointF * offset,
QSizeF * spacing ) const
overridevirtual

retrieve the grid size setting. The grid spacing will be provided in pt.

Parameters
horizontala pointer to a qreal that will be filled with the horizontal grid-spacing
verticala pointer to a qreal that will be filled with the vertical grid-spacing

Implements KoCanvasBase.

Definition at line 84 of file kis_shape_layer_canvas.cpp.

85{
86 KIS_SAFE_ASSERT_RECOVER_NOOP(false); // This should never be called as this canvas should have no tools.
87 Q_UNUSED(offset);
88 Q_UNUSED(spacing);
89}

References KIS_SAFE_ASSERT_RECOVER_NOOP.

◆ hasChangedWhileBeingInvisible()

bool KisShapeLayerCanvasBase::hasChangedWhileBeingInvisible ( )

◆ hasPendingUpdates()

virtual bool KisShapeLayerCanvasBase::hasPendingUpdates ( ) const
pure virtual

◆ prepareForDestroying()

void KisShapeLayerCanvasBase::prepareForDestroying ( )

Definition at line 125 of file kis_shape_layer_canvas.cpp.

126{
127 m_isDestroying = true;
128}

References m_isDestroying.

◆ projection()

virtual KisPaintDeviceSP KisShapeLayerCanvasBase::projection ( ) const
pure virtual

◆ rerenderAfterBeingInvisible()

virtual void KisShapeLayerCanvasBase::rerenderAfterBeingInvisible ( )
pure virtual

◆ resetCache()

virtual void KisShapeLayerCanvasBase::resetCache ( const KoColorSpace * colorSpace)
pure virtual

◆ selectedShapesProxy()

KoSelectedShapesProxy * KisShapeLayerCanvasBase::selectedShapesProxy ( ) const
overridevirtual

selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged() and selectionContentChanged() signals. While shapeManager() can change throughout the life time of the canvas, selectedShapesProxy() is guaranteed to stay the same.

Returns
persistent KoSelectedShapesProxy object

Implements KoCanvasBase.

Definition at line 69 of file kis_shape_layer_canvas.cpp.

70{
71 return m_selectedShapesProxy.data();
72}

References m_selectedShapesProxy.

◆ setCursor()

void KisShapeLayerCanvasBase::setCursor ( const QCursor & cursor)
inlineoverridevirtual

set the specified cursor on this canvas

Parameters
cursorthe new cursor
Returns
the old cursor

Implements KoCanvasBase.

Definition at line 64 of file kis_shape_layer_canvas.h.

64{}

◆ setImage()

void KisShapeLayerCanvasBase::setImage ( KisImageWSP image)
virtual

Reimplemented in KisShapeLayerCanvas.

Definition at line 59 of file kis_shape_layer_canvas.cpp.

60{
62}

References m_viewConverter, and KisImageViewConverter::setImage().

◆ shapeManager()

KoShapeManager * KisShapeLayerCanvasBase::shapeManager ( ) const
overridevirtual

Return the current shapeManager. WARNING: the shape manager can switch in time, e.g. when a layer is changed. Please don't keep any persistent connections to it. Instead please use selectedShapesProxy(), which is guaranteed to be the same throughout the life of the canvas.

Returns
the current shapeManager

Implements KoCanvasBase.

Definition at line 64 of file kis_shape_layer_canvas.cpp.

65{
66 return m_shapeManager.data();
67}

References m_shapeManager.

◆ snapToGrid()

bool KisShapeLayerCanvasBase::snapToGrid ( ) const
overridevirtual

return if snap to grid is enabled.

Returns
if snap to grid is enabled.

Implements KoCanvasBase.

Definition at line 91 of file kis_shape_layer_canvas.cpp.

92{
93 KIS_SAFE_ASSERT_RECOVER_NOOP(false); // This should never be called as this canvas should have no tools.
94 return false;
95}

References KIS_SAFE_ASSERT_RECOVER_NOOP.

◆ toolProxy()

KoToolProxy * KisShapeLayerCanvasBase::toolProxy ( ) const
overridevirtual

Return the proxy to the active tool (determining which tool is really, really active is hard when tablets are involved, so leave that to others.

Implements KoCanvasBase.

Definition at line 103 of file kis_shape_layer_canvas.cpp.

104{
105// KIS_SAFE_ASSERT_RECOVER_NOOP(false); // This should never be called as this canvas should have no tools.
106 return 0;
107}

◆ unit()

KoUnit KisShapeLayerCanvasBase::unit ( ) const
overridevirtual

Return the unit of the current document for initialization of the widgets created by the flake framework.

See also
KoDocument::unit()

Implements KoCanvasBase.

Definition at line 119 of file kis_shape_layer_canvas.cpp.

120{
121 KIS_SAFE_ASSERT_RECOVER_NOOP(false); // This should never be called as this canvas should have no tools.
122 return KoUnit(KoUnit::Point);
123}
@ Point
Postscript point, 1/72th of an Inco.
Definition KoUnit.h:76

References KIS_SAFE_ASSERT_RECOVER_NOOP, and KoUnit::Point.

◆ viewConverter() [1/2]

const KoViewConverter * KisShapeLayerCanvasBase::viewConverter ( ) const
overridevirtual

Return the viewConverter for this view.

Returns
the viewConverter for this view.

Implements KoCanvasBase.

Definition at line 74 of file kis_shape_layer_canvas.cpp.

75{
76 return &m_viewConverter;
77}

References m_viewConverter.

◆ viewConverter() [2/2]

KoViewConverter * KisShapeLayerCanvasBase::viewConverter ( )
overridevirtual

Implements KoCanvasBase.

Definition at line 79 of file kis_shape_layer_canvas.cpp.

80{
81 return &m_viewConverter;
82}

References m_viewConverter.

Member Data Documentation

◆ m_hasChangedWhileBeingInvisible

bool KisShapeLayerCanvasBase::m_hasChangedWhileBeingInvisible {false}
protected

Definition at line 69 of file kis_shape_layer_canvas.h.

69{false};

◆ m_isDestroying

bool KisShapeLayerCanvasBase::m_isDestroying {false}
protected

Definition at line 70 of file kis_shape_layer_canvas.h.

70{false};

◆ m_selectedShapesProxy

QScopedPointer<KoSelectedShapesProxy> KisShapeLayerCanvasBase::m_selectedShapesProxy
protected

Definition at line 68 of file kis_shape_layer_canvas.h.

◆ m_shapeManager

QScopedPointer<KoShapeManager> KisShapeLayerCanvasBase::m_shapeManager
protected

Definition at line 67 of file kis_shape_layer_canvas.h.

◆ m_viewConverter

KisImageViewConverter KisShapeLayerCanvasBase::m_viewConverter
protected

Definition at line 72 of file kis_shape_layer_canvas.h.


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