|
Krita Source Code Documentation
|
#include <kis_node_shapes_graph.h>
Public Member Functions | |
| KisNodeShape * | addNode (KisNodeSP node, KisNodeSP parent, KisNodeSP aboveThis) |
| bool | containsNode (KisNodeSP node) const |
| void | moveNode (KisNodeSP node, KisNodeSP parent, KisNodeSP aboveThis) |
| KisNodeDummy * | nodeToDummy (KisNodeSP node) |
| KisNodeShape * | nodeToShape (KisNodeSP node) |
| void | removeNode (KisNodeSP node) |
| KisNodeDummy * | rootDummy () const |
| int | shapesCount () const |
Private Member Functions | |
| void | unmapDummyRecursively (KisNodeDummy *dummy) |
Private Attributes | |
| KisNodeDummiesGraph | m_dummiesGraph |
KisNodeShapesGraph is a highlevel simplified representation of nodes in the node stack. It stores hierarchy information about graph without accessing real node graph.
Takes ownership on both dummies and node shapes.
Definition at line 29 of file kis_node_shapes_graph.h.
| KisNodeShape * KisNodeShapesGraph::addNode | ( | KisNodeSP | node, |
| KisNodeSP | parent, | ||
| KisNodeSP | aboveThis ) |
Adds a node to the graph
WARNING: this method does not add all the children recursively because the shapes graph has no right to access the hierarchy information from the UI thread, so you should do it manually.
Definition at line 12 of file kis_node_shapes_graph.cpp.
References KisNodeDummiesGraph::addNode(), m_dummiesGraph, KisNodeShape::node(), KisNodeDummy::nodeShape(), and nodeToDummy().
| bool KisNodeShapesGraph::containsNode | ( | KisNodeSP | node | ) | const |
Definition at line 82 of file kis_node_shapes_graph.cpp.
References KisNodeDummiesGraph::containsNode(), and m_dummiesGraph.
Moves a node inside the graph. It is supposed that the node has previously been added to the graph using addNode().
The node is moved together with all its children.
Definition at line 37 of file kis_node_shapes_graph.cpp.
References m_dummiesGraph, KisNodeDummiesGraph::moveNode(), and nodeToDummy().
| KisNodeDummy * KisNodeShapesGraph::nodeToDummy | ( | KisNodeSP | node | ) |
Definition at line 68 of file kis_node_shapes_graph.cpp.
References m_dummiesGraph, and KisNodeDummiesGraph::nodeToDummy().
| KisNodeShape * KisNodeShapesGraph::nodeToShape | ( | KisNodeSP | node | ) |
Definition at line 73 of file kis_node_shapes_graph.cpp.
References KisNodeDummy::nodeShape(), and nodeToDummy().
Removes the node from the graph
Removing the node from the graph removes both the node itself and all its children, because all this information is accessible to the shapes graph without referring to the node's hierarchy information owned by the image.
The shapes remove their children automatically, so the dummies do not own them. Delete them manually.
Definition at line 46 of file kis_node_shapes_graph.cpp.
References m_dummiesGraph, KisNodeDummy::nodeShape(), nodeToDummy(), KisNodeDummiesGraph::removeNode(), and KoShape::setParent().
| KisNodeDummy * KisNodeShapesGraph::rootDummy | ( | ) | const |
Definition at line 63 of file kis_node_shapes_graph.cpp.
References m_dummiesGraph, and KisNodeDummiesGraph::rootDummy().
| int KisNodeShapesGraph::shapesCount | ( | ) | const |
Definition at line 87 of file kis_node_shapes_graph.cpp.
References KisNodeDummiesGraph::dummiesCount(), and m_dummiesGraph.
|
private |
|
private |
Definition at line 70 of file kis_node_shapes_graph.h.