Skip to content

Commit

Permalink
Merge pull request #2610 from SasView/2604-allow-multiple-slicers-of-…
Browse files Browse the repository at this point in the history
…the-same-slicer-type

created submenu for slicers being part of #2604
  • Loading branch information
krzywon authored Sep 18, 2023
2 parents 26ce41c + 7254834 commit b0f9392
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions src/sas/qtgui/Plotting/Plotter2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,35 @@ def createContextMenu(self):
"""
Define common context menu and associated actions for the MPL widget
"""

self.defaultContextMenu()

plot_slicer_menu=self.contextMenu.addMenu('Slicers')
self.actionCircularAverage = plot_slicer_menu.addAction("&Perform Circular Average")
self.actionCircularAverage.triggered.connect(self.onCircularAverage)
self.actionSectorView = plot_slicer_menu.addAction("&Sector [Q View]")
self.actionSectorView.triggered.connect(self.onSectorView)
self.actionAnnulusView = plot_slicer_menu.addAction("&Annulus [Phi View]")
self.actionAnnulusView.triggered.connect(self.onAnnulusView)
self.actionBoxSum = plot_slicer_menu.addAction("&Box Sum")
self.actionBoxSum.triggered.connect(self.onBoxSum)
self.actionBoxAveragingX = plot_slicer_menu.addAction("&Box Averaging in Qx")
self.actionBoxAveragingX.triggered.connect(self.onBoxAveragingX)
self.actionBoxAveragingY = plot_slicer_menu.addAction("&Box Averaging in Qy")
self.actionBoxAveragingY.triggered.connect(self.onBoxAveragingY)
self.actionWedgeAveragingQ = plot_slicer_menu.addAction("&Wedge Averaging in Q")
self.actionWedgeAveragingQ.triggered.connect(self.onWedgeAveragingQ)
self.actionWedgeAveragingPhi = plot_slicer_menu.addAction("&Wedge Averaging in Phi")
self.actionWedgeAveragingPhi.triggered.connect(self.onWedgeAveragingPhi)

plot_slicer_menu.addSeparator()

# Additional items for slicer interaction
if self.slicer:
plot_slicer_menu.actionClearSlicer = plot_slicer_menu.addAction("&Clear Slicer")
plot_slicer_menu.actionClearSlicer.triggered.connect(self.onClearSlicer)
plot_slicer_menu.actionEditSlicer = plot_slicer_menu.addAction("&Edit Slicer Parameters")
plot_slicer_menu.actionEditSlicer.triggered.connect(self.onEditSlicer)

self.contextMenu.addSeparator()
self.actionDataInfo = self.contextMenu.addAction("&DataInfo")
Expand All @@ -177,29 +205,7 @@ def createContextMenu(self):
functools.partial(self.onSavePoints, self.data0))
self.contextMenu.addSeparator()

self.actionCircularAverage = self.contextMenu.addAction("&Perform Circular Average")
self.actionCircularAverage.triggered.connect(self.onCircularAverage)

self.actionSectorView = self.contextMenu.addAction("&Sector [Q View]")
self.actionSectorView.triggered.connect(self.onSectorView)
self.actionAnnulusView = self.contextMenu.addAction("&Annulus [Phi View]")
self.actionAnnulusView.triggered.connect(self.onAnnulusView)
self.actionBoxSum = self.contextMenu.addAction("&Box Sum")
self.actionBoxSum.triggered.connect(self.onBoxSum)
self.actionBoxAveragingX = self.contextMenu.addAction("&Box Averaging in Qx")
self.actionBoxAveragingX.triggered.connect(self.onBoxAveragingX)
self.actionBoxAveragingY = self.contextMenu.addAction("&Box Averaging in Qy")
self.actionBoxAveragingY.triggered.connect(self.onBoxAveragingY)
self.actionWedgeAveragingQ = self.contextMenu.addAction("&Wedge Averaging in Q")
self.actionWedgeAveragingQ.triggered.connect(self.onWedgeAveragingQ)
self.actionWedgeAveragingPhi = self.contextMenu.addAction("&Wedge Averaging in Phi")
self.actionWedgeAveragingPhi.triggered.connect(self.onWedgeAveragingPhi)
# Additional items for slicer interaction
if self.slicer:
self.actionClearSlicer = self.contextMenu.addAction("&Clear Slicer")
self.actionClearSlicer.triggered.connect(self.onClearSlicer)
self.actionEditSlicer = self.contextMenu.addAction("&Edit Slicer Parameters")
self.actionEditSlicer.triggered.connect(self.onEditSlicer)
self.contextMenu.addSeparator()
self.actionColorMap = self.contextMenu.addAction("&2D Color Map")
self.actionColorMap.triggered.connect(self.onColorMap)
Expand Down

0 comments on commit b0f9392

Please sign in to comment.