def __init__(self, mainWindow):
     super(Plugin, self).__init__("Gepetto Viewer plugin", mainWindow)
     self.setObjectName("Gepetto Viewer plugin")
     self.client = Client()
     # Initialize the widget
     self.tabWidget = QtGui.QTabWidget(self)
     # This avoids having a widget bigger than what it needs. It avoids having
     # a big dock widget and a small osg widget when creating the main osg widget.
     p = Qt.QSizePolicy.Maximum
     self.tabWidget.setSizePolicy(Qt.QSizePolicy(p, p))
     self.setWidget(self.tabWidget)
     self.nodeCreator = _NodeCreator(self, self)
     self.tabWidget.addTab(self.nodeCreator, "Node Creator")
     self.main = mainWindow
     mainWindow.connect("refresh()", self.refresh)
     mainWindow.bodyTree().connect("bodySelected(SelectionEvent*)",
                                   self.selected)
    def __init__ (self, mainWindow, flags = None):
        if flags is None:
            super(Plugin, self).__init__ ("Matplotlib example plugin", mainWindow)
        else:
            super(Plugin, self).__init__ ("Matplotlib example plugin", mainWindow, flags)
        self.setObjectName("Matplotlib example plugin")
        self.client = Client()

        # This avoids having a widget bigger than what it needs. It avoids having
        # a big dock widget and a small osg widget when creating the main osg widget.
        p = Qt.QSizePolicy.Ignored
        self.testWidget = MatplotlibWidget(self, True)
        self.testWidget.setSizePolicy(Qt.QSizePolicy(p,p))
        self.setWidget (self.testWidget)

        # Plot something
        x = np.linspace (0, 10, num=100)
        y = np.sin(x)
        self.testWidget.figure.gca().plot (x, y)
Esempio n. 3
0
    def __init__(self, mainWindow, flags=None):
        if flags is None:
            super(Plugin, self).__init__("Path graph plugin", mainWindow)
        else:
            super(Plugin, self).__init__("Path graph plugin", mainWindow,
                                         flags)
        self.setObjectName("Path graph plugin")

        self.main = mainWindow
        self.hppPlugin = self.main.getFromSlot("getHppIIOPurl")
        self.pathPlayer = self.main.getFromSlot("getCurrentPath")
        self.jointgroupcreator = self.main.getFromSlot(
            "requestCreateJointGroup")
        self.comgroupcreator = self.main.getFromSlot("requestCreateComGroup")
        self.velocities = Velocities(self)
        self.jointActions = dict()
        self.jointNames = None

        self.qcpWidgets = list()

        # This avoids having a widget bigger than what it needs. It avoids having
        # a big dock widget and a small osg widget when creating the main osg widget.
        p = Qt.QSizePolicy.Ignored
        self.topWidget = QtGui.QSplitter(Qt.Qt.Horizontal, self)
        self.topWidget.setSizePolicy(Qt.QSizePolicy(p, p))
        self.setWidget(self.topWidget)

        self.leftPane = QtGui.QWidget(self)
        l = QtGui.QVBoxLayout()
        self.makeLeftPane(l)
        self.leftPane.setLayout(l)

        self.topWidget.addWidget(self.leftPane)

        self.rightPane = QtGui.QWidget(self)
        self.rightPaneLayout = QtGui.QVBoxLayout()
        self.rightPane.setLayout(self.rightPaneLayout)
        self.addPlotBelow()
        self.topWidget.addWidget(self.rightPane)
        self.topWidget.setStretchFactor(1, 1)
Esempio n. 4
0
    def __init__(self, mainWindow):
        super(Plugin, self).__init__("Coordinates viewer plugin", mainWindow)
        self.setObjectName("Coordinates viewer plugin")
        self.client = Client()

        self.le_name = QtGui.QLineEdit()
        self.le_name.setReadOnly(True)
        self.transform = QtGui.QLineEdit()
        self.transform.setReadOnly(True)

        self.local = QtGui.QCheckBox()
        self.local.setChecked(True)
        self.point = QtGui.QLineEdit()
        self.point.setReadOnly(True)
        self.normal = QtGui.QLineEdit()
        self.normal.setReadOnly(True)

        layout = QtGui.QFormLayout()
        layout.addRow('Name', self.le_name)
        layout.addRow('Transform', self.transform)
        layout.addRow('Local frame', self.local)
        layout.addRow('Point', self.point)
        layout.addRow('Normal', self.normal)

        # Initialize the widget
        widget = QtGui.QWidget(self)
        widget.setLayout(layout)
        # This avoids having a widget bigger than what it needs. It avoids having
        # a big dock widget and a small osg widget when creating the main osg widget.
        p = Qt.QSizePolicy.Maximum
        widget.setSizePolicy(
            Qt.QSizePolicy(Qt.QSizePolicy.Expanding, Qt.QSizePolicy.Maximum))
        self.setWidget(widget)

        mainWindow.bodyTree().connect('bodySelected(SelectionEvent*)',
                                      self.selected)