summaryrefslogtreecommitdiff
path: root/silx/gui/plot3d/Plot3DWindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/gui/plot3d/Plot3DWindow.py')
-rw-r--r--silx/gui/plot3d/Plot3DWindow.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/silx/gui/plot3d/Plot3DWindow.py b/silx/gui/plot3d/Plot3DWindow.py
index d8c393e..331eca2 100644
--- a/silx/gui/plot3d/Plot3DWindow.py
+++ b/silx/gui/plot3d/Plot3DWindow.py
@@ -35,9 +35,7 @@ __date__ = "26/01/2017"
from silx.gui import qt
from .Plot3DWidget import Plot3DWidget
-from .actions.viewpoint import RotateViewport
-from .tools import OutputToolBar, InteractiveModeToolBar
-from .tools import ViewpointToolButton
+from .tools import OutputToolBar, InteractiveModeToolBar, ViewpointToolBar
class Plot3DWindow(qt.QMainWindow):
@@ -52,20 +50,11 @@ class Plot3DWindow(qt.QMainWindow):
self._plot3D = Plot3DWidget()
self.setCentralWidget(self._plot3D)
- toolbar = InteractiveModeToolBar(parent=self)
- toolbar.setPlot3DWidget(self._plot3D)
- self.addToolBar(toolbar)
- self.addActions(toolbar.actions())
-
- toolbar = qt.QToolBar(self)
- toolbar.addWidget(ViewpointToolButton(plot3D=self._plot3D))
- toolbar.addAction(RotateViewport(parent=toolbar, plot3d=self._plot3D))
- self.addToolBar(toolbar)
-
- toolbar = OutputToolBar(parent=self)
- toolbar.setPlot3DWidget(self._plot3D)
- self.addToolBar(toolbar)
- self.addActions(toolbar.actions())
+ for klass in (InteractiveModeToolBar, ViewpointToolBar, OutputToolBar):
+ toolbar = klass(parent=self)
+ toolbar.setPlot3DWidget(self._plot3D)
+ self.addToolBar(toolbar)
+ self.addActions(toolbar.actions())
def getPlot3DWidget(self):
"""Get the :class:`Plot3DWidget` of this window"""