Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_exr_layers_sorter.cpp File Reference
#include "kis_exr_layers_sorter.h"
#include <QDomDocument>
#include <QDomElement>
#include "kis_image.h"
#include "exr_extra_tags.h"
#include "kis_kra_savexml_visitor.h"
#include "kis_paint_layer.h"

Go to the source code of this file.

Classes

struct  CompareNodesFunctor
 
struct  KisExrLayersSorter::Private
 

Functions

template<typename T >
fetchMapValueLazy (const QMap< QString, T > &map, QString path)
 
QString getNodePath (KisNodeSP node)
 

Function Documentation

◆ fetchMapValueLazy()

template<typename T >
T fetchMapValueLazy ( const QMap< QString, T > & map,
QString path )

Definition at line 72 of file kis_exr_layers_sorter.cpp.

73{
74 if (map.contains(path)) return map[path];
75
76
77 typename QMap<QString, T>::const_iterator it = map.constBegin();
78 typename QMap<QString, T>::const_iterator end = map.constEnd();
79
80 for (; it != end; ++it) {
81 if (it.key().startsWith(path)) {
82 return it.value();
83 }
84 }
85
86 return T();
87}

◆ getNodePath()

QString getNodePath ( KisNodeSP node)

Definition at line 36 of file kis_exr_layers_sorter.cpp.

36 {
37 KIS_ASSERT_RECOVER(node) { return "UNDEFINED"; }
38
39 QString path;
40
41 KisNodeSP parentNode = node->parent();
42 while(parentNode) {
43 if (!path.isEmpty()) {
44 path.prepend(".");
45 }
46 path.prepend(node->name());
47
48 node = parentNode;
49 parentNode = node->parent();
50 }
51
52 return path;
53}
#define KIS_ASSERT_RECOVER(cond)
Definition kis_assert.h:55
QString name() const
KisNodeWSP parent
Definition kis_node.cpp:86

References KIS_ASSERT_RECOVER, KisBaseNode::name(), and KisNode::parent.