@@ -22,24 +22,53 @@ class NodeObject(object):
2222
2323 Args:
2424 qgraphics_item (AbstractNodeItem): QGraphicsItem item used for drawing.
25-
26- .. code-block:: python
27-
28- # snippet taken from the NodeGraphQt.BaseNode class.
29-
30- class BaseNode(NodeObject):
31-
32- def __init__(self, qgraphics_item=None):
33- qgraphics_item = qgraphics_item or NodeItem
34- super(BaseNode, self).__init__(qgraphics_views)
35-
3625 """
3726
38- # Unique node identifier domain. `eg.` ``"io.github.jchanvfx"``
3927 __identifier__ = 'nodeGraphQt.nodes'
28+ """
29+ Unique node identifier domain. eg. ``"io.github.jchanvfx"``
30+
31+ .. important:: re-implement this attribute to provide a unique node type.
32+
33+ .. code-block:: python
34+ :linenos:
35+
36+ from NodeGraphQt import NodeObject
37+
38+ class ExampleNode(NodeObject):
39+
40+ # unique node identifier domain.
41+ __identifier__ = 'io.jchanvfx.github'
42+
43+ def __init__(self):
44+ ...
45+
46+ :return: node type domain.
47+ :rtype: str
48+ """
4049
41- # Base node name.
4250 NODE_NAME = None
51+ """
52+ Initial base node name.
53+
54+ .. important:: re-implement this attribute to provide a base node name.
55+
56+ .. code-block:: python
57+ :linenos:
58+
59+ from NodeGraphQt import NodeObject
60+
61+ class ExampleNode(NodeObject):
62+
63+ # initial default node name.
64+ NODE_NAME = 'Example Node'
65+
66+ def __init__(self):
67+ ...
68+
69+ :return: node name
70+ :rtype: str
71+ """
4372
4473 def __init__ (self , qgraphics_item = None ):
4574 """
@@ -71,10 +100,10 @@ def __repr__(self):
71100 def type_ (cls ):
72101 """
73102 Node type identifier followed by the class name.
74- `eg.` ``"com.chantacticvfx .NodeObject"``
103+ `eg.` ``"nodeGraphQt.nodes .NodeObject"``
75104
76105 Returns:
77- str: node type.
106+ str: node type (``__identifier__.__className__``)
78107 """
79108 return cls .__identifier__ + '.' + cls .__name__
80109
@@ -84,7 +113,7 @@ def id(self):
84113 The node unique id.
85114
86115 Returns:
87- str: unique id string.
116+ str: unique identifier string to the node .
88117 """
89118 return self .model .id
90119
@@ -94,7 +123,7 @@ def graph(self):
94123 The parent node graph.
95124
96125 Returns:
97- NodeGraphQt.NodeGraph: node graph.
126+ NodeGraphQt.NodeGraph: node graph instance .
98127 """
99128 return self ._graph
100129
0 commit comments