"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/pmg_qt/volume.py" between
pymol-v2.1.0.tar.bz2 and pymol-open-source-2.2.0.tar.gz

About: PyMOL is a Python-enhanced molecular graphics tool. It excels at 3D visualization of proteins, small molecules, density, surfaces, and trajectories. It also includes molecular editing, ray tracing, and movies. Open Source version.

volume.py  (pymol-v2.1.0.tar.bz2):volume.py  (pymol-open-source-2.2.0)
skipping to change at line 45 skipping to change at line 45
VOLUME_HELP = ''' VOLUME_HELP = '''
VOLUME PANEL HELP VOLUME PANEL HELP
-------------------------------------------------- --------------------------------------------------
Canvas Mouse Actions (no Point under Cursor) Canvas Mouse Actions (no Point under Cursor)
L-Click Add point L-Click Add point
CTRL+L-Click Add 3 points (isosurface) CTRL+L-Click Add 3 points (isosurface)
CTRL+R-Drag Zoom in
-------------------------------------------------- --------------------------------------------------
Mouse Actions with Point under Cursor Mouse Actions with Point under Cursor
L-Click Edit point color L-Click Edit point color
R-Click Edit point value R-Click Edit point value
SHIFT+R-Click Edit point opacity SHIFT+R-Click Edit point opacity
CTRL+L-Click Edit color of 3 points CTRL+L-Click Edit color of 3 points
M-Click Remove Point M-Click Remove Point
SHIFT+L-Click Remove Point SHIFT+L-Click Remove Point
CTRL+M-Click Remove 3 points CTRL+M-Click Remove 3 points
CTRL+SHIFT+L-Click Remove 3 points CTRL+SHIFT+L-Click Remove 3 points
L-Drag Move point L-Drag Move point
CTRL+L-Drag Move 3 points (horizontal only) CTRL+L-Drag Move 3 points (horizontal only)
R-Drag Move point along one axis only R-Drag Move point along one axis only
CTRL+R-Drag Zoom in
-------------------------------------------------- --------------------------------------------------
L = Left mouse button L = Left mouse button
M = Middle mouse button M = Middle mouse button
R = Right mouse button R = Right mouse button
-------------------------------------------------- --------------------------------------------------
See also the "volume_color" command for getting and See also the "volume_color" command for getting and
setting volume colors on the command line. setting volume colors on the command line.
''' '''
skipping to change at line 276 skipping to change at line 276
# disabled: always use default style # disabled: always use default style
is_floating = True # self.parent().parent().isFloating() is_floating = True # self.parent().parent().isFloating()
self.line_color = Qt.darkGray if is_floating else Qt.lightGray self.line_color = Qt.darkGray if is_floating else Qt.lightGray
painter.begin(self) painter.begin(self)
painter.setRenderHint(QtGui.QPainter.Antialiasing) painter.setRenderHint(QtGui.QPainter.Antialiasing)
self.paintGrid(painter, self.paint_rect) self.paintGrid(painter, self.paint_rect)
self.paintAxes(painter, self.paint_rect) self.paintAxes(painter, self.paint_rect)
painter.setClipRect(self.paint_rect) painter.setClipRect(self.paint_rect)
self.paintHistogram(painter, self.paint_rect) self.paintHistogram(painter, self.paint_rect)
self.paintZoomArea(painter, self.paint_rect)
painter.setClipping(False) painter.setClipping(False)
self.paintColorDots(painter, self.paint_rect) self.paintColorDots(painter, self.paint_rect)
self.paintZoomArea(painter, self.paint_rect)
painter.end() painter.end()
def enterValue(self, title, value, min_value, max_value): def enterValue(self, title, value, min_value, max_value):
""" """
Handles entering new values into alpha / min / max boxes. Handles entering new values into alpha / min / max boxes.
""" """
new_value, status = QtWidgets.QInputDialog.getDouble( new_value, status = QtWidgets.QInputDialog.getDouble(
self, "", title, value, min_value, max_value, decimals=6) self, "", title, value, min_value, max_value, decimals=6)
if status: if status:
return new_value return new_value
skipping to change at line 319 skipping to change at line 319
return return
if self.paint_rect.adjusted( if self.paint_rect.adjusted(
-DOT_RADIUS, -DOT_RADIUS, DOT_RADIUS, DOT_RADIUS).contains( -DOT_RADIUS, -DOT_RADIUS, DOT_RADIUS, DOT_RADIUS).contains(
event.pos()): event.pos()):
self.dragged = False self.dragged = False
self.point = self.findPoint(event.pos()) self.point = self.findPoint(event.pos())
self.init_pos = event.pos() self.init_pos = event.pos()
self.zoom_pos = None self.zoom_pos = None
self.constraint = None self.constraint = None
if self.point > 0 and event.button() == Qt.RightButton: if self.point < 0 and event.button() == Qt.LeftButton:
self.addPoint(
event.pos(), event.modifiers() == Qt.ControlModifier)
# suppress color picker
self.dragged = True
def mouseReleaseEvent(self, event):
if not self.dragged and self.point >= 0:
if event.button() == Qt.RightButton:
x, y, r, g, b = self.points[self.point] x, y, r, g, b = self.points[self.point]
if event.modifiers() == Qt.ControlModifier: # in 2.0: help says NoModifier, implemented is ControlModifier
if event.modifiers() in (Qt.ControlModifier, Qt.NoModifier):
value = self.points[self.point][0] value = self.points[self.point][0]
prev_x = self.points[self.point-1][0] if self.point > 0 else self.vmin prev_x = self.points[self.point-1][0] if self.point > 0 else self.vmin
next_x = self.points[self.point+1][0] if self.point < len(se lf.points)-1 else self.vmax next_x = self.points[self.point+1][0] if self.point < len(se lf.points)-1 else self.vmax
x = self.enterValue("Data value", x = self.enterValue("Data value",
value, prev_x, next_x) value, prev_x, next_x)
elif event.modifiers() == Qt.ShiftModifier: elif event.modifiers() == Qt.ShiftModifier:
value = self.points[self.point][1] value = self.points[self.point][1]
y = self.enterValue("Alpha value (opacity)", y = self.enterValue("Alpha value (opacity)",
value, 0.0, 1.0) value, 0.0, 1.0)
self.points[self.point] = (x, y, r, g, b) self.points[self.point] = (x, y, r, g, b)
self.repaint() self.repaint()
if self.real_time: if self.real_time:
self.updateVolumeColors() self.updateVolumeColors()
if (event.button() == Qt.MidButton or if (event.button() == Qt.MidButton or
(event.button() == Qt.LeftButton and (event.button() == Qt.LeftButton and
event.modifiers() == Qt.ShiftModifier)): event.modifiers() & Qt.ShiftModifier)):
self.removePoints( self.removePoints(
event.modifiers() == Qt.ControlModifier) event.modifiers() & Qt.ControlModifier)
elif (event.button() == Qt.LeftButton and self.point < 0): elif event.button() == Qt.LeftButton:
self.addPoint( self.setPointColor(self.point,
event.pos(), event.modifiers() == Qt.ControlModifier) event.modifiers() == Qt.ControlModifier)
self.dragged = True
def mouseReleaseEvent(self, event):
self.point = -1 self.point = -1
self.hover_point = -1 self.hover_point = -1
if event.button() == Qt.LeftButton and not self.dragged:
point = self.findPoint(event.pos())
if point >= 0:
self.setPointColor(
point, event.modifiers() == Qt.ControlModifier)
if self.init_pos and self.zoom_pos: if self.init_pos and self.zoom_pos:
if self.init_pos.x() != self.zoom_pos.x(): if self.init_pos.x() != self.zoom_pos.x():
# zoom in # zoom in
self.vmin = self.xToData( self.vmin, self.vmax = sorted([
(self.init_pos.x() - self.left_margin) / self.xToData(self.convertX(self.init_pos.x())),
float(self.rect().width() - self.left_margin)) self.xToData(self.convertX(self.zoom_pos.x()))])
self.vmax = self.xToData(
(self.zoom_pos.x() - self.left_margin) /
float(self.rect().width() - self.left_margin))
self.zoom_pos = None self.zoom_pos = None
self.repaint() self.repaint()
self.updateVolumeColors() self.updateVolumeColors()
def changePointColor(self, color): def changePointColor(self, color):
""" """
Changes color of specified point or three points. Changes color of specified point or three points.
""" """
x, y, _, _, _ = self.points[self.color_point] x, y, _, _, _ = self.points[self.color_point]
 End of changes. 11 change blocks. 
23 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)