def showNodesWin(self):
     nodeWin = GraphViewWidget()
     global graph
     graph = GraphView(parent=nodeWin)
     nodeWin.setGraphView(graph)
     nodeWin.show()
Exemple #2
0
    imp.find_module('pyflowgraph')
    found = True
except ImportError:
    import os, sys
    sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..")))

from pyflowgraph.graph_view import GraphView
from pyflowgraph.graph_view_widget import GraphViewWidget
from pyflowgraph.node import Node
from pyflowgraph.port import InputPort, OutputPort, IOPort

print GraphView

app = QtGui.QApplication(sys.argv)

widget = GraphViewWidget()
graph = GraphView(parent=widget)

# generate a diamod shape graph.
totalCount = 0
def generateNodes(count, offset, depth):
    for i in range(count):
        node1 = Node(graph, 'node' + str(depth) + str(i))
        node1.addPort(InputPort(node1, graph, 'InPort', QtGui.QColor(128, 170, 170, 255), 'MyDataX'))
        node1.addPort(OutputPort(node1, graph, 'OutPort', QtGui.QColor(32, 255, 32, 255), 'MyDataX'))
        node1.setGraphPos(QtCore.QPointF(offset, i * 80 ))

        graph.addNode(node1)

        global totalCount
        totalCount += 1