summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Smith <bruce@nanorex.com>2009-03-10 18:03:55 +0000
committerBruce Smith <bruce@nanorex.com>2009-03-10 18:03:55 +0000
commitde1bd3020b67ff71431b0b9a6e65c03c3472fbf5 (patch)
tree9c748710e1a5736812afe8255cdf05c97677865e
parent5eaea8b40aadbfa299e7a794a13a93e77933a53a (diff)
downloadnanoengineer-de1bd3020b67ff71431b0b9a6e65c03c3472fbf5.tar.gz
nanoengineer-de1bd3020b67ff71431b0b9a6e65c03c3472fbf5.zip
merge Select_GraphicsMode_DrawMethod_preMixin back into its sole client
-rwxr-xr-xcad/src/commands/Select/Select_GraphicsMode.py55
-rwxr-xr-xcad/src/commands/Select/Select_GraphicsMode_DrawMethod_preMixin.py71
-rw-r--r--cad/src/tools/packageData.py1
3 files changed, 45 insertions, 82 deletions
diff --git a/cad/src/commands/Select/Select_GraphicsMode.py b/cad/src/commands/Select/Select_GraphicsMode.py
index f7a4db0b6..beaf368cb 100755
--- a/cad/src/commands/Select/Select_GraphicsMode.py
+++ b/cad/src/commands/Select/Select_GraphicsMode.py
@@ -1,4 +1,4 @@
-# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details.
+# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details.
"""
Select_GraphicsMode.py
The GraphicsMode part of the Select_Command. It provides the graphicsMode
@@ -11,7 +11,7 @@ For example:
- Key bindings or context menu
@version: $Id$
-@copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details.
+@copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details.
TODO:
- Select_basicGraphicsMode is the main GM class. It is inherited by
@@ -90,6 +90,7 @@ from utilities.constants import DELETE_SELECTION
from utilities.constants import black
import foundation.env as env
+
from utilities.debug_prefs import debug_pref
from utilities.debug_prefs import Choice
@@ -142,13 +143,13 @@ set_DRAG_STICKINESS_LIMIT_from_pref() # also called in SelectAtoms_GraphicsMode.
from command_support.GraphicsMode import basicGraphicsMode
from commands.Select.Select_GraphicsMode_MouseHelpers_preMixin import Select_GraphicsMode_MouseHelpers_preMixin
-from commands.Select.Select_GraphicsMode_DrawMethod_preMixin import Select_GraphicsMode_DrawMethod_preMixin
from temporary_commands.TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin
-class Select_basicGraphicsMode(Select_GraphicsMode_DrawMethod_preMixin,
- Select_GraphicsMode_MouseHelpers_preMixin,
- ESC_to_exit_GraphicsMode_preMixin,
- basicGraphicsMode):
+_superclass = basicGraphicsMode
+
+class Select_basicGraphicsMode( Select_GraphicsMode_MouseHelpers_preMixin,
+ ESC_to_exit_GraphicsMode_preMixin,
+ basicGraphicsMode ):
"""
The GraphicsMode part of the Select_Command. It provides the graphicsMode
object for its Command class. The GraphicsMode class defines anything
@@ -162,7 +163,6 @@ class Select_basicGraphicsMode(Select_GraphicsMode_DrawMethod_preMixin,
how this is implemented.
@see: B{Select_GraphicsMode}
@see: B{Select_Command}, B{Select_basicCommand}, B{selectMode}
- @see: B{Select_GraphicsMode_DrawMethod_preMixin}
@see: B{Select_GraphicsMode_MouseHelpers_preMixin}
@see: B{SelectChunks_basicGraphicsMode}, B{SelectAtoms_basicGraphicsMode}
which inherits this class
@@ -207,7 +207,7 @@ class Select_basicGraphicsMode(Select_GraphicsMode_DrawMethod_preMixin,
def __init__(self, glpane):
"""
"""
- basicGraphicsMode.__init__(self, glpane)
+ _superclass.__init__(self, glpane)
# Now do whatever might be needed to init the graphicsMode object,
# or the graphicsMode-related attrs of the mixed object.
#
@@ -237,7 +237,7 @@ class Select_basicGraphicsMode(Select_GraphicsMode_DrawMethod_preMixin,
@see: B{baseCommand.command_entered()} which calls this method
"""
- basicGraphicsMode.Enter_GraphicsMode(self)
+ _superclass.Enter_GraphicsMode(self)
self.reset_drag_vars()
self.ignore_next_leftUp_event = False
# Set to True in leftDouble() and checked by the left*Up()
@@ -245,6 +245,41 @@ class Select_basicGraphicsMode(Select_GraphicsMode_DrawMethod_preMixin,
# (second) left*Up event generated by the second LMB up/release
# event in a double click.
+ # ==
+
+ def Draw(self):
+ if 1:
+ # TODO: move this test code into a specific test mode just for it,
+ # so it doesn't clutter up or slow down this general-use mode.
+ #
+ # wware 060124 Embed Pyrex/OpenGL unit tests into the cad code
+ # grantham 060207:
+ # Set to 1 to see a small array of eight spheres.
+ # Set to 2 to see the Large-Bearing model, but this is most effective if
+ # the Large-Bearing has already been loaded normally into rotate mode
+ #bruce 060209 set this from a debug_pref menu item, not a hardcoded flag
+ TEST_PYREX_OPENGL = debug_pref("GLPane: TEST_PYREX_OPENGL", Choice([0,1,2]))
+ # uncomment this line to set it in the old way:
+ ## TEST_PYREX_OPENGL = 1
+ if TEST_PYREX_OPENGL:
+ from graphics.drawing.c_renderer import test_pyrex_opengl
+ test_pyrex_opengl(TEST_PYREX_OPENGL)
+ #bruce 090303 split this out (untested;
+ # it did work long ago when first written, inlined here)
+ pass
+ else:
+ if self.bc_in_use is not None: #bruce 060414
+ self.bc_in_use.draw(self.o, 'fake dispdef kluge')
+
+ _superclass.Draw(self)
+ #self.griddraw()
+ if self.selCurve_List:
+ self.draw_selection_curve()
+ self.o.assy.draw(self.o)
+ return
+
+ # ==
+
def getMovablesForLeftDragging(self):
"""
Returns a list of movables that will be moved during this gaphics mode's
diff --git a/cad/src/commands/Select/Select_GraphicsMode_DrawMethod_preMixin.py b/cad/src/commands/Select/Select_GraphicsMode_DrawMethod_preMixin.py
deleted file mode 100755
index fa3f3d209..000000000
--- a/cad/src/commands/Select/Select_GraphicsMode_DrawMethod_preMixin.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details.
-"""
-Select_GraphicsMode_DrawMethod_preMixin.py
-
-Mixin class for the Select_basicGraphicsMode. The only purpose of creating this
-mixin class was for easy understanding of the code in Select_basicGraphicsMode
-As the name suggest, this mixin class overrides only the Draw Method of the
-'basicGraphicsMode' . This is a 'preMixin' class, meaning, it needs to be
-inherited by the subclass 'Select_basicGraphicsMode' _before_ it inherits the
-'basicGraphicsMode'
-
-To be used as a Mixin class only for Select_basicGraphicsMode.
-
-@version: $Id$
-@copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details.
-
-TODO: this is now short enough that we could merge this module back into
-its client code.
-"""
-
-from utilities.debug_prefs import debug_pref
-from utilities.debug_prefs import Choice
-
-from command_support.GraphicsMode import commonGraphicsMode
-
-class Select_GraphicsMode_DrawMethod_preMixin(commonGraphicsMode):
- """
- Mixin class for the Select_basicGraphicsMode. The only purpose of creating this
- mixin class was for easy understanding of the code in Select_basicGraphicsMode
- As the name suggest, this mixin class overrides only the Draw Method of the
- 'basicGraphicsMode' . This is a 'preMixin' class, meaning, it needs to be
- inherited by the subclass 'Select_basicGraphicsMode' _before_ it inherits the
- 'basicGraphicsMode'.
- @see: B{Select_basicGraphicsMode}
- """
- # ==
-
- def Draw(self):
- if 1:
- # TODO: move this test code into a specific test mode just for it,
- # so it doesn't clutter up or slow down this general-use mode.
- #
- # wware 060124 Embed Pyrex/OpenGL unit tests into the cad code
- # grantham 060207:
- # Set to 1 to see a small array of eight spheres.
- # Set to 2 to see the Large-Bearing model, but this is most effective if
- # the Large-Bearing has already been loaded normally into rotate mode
- #bruce 060209 set this from a debug_pref menu item, not a hardcoded flag
- TEST_PYREX_OPENGL = debug_pref("GLPane: TEST_PYREX_OPENGL", Choice([0,1,2]))
- # uncomment this line to set it in the old way:
- ## TEST_PYREX_OPENGL = 1
- if TEST_PYREX_OPENGL:
- from graphics.drawing.c_renderer import test_pyrex_opengl
- test_pyrex_opengl(TEST_PYREX_OPENGL)
- #bruce 090303 split this out (untested;
- # it did work long ago when first written, inlined here)
- pass
- else:
- if self.bc_in_use is not None: #bruce 060414
- self.bc_in_use.draw(self.o, 'fake dispdef kluge')
-
- commonGraphicsMode.Draw(self)
- #self.griddraw()
- if self.selCurve_List:
- self.draw_selection_curve()
- self.o.assy.draw(self.o)
- return
-
- pass
-
-# end
diff --git a/cad/src/tools/packageData.py b/cad/src/tools/packageData.py
index f61ed0065..2ff9180d5 100644
--- a/cad/src/tools/packageData.py
+++ b/cad/src/tools/packageData.py
@@ -552,7 +552,6 @@ packageMapping_for_files = {
"Select_Command" : "command|commands/Select",
"Select_GraphicsMode" : "graphics_mode|commands/Select",
- "Select_GraphicsMode_DrawMethod_preMixin" : "graphics_mode|commands/Select",
"Select_GraphicsMode_MouseHelpers_preMixin" : "graphics_mode|commands/Select",
"selectMode" : "unsplit_mode|commands/Select",