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

#include <kis_default_bounds_node_wrapper.h>

+ Inheritance diagram for KisDefaultBoundsNodeWrapper:

Public Member Functions

QRect bounds () const override
 
int currentLevelOfDetail () const override
 
int currentTime () const override
 
bool externalFrameActive () const override
 
QRect imageBorderRect () const override
 
 KisDefaultBoundsNodeWrapper (KisBaseNodeWSP node=0)
 
 KisDefaultBoundsNodeWrapper (KisDefaultBoundsNodeWrapper &rhs)
 
voidsourceCookie () const override
 
bool wrapAroundMode () const override
 
WrapAroundAxis wrapAroundModeAxis () const override
 
 ~KisDefaultBoundsNodeWrapper () override
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 
- Public Member Functions inherited from KisDefaultBoundsBase
virtual ~KisDefaultBoundsBase ()
 
- Public Member Functions inherited from KisShared
bool deref ()
 
bool ref ()
 
int refCount ()
 
QAtomicInt * sharedWeakReference ()
 

Public Attributes

KisBaseNodeWSP node
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Static Public Attributes

static const QRect infiniteRect
 

Private Attributes

Privatem_d
 

Additional Inherited Members

- Protected Member Functions inherited from KisShared
 KisShared ()
 
 ~KisShared ()
 

Detailed Description

Definition at line 10 of file kis_default_bounds_node_wrapper.cpp.

Constructor & Destructor Documentation

◆ KisDefaultBoundsNodeWrapper() [1/2]

KisDefaultBoundsNodeWrapper::KisDefaultBoundsNodeWrapper ( KisBaseNodeWSP node = 0)

◆ KisDefaultBoundsNodeWrapper() [2/2]

KisDefaultBoundsNodeWrapper::KisDefaultBoundsNodeWrapper ( KisDefaultBoundsNodeWrapper & rhs)

Definition at line 23 of file kis_default_bounds_node_wrapper.cpp.

23 :
24 m_d(new Private())
25{
26 m_d->node = rhs.m_d->node;
27}

References m_d.

◆ ~KisDefaultBoundsNodeWrapper()

KisDefaultBoundsNodeWrapper::~KisDefaultBoundsNodeWrapper ( )
override

Definition at line 29 of file kis_default_bounds_node_wrapper.cpp.

30{
31 delete m_d;
32}

References m_d.

Member Function Documentation

◆ bounds()

QRect KisDefaultBoundsNodeWrapper::bounds ( ) const
overridevirtual

Returns a virtual bounding rect of a paint device. E.g. when a paint device has non-transparent default pixel, its virtual bounds extend much wider than the actual data it contains.

This bounds rectangle should be used in all the cases when one wants to process all the non-existing pixels with default value, which may still be visible to the user.

The returned rect usually equals to the bounds of the image, except of a few special cases for selections.

Example:

KisPaintDevice adds defaultBounds->bounds() to its extent() and exactBounds() when its default pixel is non-transparent.

Implements KisDefaultBoundsBase.

Definition at line 34 of file kis_default_bounds_node_wrapper.cpp.

35{
36 return m_d->node->original() ? m_d->node->original()->defaultBounds()->bounds() : KisDefaultBoundsNodeWrapper::infiniteRect;
37}

References infiniteRect, and m_d.

◆ currentLevelOfDetail()

int KisDefaultBoundsNodeWrapper::currentLevelOfDetail ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 54 of file kis_default_bounds_node_wrapper.cpp.

55{
56 return m_d->node && m_d->node->image() ? m_d->node->image()->currentLevelOfDetail() : 0;
57}

References m_d.

◆ currentTime()

int KisDefaultBoundsNodeWrapper::currentTime ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 59 of file kis_default_bounds_node_wrapper.cpp.

60{
61 const int time = m_d->node && m_d->node->image() ? m_d->node->image()->animationInterface()->currentTime() : 0;
62 return time;
63}

References m_d.

◆ externalFrameActive()

bool KisDefaultBoundsNodeWrapper::externalFrameActive ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 65 of file kis_default_bounds_node_wrapper.cpp.

66{
67 return m_d->node->original() ? m_d->node->original()->defaultBounds()->externalFrameActive() : false;
68}

References m_d.

◆ imageBorderRect()

QRect KisDefaultBoundsNodeWrapper::imageBorderRect ( ) const
overridevirtual

Returns the rectangle of the official image size. This rect is used for wrapping the device in wrap-around mode and in some specific operations.

NOTE: don't use it unless you know what you are doing, most probably you want to use bounds() instead!

Reimplemented from KisDefaultBoundsBase.

Definition at line 39 of file kis_default_bounds_node_wrapper.cpp.

40{
41 return m_d->node && m_d->node->image() ? m_d->node->image()->bounds() : KisDefaultBoundsNodeWrapper::infiniteRect;
42}

References infiniteRect, and m_d.

◆ sourceCookie()

void * KisDefaultBoundsNodeWrapper::sourceCookie ( ) const
overridevirtual

Return an abstract pointer to the source object, where default bounds takes its data from. It the cookie is nullptr, then the default bounds is not connected to anything. One can also compare if two default bounds are connected to the same source by comparing two pointers.

NOTE: It is intended to be used for debugging purposes only!

Implements KisDefaultBoundsBase.

Definition at line 70 of file kis_default_bounds_node_wrapper.cpp.

71{
72 return m_d->node->original() ? m_d->node->original()->defaultBounds()->sourceCookie() : nullptr;
73}

References m_d.

◆ wrapAroundMode()

bool KisDefaultBoundsNodeWrapper::wrapAroundMode ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 44 of file kis_default_bounds_node_wrapper.cpp.

45{
46 return m_d->node && m_d->node->image() ? m_d->node->image()->wrapAroundModeActive() : false;
47}

References m_d.

◆ wrapAroundModeAxis()

WrapAroundAxis KisDefaultBoundsNodeWrapper::wrapAroundModeAxis ( ) const
overridevirtual

Implements KisDefaultBoundsBase.

Definition at line 49 of file kis_default_bounds_node_wrapper.cpp.

50{
51 return m_d->node && m_d->node->image() ? m_d->node->image()->wrapAroundModeAxis() : WRAPAROUND_BOTH;
52}
@ WRAPAROUND_BOTH

References m_d, and WRAPAROUND_BOTH.

Member Data Documentation

◆ infiniteRect

const QRect KisDefaultBoundsNodeWrapper::infiniteRect
static
Initial value:
=
const qint32 qint32_MIN
Definition kis_global.h:30
const qint32 qint32_MAX
Definition kis_global.h:29

Definition at line 31 of file kis_default_bounds_node_wrapper.h.

◆ m_d

Private* KisDefaultBoundsNodeWrapper::m_d
private

Definition at line 35 of file kis_default_bounds_node_wrapper.h.

◆ node

KisBaseNodeWSP KisDefaultBoundsNodeWrapper::node

Definition at line 11 of file kis_default_bounds_node_wrapper.cpp.


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