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

#include <ShapeLayerTypeCheck.h>

+ Inheritance diagram for ShapeLayerTypeCheckVisitor:

Public Member Functions

quint32 count ()
 
 ShapeLayerTypeCheckVisitor (QString shapeId, QString pathId)
 
bool visit (KisAdjustmentLayer *) override
 
virtual bool visit (KisAdjustmentLayer *layer)=0
 
bool visit (KisCloneLayer *) override
 
virtual bool visit (KisCloneLayer *layer)=0
 
bool visit (KisColorizeMask *) override
 
virtual bool visit (KisColorizeMask *mask)=0
 
bool visit (KisExternalLayer *layer) override
 
virtual bool visit (KisExternalLayer *layer)=0
 
bool visit (KisFilterMask *) override
 
virtual bool visit (KisFilterMask *mask)=0
 
bool visit (KisGeneratorLayer *) override
 
virtual bool visit (KisGeneratorLayer *layer)=0
 
bool visit (KisGroupLayer *layer) override
 
virtual bool visit (KisGroupLayer *layer)=0
 
bool visit (KisNode *) override
 
virtual bool visit (KisNode *node)=0
 
bool visit (KisPaintLayer *) override
 
virtual bool visit (KisPaintLayer *layer)=0
 
bool visit (KisSelectionMask *) override
 
virtual bool visit (KisSelectionMask *mask)=0
 
bool visit (KisTransformMask *) override
 
virtual bool visit (KisTransformMask *mask)=0
 
bool visit (KisTransparencyMask *) override
 
virtual bool visit (KisTransparencyMask *mask)=0
 
- Public Member Functions inherited from KisNodeVisitor
 KisNodeVisitor ()
 
virtual ~KisNodeVisitor ()
 

Private Member Functions

bool check (QList< KoShape * > shapes)
 

Private Attributes

quint32 m_count
 
const QString m_pathShapeId
 
const QString m_shapeId
 

Additional Inherited Members

- Protected Member Functions inherited from KisNodeVisitor
bool visitAll (KisNode *node, bool breakOnFail=false)
 
bool visitAllInverse (KisNode *node, bool breakOnFail=false)
 

Detailed Description

Definition at line 23 of file ShapeLayerTypeCheck.h.

Constructor & Destructor Documentation

◆ ShapeLayerTypeCheckVisitor()

ShapeLayerTypeCheckVisitor::ShapeLayerTypeCheckVisitor ( QString shapeId,
QString pathId )
inline

Definition at line 29 of file ShapeLayerTypeCheck.h.

30 : m_count(0)
31 , m_shapeId(shapeId)
32 , m_pathShapeId(pathId)
33 {
34 }

Member Function Documentation

◆ check()

bool ShapeLayerTypeCheckVisitor::check ( QList< KoShape * > shapes)
inlineprivate

Definition at line 75 of file ShapeLayerTypeCheck.h.

75 {
76 Q_FOREACH(KoShape* shape, shapes) {
77 if (KoShapeGroup *group = dynamic_cast<KoShapeGroup*>(shape)) {
78 // ShapeGroups have no id...
79 if (m_shapeId == "KoShapeGroup") {
80 m_count ++;
81 }
82 check(group->shapes());
83 } else if (KoPathShape *path = dynamic_cast<KoPathShape*>(shape)) {
84 if (!m_pathShapeId.isEmpty()) {
85 if (path->pathShapeId() == m_pathShapeId
86 && m_shapeId == path->shapeId()) {
87 m_count ++;
88 }
89 } else if (m_shapeId == path->shapeId()) {
90 m_count ++;
91 }
92 } else if (m_shapeId == shape->shapeId()) {
93 m_count ++;
94 }
95 }
96 return true;
97 }
The position of a path point within a path shape.
Definition KoPathShape.h:63
QString shapeId() const
Definition KoShape.cpp:1057
bool check(QList< KoShape * > shapes)

References check(), m_count, m_pathShapeId, m_shapeId, and KoShape::shapeId().

◆ count()

quint32 ShapeLayerTypeCheckVisitor::count ( )
inline

Definition at line 36 of file ShapeLayerTypeCheck.h.

36 {
37 return m_count;
38 }

References m_count.

◆ visit() [1/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisAdjustmentLayer * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 49 of file ShapeLayerTypeCheck.h.

49{return true;}

◆ visit() [2/24]

virtual bool KisNodeVisitor::visit ( KisAdjustmentLayer * layer)
virtual

Implements KisNodeVisitor.

◆ visit() [3/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisCloneLayer * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 58 of file ShapeLayerTypeCheck.h.

58{return true;}

◆ visit() [4/24]

virtual bool KisNodeVisitor::visit ( KisCloneLayer * layer)
virtual

Implements KisNodeVisitor.

◆ visit() [5/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisColorizeMask * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 70 of file ShapeLayerTypeCheck.h.

70{return true;}

◆ visit() [6/24]

virtual bool KisNodeVisitor::visit ( KisColorizeMask * mask)
virtual

Implements KisNodeVisitor.

◆ visit() [7/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisExternalLayer * layer)
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 51 of file ShapeLayerTypeCheck.h.

51 {
52 if (KoShapeLayer *shapeLayer = dynamic_cast<KoShapeLayer*>(layer)) {
53 check(shapeLayer->shapes());
54 }
55 return true;
56 }

References check().

◆ visit() [8/24]

virtual bool KisNodeVisitor::visit ( KisExternalLayer * layer)
virtual

Implements KisNodeVisitor.

◆ visit() [9/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisFilterMask * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 62 of file ShapeLayerTypeCheck.h.

62{return true;}

◆ visit() [10/24]

virtual bool KisNodeVisitor::visit ( KisFilterMask * mask)
virtual

Implements KisNodeVisitor.

◆ visit() [11/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisGeneratorLayer * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 60 of file ShapeLayerTypeCheck.h.

60{return true;}

◆ visit() [12/24]

virtual bool KisNodeVisitor::visit ( KisGeneratorLayer * layer)
virtual

Implements KisNodeVisitor.

◆ visit() [13/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisGroupLayer * layer)
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 44 of file ShapeLayerTypeCheck.h.

44 {
45 return visitAll(layer);
46 }
bool visitAll(KisNode *node, bool breakOnFail=false)

References KisNodeVisitor::visitAll().

◆ visit() [14/24]

virtual bool KisNodeVisitor::visit ( KisGroupLayer * layer)
virtual

Implements KisNodeVisitor.

◆ visit() [15/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisNode * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 40 of file ShapeLayerTypeCheck.h.

40{return true;}

◆ visit() [16/24]

virtual bool KisNodeVisitor::visit ( KisNode * node)
virtual

Implements KisNodeVisitor.

◆ visit() [17/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisPaintLayer * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 42 of file ShapeLayerTypeCheck.h.

42{return true;}

◆ visit() [18/24]

virtual bool KisNodeVisitor::visit ( KisPaintLayer * layer)
virtual

Implements KisNodeVisitor.

◆ visit() [19/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisSelectionMask * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 68 of file ShapeLayerTypeCheck.h.

68{return true;}

◆ visit() [20/24]

virtual bool KisNodeVisitor::visit ( KisSelectionMask * mask)
virtual

Implements KisNodeVisitor.

◆ visit() [21/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisTransformMask * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 64 of file ShapeLayerTypeCheck.h.

64{return true;}

◆ visit() [22/24]

virtual bool KisNodeVisitor::visit ( KisTransformMask * mask)
virtual

Implements KisNodeVisitor.

◆ visit() [23/24]

bool ShapeLayerTypeCheckVisitor::visit ( KisTransparencyMask * )
inlineoverridevirtual

Implements KisNodeVisitor.

Definition at line 66 of file ShapeLayerTypeCheck.h.

66{return true;}

◆ visit() [24/24]

virtual bool KisNodeVisitor::visit ( KisTransparencyMask * mask)
virtual

Implements KisNodeVisitor.

Member Data Documentation

◆ m_count

quint32 ShapeLayerTypeCheckVisitor::m_count
private

Definition at line 99 of file ShapeLayerTypeCheck.h.

◆ m_pathShapeId

const QString ShapeLayerTypeCheckVisitor::m_pathShapeId
private

Definition at line 101 of file ShapeLayerTypeCheck.h.

◆ m_shapeId

const QString ShapeLayerTypeCheckVisitor::m_shapeId
private

Definition at line 100 of file ShapeLayerTypeCheck.h.


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