Rumba C++ SDK
NodePlugin.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2018
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include "Export.h"
18 #include "Node.h"
19 
20  namespace maquina
21  {
22  class Plug;
23  class Value;
24  class Modifier;
25  class NodeSet;
26 
29  {
30  public:
31  NodePlugin (Node *node) : _node(node->_impl) {}
32  virtual ~NodePlugin() {}
33 
35 
37  virtual void on_first_init(bool /*undo_stack*/) {};
38 
40 
44  virtual void on_delete(bool /*undo_stack*/) {};
45 
47 
54  virtual void on_add_to_document() {};
55 
57 
64  virtual void on_remove_from_document() {};
65 
67 
70  virtual void on_input_connection(const Plug& /*output*/, const Plug& /*input*/, bool /*serial*/) {};
72 
75  virtual void on_output_connection(const Plug& /*output*/, const Plug& /*input*/, bool /*serial*/) {};
77 
80  virtual void on_input_disconnection(const Plug& /*output*/, const Plug& /*input*/) {};
82 
85  virtual void on_output_disconnection(const Plug& /*output*/, const Plug& /*input*/) {};
86 
88 
91  virtual void relationship(NodeSet& set) const;
92 
94 
95  virtual std::shared_ptr<NodeDelegate> node_delegate() const;
96 
98  Node node() const
99  {
100  return _node.lock();
101  }
102 
104 
107  virtual std::string selection_path() const;
108 
109  private:
110  std::weak_ptr<Impl> _node;
111  };
112  }
Definition: NodeSet.h:21
NodePlugin(Node *node)
Definition: NodePlugin.h:31
virtual void on_delete(bool)
Prepare the node to be deleted.
Definition: NodePlugin.h:44
Node node() const
Returns the Node interface for this object.
Definition: NodePlugin.h:98
virtual void on_input_connection(const Plug &, const Plug &, bool)
Callback called when an a connection has been done between an output plug and a plug of this node as ...
Definition: NodePlugin.h:70
Derive this class to create your own Node type.
Definition: NodePlugin.h:28
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
virtual void on_output_disconnection(const Plug &, const Plug &)
Callback called when an a connection has been broken between a plug of this node as output and an inp...
Definition: NodePlugin.h:85
virtual void on_input_disconnection(const Plug &, const Plug &)
Callback called when an a connection has been broken between an output plug and a plug of this node a...
Definition: NodePlugin.h:80
virtual void on_add_to_document()
Callback called when the node is added to the document.
Definition: NodePlugin.h:54
#define MAQUINA_EXPORT
Definition: Export.h:31
A node plug.
Definition: Plug.h:52
virtual ~NodePlugin()
Definition: NodePlugin.h:32
virtual void on_remove_from_document()
Callback called when the node is removed from the document.
Definition: NodePlugin.h:64
virtual void on_output_connection(const Plug &, const Plug &, bool)
Callback called when an a connection has been done between a plug of this node as output and an input...
Definition: NodePlugin.h:75
virtual void on_first_init(bool)
Perform the one shot initialization tasks for this node.
Definition: NodePlugin.h:37
Base class of all Rumba nodes.
Definition: Node.h:36