summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Smith <bruce@nanorex.com>2008-10-02 23:01:08 +0000
committerBruce Smith <bruce@nanorex.com>2008-10-02 23:01:08 +0000
commit4e61624dda197bd6e4c3a638b611ca7e5720df77 (patch)
treeb3abea81251416aa1f3e1a6cb29545480e0e8284
parentc2d31af65fee1c8ff1a7eee8471afd7bf3595ccc (diff)
downloadnanoengineer-4e61624dda197bd6e4c3a638b611ca7e5720df77.tar.gz
nanoengineer-4e61624dda197bd6e4c3a638b611ca7e5720df77.zip
fill out GraphicsMode_API; reorder methods in GraphicsMode; related cleanup
-rw-r--r--cad/src/PM/PM_SelectionListWidget.py12
-rw-r--r--cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_GraphicsMode.py4
-rwxr-xr-xcad/src/command_support/GraphicsMode.py256
-rw-r--r--cad/src/command_support/GraphicsMode_API.py161
-rwxr-xr-xcad/src/commands/BuildAtoms/BuildAtoms_Command.py1
-rwxr-xr-xcad/src/commands/BuildCrystal/BuildCrystal_Command.py8
-rwxr-xr-xcad/src/commands/Select/Select_GraphicsMode.py3
-rwxr-xr-xcad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py2
-rw-r--r--cad/src/dna/commands/BuildDna/BuildDna_GraphicsMode.py6
-rw-r--r--cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py6
-rw-r--r--cad/src/temporary_commands/LineMode/Line_GraphicsMode.py2
11 files changed, 261 insertions, 200 deletions
diff --git a/cad/src/PM/PM_SelectionListWidget.py b/cad/src/PM/PM_SelectionListWidget.py
index dcc187f09..6610ff885 100644
--- a/cad/src/PM/PM_SelectionListWidget.py
+++ b/cad/src/PM/PM_SelectionListWidget.py
@@ -366,7 +366,11 @@ class PM_SelectionListWidget(PM_ListWidget):
"""
Clear the previously drawn tags if any.
"""
- self.glpane.graphicsMode.drawTags(tagPositions = ())
+ ### TODO: this should not go through the current graphicsMode,
+ # in case that belongs to a temporary command or to nullCommand
+ # (which would cause bugs). Rather, it should find "this PM's graphicsMode".
+ # [bruce 081002 comment]
+ self.glpane.graphicsMode.setDrawTags(tagPositions = ())
def setTagInstruction(self, tagInstruction = 'TAG_ITEM_IN_GLPANE'):
"""
@@ -391,6 +395,8 @@ class PM_SelectionListWidget(PM_ListWidget):
return
graphicsMode = self.glpane.graphicsMode
+ # TODO: fix this, in the same way as described in self.clearTags.
+ # [bruce 081002 comment]
#Clear the previous tags if any
self.clearTags()
@@ -434,8 +440,8 @@ class PM_SelectionListWidget(PM_ListWidget):
tagPositions.append(item.posn())
if tagPositions:
- graphicsMode.drawTags(tagPositions = tagPositions,
- tagColor = yellow)
+ graphicsMode.setDrawTags(tagPositions = tagPositions,
+ tagColor = yellow)
self.glpane.gl_update()
diff --git a/cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_GraphicsMode.py b/cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_GraphicsMode.py
index 8cf71b844..f166138c7 100644
--- a/cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_GraphicsMode.py
+++ b/cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_GraphicsMode.py
@@ -106,12 +106,12 @@ class NanotubeSegment_GraphicsMode(BuildNanotube_GraphicsMode):
"""
value = _superclass.bareMotion(self, event)
- #When the cursor is over a specifit atom, we need to display
+ #When the cursor is over a specific atom, we need to display
#a different icon. (e.g. when over a strand atom, it should display
# rotate cursor)
self.update_cursor()
- return value # russ 080527
+ return value
def update_cursor_for_no_MB(self):
"""
diff --git a/cad/src/command_support/GraphicsMode.py b/cad/src/command_support/GraphicsMode.py
index 4601171ef..af64b0911 100755
--- a/cad/src/command_support/GraphicsMode.py
+++ b/cad/src/command_support/GraphicsMode.py
@@ -88,21 +88,10 @@ class nullGraphicsMode(GraphicsMode_API):
# GraphicsMode-specific null methods
- def Draw(self):
- # Note: this does happen... maybe due to how soon we call
- # .start_using_mode( '$DEFAULT_MODE')" (or start_using_initial_mode?).
- # If so, it's ok that it happens and good
- # that we make it a noop. [bruce 040924]
- pass
- def Draw_after_highlighting(self):
- pass
- def keyPressEvent(self, e):
- pass
- def keyReleaseEvent(self, e):
- pass
- def bareMotion(self, e):
- return False # russ 080527
- def drawTags(self, *args, **kws): #bruce 080325
+ def setDrawTags(self, *args, **kws):
+ # This would not be needed here if calls were fixed,
+ # as commented on them; thus, not part of GraphicsMode_API
+ # [bruce 081002 comment]
pass
pass # end of class nullGraphicsMode
@@ -135,7 +124,9 @@ class basicGraphicsMode(GraphicsMode_API):
# for details.
_tagPositions = ()
_tagColor = yellow
-
+
+ picking = False # used as instance variable in some mouse methods
+
def __init__(self, glpane):
"""
"""
@@ -375,29 +366,38 @@ class basicGraphicsMode(GraphicsMode_API):
self.o.assy.checkpicked(always_print = 0)
return
- def drawTags(self, tagPositions = (), tagColor = yellow): # by Ninad
+ def setDrawTags(self, tagPositions = (), tagColor = yellow): # by Ninad
"""
Public method that accepts requests to draw tags at the given
tagPositions.
+
+ @note: this saves its arguments as private state in self, but does
+ not actually draw them -- that is done later by self._drawTags().
+ Thus, this method is safe to call outside of self.Draw() and without
+ ensuring that self.glpane is the current OpenGL context.
+
@param tagPositions: The client can provide a list or tuple of tag
base positions. The default value for this parameter
is an empty tuple. Thus, if no tag position is
specified, it won't draw any tags and will also
clear the previously drawn tags.
@type tagPositions: list or tuple
+
@param tagColor: The color of the tags
@type tagColor: B{A}
+
@see: self._drawTags
@see: DnaDuplexPropertyManager.clearTags for an example
"""
+ #bruce 081002 renamed from drawTags -> setDrawTags, to avoid confusion,
+ # since it sets state but doesn't do any drawing
self._tagPositions = list(tagPositions)
self._tagColor = tagColor
def _drawTags(self):
"""
Private method, called in self.Draw that actually draws the tags
- for self._tagPositions.
- @see: self.drawTag
+ saved in self._tagPositions by self.setDrawTags.
"""
if self._tagPositions:
@@ -480,13 +480,18 @@ class basicGraphicsMode(GraphicsMode_API):
self.glpane.displayMode,
pickCheckOnly = pickCheckOnly )
- def selobj_still_ok(self, selobj): #bruce 050702 added this to mode API; revised 060724
+ def selobj_still_ok(self, selobj):
"""
- Say whether a highlighted mouseover object from a prior draw (in the same mode) is still ok.
- If the mode's special cases don't hold, we ask the selobj; if that doesn't work, we assume it
- defines .killed (and answer yes unless it's been killed).
-
- [overrides anyMode method; subclasses might want to override this one]
+ [overrides GraphicsMode_API method]
+
+ Say whether a highlighted mouseover object from a prior draw
+ (done by the same GraphicsMode) is still ok.
+
+ In this implementation: if our special cases of various classes
+ of selobj don't hold, we ask selobj (using a method of the same name
+ in the selobj API, though it's not defined in Selobj_API for now);
+ if that doesn't work, we assume selobj defines .killed, and answer yes
+ unless it's been killed.
"""
try:
# This sequence of conditionals fix bugs 1648 and 1676. mark 060315.
@@ -499,9 +504,9 @@ class basicGraphicsMode(GraphicsMode_API):
elif isinstance(selobj, Node): # e.g. Jig
return not selobj.killed() and selobj.part is self.o.part
else:
- #bruce 060724 new feature, related to Drawable API
try:
method = selobj.selobj_still_ok
+ # REVIEW: this method is not defined in Selobj_API; can it be?
except AttributeError:
pass
else:
@@ -521,8 +526,10 @@ class basicGraphicsMode(GraphicsMode_API):
return True # let the selobj remain
pass
- def drawHighlightedObjectUnderMouse(self, glpane, selobj, hicolor): #bruce 071008 for graphics mode API
+ def drawHighlightedObjectUnderMouse(self, glpane, selobj, hicolor):
"""
+ [overrides GraphicsMode_API method]
+
Subclasses should override this as needed, though most don't need to:
Draw selobj in highlighted form for being the object under the mouse,
@@ -534,72 +541,6 @@ class basicGraphicsMode(GraphicsMode_API):
"""
selobj.draw_in_abs_coords(glpane, hicolor)
- # left mouse button actions -- overridden in modes that respond to them
- def leftDown(self, event):
- pass
-
- def leftDrag(self, event):
- pass
-
- def leftUp(self, event):
- pass
-
- def leftShiftDown(self, event):
- pass
-
- def leftShiftDrag(self, event):
- pass
-
- def leftShiftUp(self, event):
- pass
-
- def leftCntlDown(self, event):
- pass
-
- def leftCntlDrag(self, event):
- pass
-
- def leftCntlUp(self, event):
- pass
-
- def leftDouble(self, event):
- pass
-
- # middle mouse button actions -- these support a trackball, and
- # are the same for all modes (with a few exceptions)
- def middleDown(self, event):
- """
- Set up for rotating the view with MMB+Drag.
- """
- self.update_cursor()
- self.o.SaveMouse(event)
- self.o.trackball.start(self.o.MousePos[0], self.o.MousePos[1])
- self.picking = True
-
- # Turn off hover highlighting while rotating the view with middle mouse button. Fixes bug 1657. Mark 060805.
- self.o.selobj = None # <selobj> is the object highlighted under the cursor.
-
- def middleDrag(self, event):
- """
- Rotate the view with MMB+Drag.
- """
- # Huaicai 4/12/05: Originally 'self.picking = False in both middle*Down
- # and middle*Drag methods. Change it as it is now is to prevent
- # possible similar bug that happened in the Move_Command where
- # a *Drag method is called before a *Down() method. This
- # comment applies to all three *Down/*Drag/*Up methods.
- if not self.picking:
- return
-
- self.o.SaveMouse(event)
- q = self.o.trackball.update(self.o.MousePos[0], self.o.MousePos[1])
- self.o.quat += q
- self.o.gl_update()
-
- def middleUp(self, event):
- self.picking = False
- self.update_cursor()
-
def end_selection_from_GLPane(self):
"""
GraphicsMode API method that decides whether to do some additional
@@ -642,24 +583,6 @@ class basicGraphicsMode(GraphicsMode_API):
res = self.o.dragstart_using_plane_depth(event, plane, **kws) # note: res is a tuple whose length depends on **kws
return res
- def middleShiftDown(self, event):
- """
- Set up for panning the view with MMB+Shift+Drag.
- """
- self.update_cursor()
- # Setup pan operation
- farQ_junk, self.movingPoint = self.dragstart_using_GL_DEPTH( event)
- self.startpt = self.movingPoint # Used in leftDrag() to compute move offset during drag op.
- # REVIEW: needed? the subclasses that use it also set it, so probably not.
- # TODO: confirm that guess, then remove this set. (In fact, this makes me wonder
- # if some or all of the other things in this method are redundant now.) [bruce 071012 comment]
-
- self.o.SaveMouse(event) #k still needed?? probably yes; might even be useful to help dragto for atoms #e [bruce 060316 comment]
- self.picking = True
-
- # Turn off hover highlighting while panning the view with middle mouse button. Fixes bug 1657. Mark 060808.
- self.o.selobj = None # <selobj> is the object highlighted under the cursor.
-
def dragto(self, point, event, perp = None):
"""
Return the point to which we should drag the given point,
@@ -717,6 +640,61 @@ class basicGraphicsMode(GraphicsMode_API):
"""
return self.dragto(point + offset, event) - offset
+ # middle mouse button actions -- these support a trackball, and
+ # are the same for all GraphicsModes (with a few exceptions)
+
+ def middleDown(self, event):
+ """
+ Set up for rotating the view with MMB+Drag.
+ """
+ self.update_cursor()
+ self.o.SaveMouse(event)
+ self.o.trackball.start(self.o.MousePos[0], self.o.MousePos[1])
+ self.picking = True
+
+ # Turn off hover highlighting while rotating the view with middle mouse button. Fixes bug 1657. Mark 060805.
+ self.o.selobj = None # <selobj> is the object highlighted under the cursor.
+
+ def middleDrag(self, event):
+ """
+ Rotate the view with MMB+Drag.
+ """
+ # Huaicai 4/12/05: Originally 'self.picking = False in both middle*Down
+ # and middle*Drag methods. Change it as it is now is to prevent
+ # possible similar bug that happened in the Move_Command where
+ # a *Drag method is called before a *Down() method. This
+ # comment applies to all three *Down/*Drag/*Up methods.
+ if not self.picking:
+ return
+
+ self.o.SaveMouse(event)
+ q = self.o.trackball.update(self.o.MousePos[0], self.o.MousePos[1])
+ self.o.quat += q
+ self.o.gl_update()
+
+ def middleUp(self, event):
+ self.picking = False
+ self.update_cursor()
+
+ def middleShiftDown(self, event):
+ """
+ Set up for panning the view with MMB+Shift+Drag.
+ """
+ self.update_cursor()
+ # Setup pan operation
+ farQ_junk, self.movingPoint = self.dragstart_using_GL_DEPTH( event)
+ self.startpt = self.movingPoint # Used in leftDrag() to compute move offset during drag op.
+ # REVIEW: needed? the subclasses that use it also set it, so probably not.
+ # TODO: confirm that guess, then remove this set. (In fact, this makes me wonder
+ # if some or all of the other things in this method are redundant now.) [bruce 071012 comment]
+
+ self.o.SaveMouse(event) #k still needed?? probably yes; might even be useful to help dragto for atoms #e [bruce 060316 comment]
+ self.picking = True
+
+ # Turn off hover highlighting while panning the view with middle mouse button. Fixes bug 1657. Mark 060808.
+ self.o.selobj = None # <selobj> is the object highlighted under the cursor.
+
+
def middleShiftDrag(self, event):
"""
Pan view with MMB+Shift+Drag.
@@ -790,9 +768,6 @@ class basicGraphicsMode(GraphicsMode_API):
self.picking = False
self.update_cursor()
- def middleDouble(self, event):
- pass
-
# right button actions... #doc
def rightDown(self, event):
@@ -819,12 +794,6 @@ class basicGraphicsMode(GraphicsMode_API):
# the corresponding mouseup methods, but that requires worrying about the
# above-described issues.
- def rightDrag(self, event):
- pass
-
- def rightUp(self, event):
- pass
-
def rightShiftDown(self, event):
self._setup_menus_in_each_cmenu_event()
# Previously we did this:
@@ -836,32 +805,13 @@ class basicGraphicsMode(GraphicsMode_API):
# and Qt does not give us the latter. So forget about the 3.
self._Menu2.exec_(event.globalPos())
-
- def rightShiftDrag(self, event):
- pass
-
- def rightShiftUp(self, event):
- pass
-
def rightCntlDown(self, event):
self._setup_menus_in_each_cmenu_event()
# see note above
self._Menu3.exec_(event.globalPos())
- def rightCntlDrag(self, event):
- pass
-
- def rightCntlUp(self, event):
- pass
-
- def rightDouble(self, event):
- pass
-
# other events
- def bareMotion(self, event):
- return False # russ 080527
-
def Wheel(self, event):
mod = event.modifiers()
### REVIEW: this might need a fix_buttons call to work the same
@@ -933,10 +883,10 @@ class basicGraphicsMode(GraphicsMode_API):
# see comments in the GLPane methods, which now contain Mac-specific Delete
# key fixes that used to be done here. For the future: The keyPressEvent and
# keyReleaseEvent methods must be overridden by any mode which needs to know
- # more about key events than e.key() (which is the same for 'A' and 'a',
+ # more about key events than event.key() (which is the same for 'A' and 'a',
# for example). As of 041220 no existing mode needs to do this.
- def keyPressEvent(self, e):
+ def keyPressEvent(self, event):
"""
[some modes will need to override this in the future]
"""
@@ -947,21 +897,22 @@ class basicGraphicsMode(GraphicsMode_API):
# Mark 050412
#bruce 060516 extending this by adding keyPressAutoRepeating and keyReleaseAutoRepeating,
# usually but not always ignored.
- if e.isAutoRepeat():
- self.keyPressAutoRepeating(e.key())
+ if event.isAutoRepeat():
+ self.keyPressAutoRepeating(event.key())
else:
- self.keyPress(e.key())
+ self.keyPress(event.key())
return
- def keyReleaseEvent(self, e):
-
+ def keyReleaseEvent(self, event):
+ """
+ """
# Ignore autorepeating key events. Read comments in keyPressEvent above for more detail.
# Mark 050412
#bruce 060516 extending this; see same comment.
- if e.isAutoRepeat():
- self.keyReleaseAutoRepeating(e.key())
+ if event.isAutoRepeat():
+ self.keyReleaseAutoRepeating(event.key())
else:
- self.keyRelease(e.key())
+ self.keyRelease(event.key())
return
# the old key event API (for modes which don't override keyPressEvent etc)
@@ -1157,13 +1108,6 @@ class basicGraphicsMode(GraphicsMode_API):
for pp in pl:
drawline(color, pp[0], pp[1])
- def surfset(self, num):
- """
- noop method, meant to be overridden in BuildCrystal_Command
- for setting diamond surface orientation
- """
- pass
-
def get_prefs_value(self, prefs_key): #bruce 080605
"""
Get the prefs_value to use for the given prefs_key in this graphicsMode.
diff --git a/cad/src/command_support/GraphicsMode_API.py b/cad/src/command_support/GraphicsMode_API.py
index 22ccb80d9..c8ff5f3e2 100644
--- a/cad/src/command_support/GraphicsMode_API.py
+++ b/cad/src/command_support/GraphicsMode_API.py
@@ -1,35 +1,38 @@
-# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details.
+# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details.
"""
GraphicsMode_API.py -- API class for whatever is used as a GraphicsMode
@version: $Id$
-@copyright: 2004-2007 Nanorex, Inc. See LICENSE file for details.
+@copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details.
History:
-bruce 071028 split this out of GraphicsMode.py, in which it was
+Bruce 071028 split this out of GraphicsMode.py, in which it was
called anyGraphicsMode. All external refs to anyGraphicsMode
are now refs to GraphicsMode_API.
-TODO:
-
-Add all the attributes and methods in the true GraphicsMode API
-to this class (to fully document the API). Use null methods and
+Bruce 081002 added all GraphicsMode API methods to this class, AFAIK
+(to fully document the API). Used null methods and
values (legal to use, which do nothing) unless no real GraphicsMode
can be correct without overriding them (like for Command.commandName).
-See also the TODO comment in module GraphicsMode.
+Note that this API consists mainly of methods/attrs expected by GLPane,
+rather than by self.command, since when a Command expects certain
+methods in its GraphicsMode, it's enough for those to be defined in
+that command's own GraphicsMode_class (assuming subclasses of that
+command use graphicsmode classes which are subclasses of that GM class,
+as should generally be true).
+
+TODO:
+
+See the TODO comment in module GraphicsMode.
"""
class GraphicsMode_API(object):
"""
- API class (incomplete) and abstract superclass for all GraphicsMode objects,
+ API class and abstract superclass for all GraphicsMode objects,
including nullGraphicsMode; used for isinstance tests
"""
- # history:
- # bruce 071008 added object superclass, 071009 split anyMode -> anyGraphicsMode
- # bruce 071028 renamed anyGraphicsMode -> GraphicsMode_API and gave it its own file
-
# GraphicsMode-specific attribute null values
@@ -43,33 +46,141 @@ class GraphicsMode_API(object):
# Note: to use this, override it with a method (or set it to a
# callable) which is compatible with GLPane.render_scene()
# but which receives a single argument which will be the GLPane.
-
check_target_depth_fudge_factor = 0.0001
# affects GLPane's algorithm for finding objectUnderMouse (selobj)
- picking = False # used as instance variable in some mouse methods
+ # default methods of various kinds:
+
+ # selobj-related
- # default methods for both nullGraphicsMode and basicGraphicsMode
-
- def selobj_highlight_color(self, selobj): #bruce 050612 added this to GraphicsMode API; see BuildAtoms_Graphicsmode version for docstring
+ def selobj_highlight_color(self, selobj):
+ """
+ @see: Select_GraphicsMode version, for docstring
+ """
return None
- def selobj_still_ok(self, selobj): #bruce 050702 added this to GraphicsMode API; overridden in GraphicsMode, and docstring is there
+ def selobj_still_ok(self, selobj):
+ """
+ @see: GraphicsMode version, for docstring
+ """
return True
- def draw_overlay(self): #bruce 070405
+ # also: glpane asks for self.command.isHighlightingEnabled()
+ # (as part of a kluge used for updates during event processing);
+ # review: should we define that in this API, and delegate it to command
+ # in basicGraphicsMode? Or, better, refactor the sole call in GLPane_*.py
+ # to call selobj_highlight_color instead (which is None whenever
+ # the selobj should not be highlighted). [bruce 081002 comment]
+
+ # drawing stages
+
+ def Draw(self):
return
- def mouse_event_handler_for_event_position(self, wX, wY): #bruce 070405
- return None
+ def Draw_after_highlighting(self):
+ return
+
+ def draw_overlay(self): # misnamed
+ return
+
+ def drawHighlightedObjectUnderMouse(self, glpane, selobj, hicolor):
+ """
+ @see: GraphicsMode version, for docstring
+ """
+ return
+
+ # cursor
+
+ def update_cursor(self):
+ return
+
+ # key events
+
+ def keyPressEvent(self, event):
+ return
+
+ def keyReleaseEvent(self, event):
+ return
+
+ # mouse wheel event
- def update_cursor(self): #bruce 070410
+ def Wheel(self, event):
return
+
+ # mouse events
+ # (todo: refactor to have fewer methods, let GraphicsMode
+ # split them up if desired, since some GMs don't want to)
+
+ def mouse_event_handler_for_event_position(self, wX, wY):
+ return None
+
+ def bareMotion(self, event):
+ """
+ Mouse motion with no buttons pressed.
+
+ @return: whether this event was "discarded" due to the last mouse wheel
+ event occurring too recently
+ @rtype: boolean
+
+ @note: GLPane sometimes generates a fake bareMotion event with
+ no actual mouse motion
+
+ @see: Select_GraphicsMode_MouseHelpers_preMixin.bareMotion
+ @see: SelectChunks_GraphicsMode.bareMotion for 'return True'
+ """
+ return False # russ 080527 added return value to API
+
+
+ def leftDouble(self, event): pass
+
+ def leftDown(self, event): pass
+ def leftDrag(self, event): pass
+ def leftUp(self, event): pass
+
+ def leftShiftDown(self, event): pass
+ def leftShiftDrag(self, event): pass
+ def leftShiftUp(self, event): pass
+
+ def leftCntlDown(self, event): pass
+ def leftCntlDrag(self, event): pass
+ def leftCntlUp(self, event): pass
+
+
+ def middleDouble(self, event): pass
+
+ def middleDown(self, event): pass
+ def middleDrag(self, event): pass
+ def middleUp(self, event): pass
+
+ def middleShiftDown(self, event): pass
+ def middleShiftDrag(self, event): pass
+ def middleShiftUp(self, event): pass
+
+ def middleCntlDown(self, event): pass
+ def middleCntlDrag(self, event): pass
+ def middleCntlUp(self, event): pass
+
+ def middleShiftCntlDown(self, event): pass
+ def middleShiftCntlDrag(self, event): pass
+ def middleShiftCntlUp(self, event): pass
+
+
+ def rightDouble(self, event): pass
+
+ def rightDown(self, event): pass
+ def rightDrag(self, event): pass
+ def rightUp(self, event): pass
+
+ def rightShiftDown(self, event): pass
+ def rightShiftDrag(self, event): pass
+ def rightShiftUp(self, event): pass
+
+ def rightCntlDown(self, event): pass
+ def rightCntlDrag(self, event): pass
+ def rightCntlUp(self, event): pass
- def drawHighlightedObjectUnderMouse(self, glpane, selobj, hicolor): #bruce 071008
- pass
pass # end of class GraphicsMode_API
diff --git a/cad/src/commands/BuildAtoms/BuildAtoms_Command.py b/cad/src/commands/BuildAtoms/BuildAtoms_Command.py
index 0142b2d2d..d31270be0 100755
--- a/cad/src/commands/BuildAtoms/BuildAtoms_Command.py
+++ b/cad/src/commands/BuildAtoms/BuildAtoms_Command.py
@@ -415,7 +415,6 @@ class BuildAtoms_Command(SelectAtoms_Command):
def isHighlightingEnabled(self):
"""
overrides superclass method.
- Note that this deprecates use of self.hover_highlighiting_enabled
@see: anyCommand.isHighlightingEnabled()
"""
return env.prefs[buildModeHighlightingEnabled_prefs_key]
diff --git a/cad/src/commands/BuildCrystal/BuildCrystal_Command.py b/cad/src/commands/BuildCrystal/BuildCrystal_Command.py
index 468c0144c..be7bafbd0 100755
--- a/cad/src/commands/BuildCrystal/BuildCrystal_Command.py
+++ b/cad/src/commands/BuildCrystal/BuildCrystal_Command.py
@@ -602,7 +602,7 @@ class BuildCrystal_Command(basicMode):
if not self.drawingCookieSelCurve:
return
if self.Rubber:
- # Doing a poly-rubber-band selection. bareMotion() is updating the current rubber-band segment.
+ # Doing a poly-rubber-band selection. bareMotion() is updating the current rubber-band segment.
return
if not self.selectionShape in ['DEFAULT', 'LASSO']:
return
@@ -733,11 +733,11 @@ class BuildCrystal_Command(basicMode):
def bareMotion(self, event):
if self.freeView or not self.drawingCookieSelCurve:
- return False # russ 080527
+ return False # False means not discarded [russ 080527]
if self.Rubber or not self.selectionShape in ['DEFAULT', 'LASSO']:
if not self.selCurve_List:
- return
+ return False
p1, p2 = self._getPoints(event)
try:
if self.Rubber:
@@ -754,7 +754,7 @@ class BuildCrystal_Command(basicMode):
env.history.statusbar_msg("Left click to end selection; Press <Esc> key to cancel selection.")
self.draw_selection_curve()
######self.o.gl_update()
- return False # russ 080527
+ return False
def _afterCookieSelection(self):
"""
diff --git a/cad/src/commands/Select/Select_GraphicsMode.py b/cad/src/commands/Select/Select_GraphicsMode.py
index ab37c4170..4b6da376e 100755
--- a/cad/src/commands/Select/Select_GraphicsMode.py
+++ b/cad/src/commands/Select/Select_GraphicsMode.py
@@ -201,7 +201,6 @@ class Select_basicGraphicsMode(Select_GraphicsMode_DrawMethod_preMixin,
#Boolean flag that is used in combination with
#self.command.isHighlightingEnabled().
- #Note -- this deprecates use of self.hover_highlighting_enabled
_supress_highlighting = False
@@ -1206,7 +1205,7 @@ class Select_basicGraphicsMode(Select_GraphicsMode_DrawMethod_preMixin,
def selobj_highlight_color(self, selobj):
"""
- [mode API method]
+ [GraphicsMode API method]
If we'd like this selobj to be highlighted on mouseover
(whenever it's stored in glpane.selobj), return the desired highlight
diff --git a/cad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py b/cad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py
index 7e3a545a1..07b76b9ac 100755
--- a/cad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py
+++ b/cad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py
@@ -969,6 +969,8 @@ class SelectChunks_basicGraphicsMode(Select_basicGraphicsMode):
self._supress_highlighting = False
_superclass.bareMotion(self, event)
+ ### REVIEW: why do we now return False, rather than whatever this returns?
+ # Needs explanation. [bruce 081002 question]
return False
diff --git a/cad/src/dna/commands/BuildDna/BuildDna_GraphicsMode.py b/cad/src/dna/commands/BuildDna/BuildDna_GraphicsMode.py
index ec262be8c..b05e1df4d 100644
--- a/cad/src/dna/commands/BuildDna/BuildDna_GraphicsMode.py
+++ b/cad/src/dna/commands/BuildDna/BuildDna_GraphicsMode.py
@@ -96,12 +96,12 @@ class BuildDna_GraphicsMode(
"""
value = _superclass.bareMotion(self, event)
- #When the cursor is over a specifit atom, we need to display
+ #When the cursor is over a specific atom, we need to display
#a different icon. (e.g. when over a strand atom, it should display
# rotate cursor)
self.update_cursor()
- return value # russ 080527
+ return value
def leftDown(self, event):
"""
@@ -657,4 +657,4 @@ class BuildDna_GraphicsMode(
#Draw the Dna base number labels.
draw_dnaBaseNumberLabels(self.glpane)
- \ No newline at end of file
+
diff --git a/cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py b/cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py
index 62d498423..a3442ef7e 100644
--- a/cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py
+++ b/cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py
@@ -94,12 +94,12 @@ class DnaSegment_GraphicsMode(BuildDna_GraphicsMode):
"""
value = _superclass.bareMotion(self, event)
- #When the cursor is over a specifit atom, we need to display
+ #When the cursor is over a specific atom, we need to display
#a different icon. (e.g. when over a strand atom, it should display
# rotate cursor)
self.update_cursor()
- return value # russ 080527
+ return value
def update_cursor_for_no_MB(self):
"""
@@ -220,4 +220,4 @@ class DnaSegment_GraphicsMode(BuildDna_GraphicsMode):
#Draw the text next to the cursor that gives info about
#number of base pairs etc
- self._drawCursorText() \ No newline at end of file
+ self._drawCursorText()
diff --git a/cad/src/temporary_commands/LineMode/Line_GraphicsMode.py b/cad/src/temporary_commands/LineMode/Line_GraphicsMode.py
index 7c1c266c6..e916ca281 100644
--- a/cad/src/temporary_commands/LineMode/Line_GraphicsMode.py
+++ b/cad/src/temporary_commands/LineMode/Line_GraphicsMode.py
@@ -223,7 +223,7 @@ class Line_GraphicsMode( Select_GraphicsMode ):
#activated/deactivated
self.update_cursor()
- return value # russ 080527
+ return value
def snapLineEndPoint(self):
"""