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

#include <kis_mask_projection_plane.h>

+ Inheritance diagram for KisMaskProjectionPlane:

Classes

struct  Private
 

Public Member Functions

QRect accessRect (const QRect &rect, KisNode::PositionToFilthy pos) const override
 
void apply (KisPainter *painter, const QRect &rect) override
 
QRect changeRect (const QRect &rect, KisNode::PositionToFilthy pos) const override
 
KisPaintDeviceList getLodCapableDevices () const override
 
 KisMaskProjectionPlane (KisMask *mask)
 
QRect looseUserVisibleBounds () const override
 
QRect needRect (const QRect &rect, KisNode::PositionToFilthy pos) const override
 
QRect needRectForOriginal (const QRect &rect) const override
 
QRect recalculate (const QRect &rect, KisNodeSP filthyNode, KisRenderPassFlags flags) override
 
QRect tightUserVisibleBounds () const override
 
 ~KisMaskProjectionPlane () override
 
- Public Member Functions inherited from KisAbstractProjectionPlane
 KisAbstractProjectionPlane ()
 
virtual ~KisAbstractProjectionPlane ()
 

Private Attributes

const QScopedPointer< Privatem_d
 

Detailed Description

An implementation of the KisAbstractProjectionPlane interface for a layer object.

Please note that recalculate() and apply() methods are not defined for masks, because the KisLayer code still uses traditional methods of KisMask directly.

Definition at line 22 of file kis_mask_projection_plane.h.

Constructor & Destructor Documentation

◆ KisMaskProjectionPlane()

KisMaskProjectionPlane::KisMaskProjectionPlane ( KisMask * mask)

Definition at line 21 of file kis_mask_projection_plane.cpp.

22 : m_d(new Private)
23{
24 m_d->mask = mask;
25}
const QScopedPointer< Private > m_d

References m_d.

◆ ~KisMaskProjectionPlane()

KisMaskProjectionPlane::~KisMaskProjectionPlane ( )
override

Definition at line 27 of file kis_mask_projection_plane.cpp.

28{
29}

Member Function Documentation

◆ accessRect()

QRect KisMaskProjectionPlane::accessRect ( const QRect & rect,
KisNode::PositionToFilthy pos ) const
overridevirtual

Works like KisNode::needRect(), but includes more transformations of the layer

Implements KisAbstractProjectionPlane.

Definition at line 65 of file kis_mask_projection_plane.cpp.

66{
67 return m_d->mask->accessRect(rect, pos);
68}

References m_d.

◆ apply()

void KisMaskProjectionPlane::apply ( KisPainter * painter,
const QRect & rect )
overridevirtual

Writes the data of the projection plane onto a global projection using painter object.

Implements KisAbstractProjectionPlane.

Definition at line 41 of file kis_mask_projection_plane.cpp.

42{
43 Q_UNUSED(painter);
44 Q_UNUSED(rect);
45
46 KIS_ASSERT_RECOVER_NOOP(0 && "KisMaskProjectionPlane::apply() is not defined!");
47}
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97

References KIS_ASSERT_RECOVER_NOOP.

◆ changeRect()

QRect KisMaskProjectionPlane::changeRect ( const QRect & rect,
KisNode::PositionToFilthy pos ) const
overridevirtual

Works like KisNode::changeRect(), but includes more transformations of the layer

Implements KisAbstractProjectionPlane.

Definition at line 60 of file kis_mask_projection_plane.cpp.

61{
62 return m_d->mask->changeRect(rect, pos);
63}

References m_d.

◆ getLodCapableDevices()

KisPaintDeviceList KisMaskProjectionPlane::getLodCapableDevices ( ) const
overridevirtual

Returns a list of devices which should synchronize the lod cache on update

Implements KisAbstractProjectionPlane.

Definition at line 49 of file kis_mask_projection_plane.cpp.

50{
51 // masks have no projection
52 return KisPaintDeviceList();
53}
QList< KisPaintDeviceSP > KisPaintDeviceList
Definition kis_types.h:267

◆ looseUserVisibleBounds()

QRect KisMaskProjectionPlane::looseUserVisibleBounds ( ) const
overridevirtual

Return an approximate (loose) rectangle, where the contents of the plane is placed from user's point of view. It includes everything belonging to the plane (e.g. layer styles).

This rectangle contains or is bigger than the rectangle returned by tightUserVisibleBounds().

Implements KisAbstractProjectionPlane.

Definition at line 82 of file kis_mask_projection_plane.cpp.

83{
84 // masks don't have anything complex inside, so just
85 // so just return the extent of the mask
86 return m_d->mask->extent();
87}

References m_d.

◆ needRect()

QRect KisMaskProjectionPlane::needRect ( const QRect & rect,
KisNode::PositionToFilthy pos ) const
overridevirtual

Works like KisNode::needRect(), but includes more transformations of the layer

Implements KisAbstractProjectionPlane.

Definition at line 55 of file kis_mask_projection_plane.cpp.

56{
57 return m_d->mask->needRect(rect, pos);
58}

References m_d.

◆ needRectForOriginal()

QRect KisMaskProjectionPlane::needRectForOriginal ( const QRect & rect) const
overridevirtual

Works like KisLayer::needRectForOriginal(), but includes needed rects of layer styles

Implements KisAbstractProjectionPlane.

Definition at line 70 of file kis_mask_projection_plane.cpp.

71{
72 return rect;
73}

◆ recalculate()

QRect KisMaskProjectionPlane::recalculate ( const QRect & rect,
KisNodeSP filthyNode,
KisRenderPassFlags flags )
overridevirtual

Is called by the async merger when the node is filthy and should recalculate its internal representation. For usual layers it means just calling updateProjection().

Implements KisAbstractProjectionPlane.

Definition at line 31 of file kis_mask_projection_plane.cpp.

32{
33 Q_UNUSED(filthyNode);
34 Q_UNUSED(flags);
35
36 KIS_ASSERT_RECOVER_NOOP(0 && "KisMaskProjectionPlane::recalculate() is not defined!");
37
38 return rect;
39}

References KIS_ASSERT_RECOVER_NOOP.

◆ tightUserVisibleBounds()

QRect KisMaskProjectionPlane::tightUserVisibleBounds ( ) const
overridevirtual

Return a tight rectangle, where the contents of the plane is placed from user's point of view. It includes everything belonging to the plane (e.g. layer styles).

Implements KisAbstractProjectionPlane.

Definition at line 75 of file kis_mask_projection_plane.cpp.

76{
77 // masks don't have any internal rendering subtrees,
78 // so just return the exact bounds of the mask
79 return m_d->mask->exactBounds();
80}

References m_d.

Member Data Documentation

◆ m_d

const QScopedPointer<Private> KisMaskProjectionPlane::m_d
private

Definition at line 42 of file kis_mask_projection_plane.h.


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