Ejemplo n.º 1
0
    def initUI(self):
        self.setGeometry(200, 200, 800, 800)
        self.layout = QVBoxLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.layout)

        self.scene = Scene()
        self.grScene = self.scene.grScene

        self.view = QDMGraphicsView(self.grScene, self)
        self.layout.addWidget(self.view)

        node1 = Node(self.scene, "First Node", inputs=[1, 1, 1],
                     outputs=[1])  # 数字代表 socket 类型, socket index 按数组顺序
        node2 = Node(self.scene, "Second Node", inputs=[1, 1, 1], outputs=[1])
        node3 = Node(self.scene, "Third Node", inputs=[1, 1, 1], outputs=[1])
        node1.setPos(-350, 100)
        node2.setPos(-75, 0)
        node3.setPos(200, -100)

        edge1 = Edge(self.scene, node1.outputs[0], node2.inputs[0],
                     EDGE_TYPE_BEZIER)
        edge2 = Edge(self.scene, node2.outputs[0], node3.inputs[1],
                     EDGE_TYPE_BEZIER)

        self.setWindowTitle("Node Editor")
        self.show()
Ejemplo n.º 2
0
    def addNodes(self):
        node1 = Node(self.scene,
                     "My Awesome Node 1",
                     inputs=[0, 0, 0],
                     outputs=[1])
        node2 = Node(self.scene,
                     "My Awesome Node 2",
                     inputs=[3, 3, 3],
                     outputs=[1])
        node3 = Node(self.scene,
                     "My Awesome Node 3",
                     inputs=[2, 2, 2],
                     outputs=[1])
        node1.setPos(-350, -250)
        node2.setPos(-75, 0)
        node3.setPos(200, -150)

        edge1 = Edge(self.scene,
                     node1.outputs[0],
                     node2.inputs[0],
                     edge_type=EDGE_TYPE_BEZIER)
        edge2 = Edge(self.scene,
                     node2.outputs[0],
                     node3.inputs[0],
                     edge_type=EDGE_TYPE_BEZIER)
Ejemplo n.º 3
0
    def addNodes(self):
        node1 = Node(self.scene,
                     "Monte Carlo Driver",
                     inputs=[1, 2, 3],
                     outputs=[4])
        node2 = Node(self.scene, "Dihedral Mutator", inputs=[3], outputs=[1])
        node3 = Node(self.scene, "Energy Function", inputs=[], outputs=[2])
        node1.setPos(200, -150)
        node2.setPos(-350, 0)
        node3.setPos(-75, -250)

        edge1 = Edge(self.scene,
                     node3.outputs[0],
                     node1.inputs[1],
                     edge_type=EDGE_TYPE_BEZIER)
        edge2 = Edge(self.scene,
                     node2.outputs[0],
                     node1.inputs[0],
                     edge_type=EDGE_TYPE_BEZIER)

        self.scene.history.storeInitialHistoryStamp()
Ejemplo n.º 4
0
 def addNodes(self):
     node1 = Node(self.scene, "Dataset Path", inputs=[0], outputs=[1])
     node2 = Node(self.scene, "Image Settings", inputs=[1], outputs=[1])
     node3 = Node(self.scene, "Train", inputs=[0], outputs=[1])
     node4 = Node(self.scene, "GPU", inputs=[0], outputs=[1])
     node5 = Node(self.scene, "Batch", inputs=[0], outputs=[1])
     node6 = Node(self.scene, "Dimensions", inputs=[0], outputs=[1])
     node7 = Node(self.scene,
                  "GAN",
                  inputs=[0, 1, 2, 3, 4, 5, 5, 5, 5, 7],
                  outputs=[2])
     node8 = Node(self.scene, "Start", inputs=[0], outputs=[0])
     node9 = Node(self.scene, "Output", inputs=[0], outputs=[1])
     node1.setPos(-450, -150)
     node2.setPos(-200, -150)
     node3.setPos(-450, 200)
     node4.setPos(-450, 350)
     node5.setPos(-450, 500)
     node6.setPos(-200, 200)
     node7.setPos(150, -150)
     node8.setPos(400, -150)
     node9.setPos(400, 250)
     edge1 = Edge(self.scene,
                  node1.outputs[0],
                  node2.inputs[0],
                  edge_type=EDGE_TYPE_BEZIER)
     edge2 = Edge(self.scene,
                  node2.outputs[0],
                  node7.inputs[0],
                  edge_type=EDGE_TYPE_BEZIER)
     edge3 = Edge(self.scene,
                  node3.outputs[0],
                  node7.inputs[1],
                  edge_type=EDGE_TYPE_BEZIER)
     edge4 = Edge(self.scene,
                  node4.outputs[0],
                  node7.inputs[2],
                  edge_type=EDGE_TYPE_BEZIER)
     edge5 = Edge(self.scene,
                  node5.outputs[0],
                  node7.inputs[3],
                  edge_type=EDGE_TYPE_BEZIER)
     edge6 = Edge(self.scene,
                  node6.outputs[0],
                  node7.inputs[4],
                  edge_type=EDGE_TYPE_BEZIER)
     edge7 = Edge(self.scene,
                  node7.outputs[0],
                  node8.inputs[0],
                  edge_type=EDGE_TYPE_BEZIER)
     edge8 = Edge(self.scene,
                  node7.outputs[0],
                  node9.inputs[0],
                  edge_type=EDGE_TYPE_BEZIER)
     self.scene.history.storeInitialHistoryStamp()