chiark / gitweb /
Rename opengl to openglHelpers to better tell what it does.
authordaid <daid303@gmail.com>
Thu, 6 Feb 2014 12:13:26 +0000 (13:13 +0100)
committerdaid <daid303@gmail.com>
Thu, 6 Feb 2014 12:13:26 +0000 (13:13 +0100)
Cura/gui/sceneView.py
Cura/gui/util/engineResultView.py
Cura/gui/util/openglGui.py
Cura/gui/util/openglHelpers.py [moved from Cura/gui/util/opengl.py with 100% similarity]
Cura/gui/util/previewTools.py

index 80750c96a50a254da06def80f68bc0ed7d7e94d0..e0430f702659dd6fb671e5af68a00bda9744f61c 100644 (file)
@@ -27,7 +27,7 @@ from Cura.util import removableStorage
 from Cura.util import explorer
 from Cura.util.printerConnection import printerConnectionManager
 from Cura.gui.util import previewTools
-from Cura.gui.util import opengl
+from Cura.gui.util import openglHelpers
 from Cura.gui.util import openglGui
 from Cura.gui.util import engineResultView
 from Cura.gui.tools import youmagineGui
@@ -702,7 +702,7 @@ class SceneView(openglGui.glGuiPanel):
                                        print k, self._afterLeakTest[k], self._beforeLeakTest[k], self._afterLeakTest[k] - self._beforeLeakTest[k]
 
        def ShaderUpdate(self, v, f):
-               s = opengl.GLShader(v, f)
+               s = openglHelpers.GLShader(v, f)
                if s.isValid():
                        self._objectLoadShader.release()
                        self._objectLoadShader = s
@@ -830,8 +830,8 @@ class SceneView(openglGui.glGuiPanel):
        def getMouseRay(self, x, y):
                if self._viewport is None:
                        return numpy.array([0,0,0],numpy.float32), numpy.array([0,0,1],numpy.float32)
-               p0 = opengl.unproject(x, self._viewport[1] + self._viewport[3] - y, 0, self._modelMatrix, self._projMatrix, self._viewport)
-               p1 = opengl.unproject(x, self._viewport[1] + self._viewport[3] - y, 1, self._modelMatrix, self._projMatrix, self._viewport)
+               p0 = openglHelpers.unproject(x, self._viewport[1] + self._viewport[3] - y, 0, self._modelMatrix, self._projMatrix, self._viewport)
+               p1 = openglHelpers.unproject(x, self._viewport[1] + self._viewport[3] - y, 1, self._modelMatrix, self._projMatrix, self._viewport)
                p0 -= self._viewTarget
                p1 -= self._viewTarget
                return p0, p1
@@ -886,8 +886,8 @@ class SceneView(openglGui.glGuiPanel):
                        if self._animZoom.isDone():
                                self._animZoom = None
                if self._objectShader is None:
-                       if opengl.hasShaderSupport():
-                               self._objectShader = opengl.GLShader("""
+                       if openglHelpers.hasShaderSupport():
+                               self._objectShader = openglHelpers.GLShader("""
 varying float light_amount;
 
 void main(void)
@@ -906,7 +906,7 @@ void main(void)
        gl_FragColor = vec4(gl_Color.xyz * light_amount, gl_Color[3]);
 }
                                """)
-                               self._objectOverhangShader = opengl.GLShader("""
+                               self._objectOverhangShader = openglHelpers.GLShader("""
 uniform float cosAngle;
 uniform mat3 rotMatrix;
 varying float light_amount;
@@ -936,7 +936,7 @@ void main(void)
        }
 }
                                """)
-                               self._objectLoadShader = opengl.GLShader("""
+                               self._objectLoadShader = openglHelpers.GLShader("""
 uniform float intensity;
 uniform float scale;
 varying float light_amount;
@@ -962,8 +962,8 @@ void main(void)
 }
                                """)
                        if self._objectShader is None or not self._objectShader.isValid():
-                               self._objectShader = opengl.GLFakeShader()
-                               self._objectOverhangShader = opengl.GLFakeShader()
+                               self._objectShader = openglHelpers.GLFakeShader()
+                               self._objectOverhangShader = openglHelpers.GLFakeShader()
                                self._objectLoadShader = None
                self._init3DView()
                glTranslate(0,0,-self._zoom)
@@ -993,7 +993,7 @@ void main(void)
                                self._focusObj = None
                        f = glReadPixels(self._mouseX, self.GetSize().GetHeight() - 1 - self._mouseY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT)[0][0]
                        #self.GetTopLevelParent().SetTitle(hex(n) + " " + str(f))
-                       self._mouse3Dpos = opengl.unproject(self._mouseX, self._viewport[1] + self._viewport[3] - self._mouseY, f, self._modelMatrix, self._projMatrix, self._viewport)
+                       self._mouse3Dpos = openglHelpers.unproject(self._mouseX, self._viewport[1] + self._viewport[3] - self._mouseY, f, self._modelMatrix, self._projMatrix, self._viewport)
                        self._mouse3Dpos -= self._viewTarget
 
                self._init3DView()
@@ -1181,13 +1181,13 @@ void main(void)
                                glTranslate(pos[0], pos[1], pos[2])
                                self.tool.OnDraw()
                                glPopMatrix()
-               if self.viewMode == 'overhang' and not opengl.hasShaderSupport():
+               if self.viewMode == 'overhang' and not openglHelpers.hasShaderSupport():
                        glDisable(GL_DEPTH_TEST)
                        glPushMatrix()
                        glLoadIdentity()
                        glTranslate(0,-4,-10)
                        glColor4ub(60,60,60,255)
-                       opengl.glDrawStringCenter(_("Overhang view not working due to lack of OpenGL shaders support."))
+                       openglHelpers.glDrawStringCenter(_("Overhang view not working due to lack of OpenGL shaders support."))
                        glPopMatrix()
 
        def _renderObject(self, obj, brightness = False, addSink = True):
@@ -1198,19 +1198,19 @@ void main(void)
                        glTranslate(obj.getPosition()[0], obj.getPosition()[1], obj.getSize()[2] / 2)
 
                if self.tempMatrix is not None and obj == self._selectedObj:
-                       tempMatrix = opengl.convert3x3MatrixTo4x4(self.tempMatrix)
+                       tempMatrix = openglHelpers.convert3x3MatrixTo4x4(self.tempMatrix)
                        glMultMatrixf(tempMatrix)
 
                offset = obj.getDrawOffset()
                glTranslate(-offset[0], -offset[1], -offset[2] - obj.getSize()[2] / 2)
 
-               tempMatrix = opengl.convert3x3MatrixTo4x4(obj.getMatrix())
+               tempMatrix = openglHelpers.convert3x3MatrixTo4x4(obj.getMatrix())
                glMultMatrixf(tempMatrix)
 
                n = 0
                for m in obj._meshList:
                        if m.vbo is None:
-                               m.vbo = opengl.GLVBO(GL_TRIANGLES, m.vertexes, m.normal)
+                               m.vbo = openglHelpers.GLVBO(GL_TRIANGLES, m.vertexes, m.normal)
                        if brightness:
                                glColor4fv(map(lambda n: n * brightness, self._objColors[n]))
                                n += 1
@@ -1243,7 +1243,7 @@ void main(void)
                        #For the Ultimaker 2 render the texture on the back plate to show the Ultimaker2 text.
                        if machine == 'ultimaker2':
                                if not hasattr(self._platformMesh[machine], 'texture'):
-                                       self._platformMesh[machine].texture = opengl.loadGLTexture('Ultimaker2backplate.png')
+                                       self._platformMesh[machine].texture = openglHelpers.loadGLTexture('Ultimaker2backplate.png')
                                glBindTexture(GL_TEXTURE_2D, self._platformMesh[machine].texture)
                                glEnable(GL_TEXTURE_2D)
                                glPushMatrix()
@@ -1317,7 +1317,7 @@ void main(void)
 
                #Draw checkerboard
                if self._platformTexture is None:
-                       self._platformTexture = opengl.loadGLTexture('checkerboard.png')
+                       self._platformTexture = openglHelpers.loadGLTexture('checkerboard.png')
                        glBindTexture(GL_TEXTURE_2D, self._platformTexture)
                        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
                        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
index 8786afc9faca899d7863f7af51ca84ece61dbd32..9fa2ff2685ef16e805792363dded8d0a2bccc42f 100644 (file)
@@ -10,7 +10,7 @@ from OpenGL.GLU import *
 from OpenGL.GL import *
 
 from Cura.util import profile
-from Cura.gui.util import opengl
+from Cura.gui.util import openglHelpers
 from Cura.gui.util import openglGui
 
 class engineResultView(object):
@@ -147,7 +147,7 @@ class engineResultView(object):
                        glLoadIdentity()
                        glTranslate(0,-0.8,-2)
                        glColor4ub(60,60,60,255)
-                       opengl.glDrawStringCenter(_("Loading toolpath for visualization (%d%%)") % (self._gcodeLoadProgress * 100))
+                       openglHelpers.glDrawStringCenter(_("Loading toolpath for visualization (%d%%)") % (self._gcodeLoadProgress * 100))
                        glPopMatrix()
 
        def _polygonsToVBO_lines(self, polygons):
@@ -162,7 +162,7 @@ class engineResultView(object):
                                i = numpy.arange(len(verts), len(verts) + len(poly), 1, numpy.uint32)
                        indices = numpy.concatenate((indices, i), 0)
                        verts = numpy.concatenate((verts, poly), 0)
-               return opengl.GLVBO(GL_LINES, verts, indicesArray=indices)
+               return openglHelpers.GLVBO(GL_LINES, verts, indicesArray=indices)
 
        def _polygonsToVBO_quads(self, polygons):
                verts = numpy.zeros((0, 3), numpy.float32)
@@ -176,7 +176,7 @@ class engineResultView(object):
                        indices = numpy.concatenate((indices, i), 0)
                        verts = numpy.concatenate((verts, poly), 0)
                        verts = numpy.concatenate((verts, poly * numpy.array([1,0,1],numpy.float32) + numpy.array([0,-100,0],numpy.float32)), 0)
-               return opengl.GLVBO(GL_QUADS, verts, indicesArray=indices)
+               return openglHelpers.GLVBO(GL_QUADS, verts, indicesArray=indices)
 
        def _gcodeToVBO_lines(self, gcodeLayers, extrudeType):
                if ':' in extrudeType:
@@ -193,7 +193,7 @@ class engineResultView(object):
                                        i = numpy.dstack((i[0:-1],i[1:])).flatten()
                                        indices = numpy.concatenate((indices, i), 0)
                                        verts = numpy.concatenate((verts, path['points']))
-               return opengl.GLVBO(GL_LINES, verts, indicesArray=indices)
+               return openglHelpers.GLVBO(GL_LINES, verts, indicesArray=indices)
 
        def _gcodeToVBO_quads(self, gcodeLayers, extrudeType):
                useFilamentArea = profile.getMachineSetting('gcode_flavor') == 'UltiGCode'
@@ -241,7 +241,7 @@ class engineResultView(object):
 
                                        verts = numpy.concatenate((verts, b))
                                        indices = numpy.concatenate((indices, i))
-               return opengl.GLVBO(GL_QUADS, verts, indicesArray=indices)
+               return openglHelpers.GLVBO(GL_QUADS, verts, indicesArray=indices)
 
        def _gcodeToVBO_lines(self, gcodeLayers):
                verts = numpy.zeros((0,3), numpy.float32)
@@ -261,7 +261,7 @@ class engineResultView(object):
                                        i = numpy.arange(len(verts), len(verts) + len(a), 1, numpy.uint32)
                                        verts = numpy.concatenate((verts, a))
                                        indices = numpy.concatenate((indices, i))
-               return opengl.GLVBO(GL_LINES, verts, indicesArray=indices)
+               return openglHelpers.GLVBO(GL_LINES, verts, indicesArray=indices)
 
        def OnKeyChar(self, keyCode):
                if not self._enabled:
index fc4c12d129d9f67edbc7f244d964d04968d8aa51..62588dcce40765471ec3e63b638995bfdd92811e 100644 (file)
@@ -13,7 +13,7 @@ import OpenGL
 from OpenGL.GL import *
 
 from Cura.util import version
-from Cura.gui.util import opengl
+from Cura.gui.util import openglHelpers
 
 class animation(object):
        def __init__(self, gui, start, end, runTime):
@@ -234,7 +234,7 @@ class glGuiPanel(glcanvas.GLCanvas):
                                glLoadIdentity()
                                glTranslate(10, self.GetSize().GetHeight() - 30, -1)
                                glColor4f(0.2,0.2,0.2,0.5)
-                               opengl.glDrawStringLeft("fps:%d" % (1 / renderTime))
+                               openglHelpers.glDrawStringLeft("fps:%d" % (1 / renderTime))
                        self.SwapBuffers()
                except:
                        errStr = _("An error has occurred during the 3D view drawing.")
@@ -250,8 +250,8 @@ class glGuiPanel(glcanvas.GLCanvas):
 
        def _drawGui(self):
                if self._glButtonsTexture is None:
-                       self._glButtonsTexture = opengl.loadGLTexture('glButtons.png')
-                       self._glRobotTexture = opengl.loadGLTexture('UltimakerRobot.png')
+                       self._glButtonsTexture = openglHelpers.loadGLTexture('glButtons.png')
+                       self._glRobotTexture = openglHelpers.loadGLTexture('UltimakerRobot.png')
 
                glDisable(GL_DEPTH_TEST)
                glEnable(GL_BLEND)
@@ -465,13 +465,13 @@ class glButton(glGuiControl):
                        glColor4ub(128,128,128,128)
                else:
                        glColor4ub(255,255,255,255)
-               opengl.glDrawTexturedQuad(pos[0]-bs*scale/2, pos[1]-bs*scale/2, bs*scale, bs*scale, 0)
-               opengl.glDrawTexturedQuad(pos[0]-bs*scale/2, pos[1]-bs*scale/2, bs*scale, bs*scale, self._imageID)
+               openglHelpers.glDrawTexturedQuad(pos[0]-bs*scale/2, pos[1]-bs*scale/2, bs*scale, bs*scale, 0)
+               openglHelpers.glDrawTexturedQuad(pos[0]-bs*scale/2, pos[1]-bs*scale/2, bs*scale, bs*scale, self._imageID)
                if self._showExpandArrow:
                        if self._selected:
-                               opengl.glDrawTexturedQuad(pos[0]+bs*scale/2-bs*scale/4*1.2, pos[1]-bs*scale/2*1.2, bs*scale/4, bs*scale/4, 1)
+                               openglHelpers.glDrawTexturedQuad(pos[0]+bs*scale/2-bs*scale/4*1.2, pos[1]-bs*scale/2*1.2, bs*scale/4, bs*scale/4, 1)
                        else:
-                               opengl.glDrawTexturedQuad(pos[0]+bs*scale/2-bs*scale/4*1.2, pos[1]-bs*scale/2*1.2, bs*scale/4, bs*scale/4, 1, 2)
+                               openglHelpers.glDrawTexturedQuad(pos[0]+bs*scale/2-bs*scale/4*1.2, pos[1]-bs*scale/2*1.2, bs*scale/4, bs*scale/4, 1, 2)
                glPushMatrix()
                glTranslatef(pos[0], pos[1], 0)
                glDisable(GL_TEXTURE_2D)
@@ -481,24 +481,24 @@ class glButton(glGuiControl):
                        glPushMatrix()
                        glColor4ub(60,60,60,255)
                        glTranslatef(-1, -1, 0)
-                       opengl.glDrawStringCenter(self._tooltip)
+                       openglHelpers.glDrawStringCenter(self._tooltip)
                        glTranslatef(0, 2, 0)
-                       opengl.glDrawStringCenter(self._tooltip)
+                       openglHelpers.glDrawStringCenter(self._tooltip)
                        glTranslatef(2, 0, 0)
-                       opengl.glDrawStringCenter(self._tooltip)
+                       openglHelpers.glDrawStringCenter(self._tooltip)
                        glTranslatef(0, -2, 0)
-                       opengl.glDrawStringCenter(self._tooltip)
+                       openglHelpers.glDrawStringCenter(self._tooltip)
                        glPopMatrix()
 
                        glColor4ub(255,255,255,255)
-                       opengl.glDrawStringCenter(self._tooltip)
+                       openglHelpers.glDrawStringCenter(self._tooltip)
                glPopMatrix()
                progress = self._progressBar
                if progress is not None:
                        glColor4ub(60,60,60,255)
-                       opengl.glDrawQuad(pos[0]-bs/2, pos[1]+bs/2, bs, bs / 4)
+                       openglHelpers.glDrawQuad(pos[0]-bs/2, pos[1]+bs/2, bs, bs / 4)
                        glColor4ub(255,255,255,255)
-                       opengl.glDrawQuad(pos[0]-bs/2+2, pos[1]+bs/2+2, (bs - 5) * progress + 1, bs / 4 - 4)
+                       openglHelpers.glDrawQuad(pos[0]-bs/2+2, pos[1]+bs/2+2, (bs - 5) * progress + 1, bs / 4 - 4)
                elif len(self._altTooltip) > 0:
                        glPushMatrix()
                        glTranslatef(pos[0], pos[1], 0)
@@ -510,17 +510,17 @@ class glButton(glGuiControl):
                                glPushMatrix()
                                glColor4ub(60,60,60,255)
                                glTranslatef(-1, -1, 0)
-                               opengl.glDrawStringCenter(line)
+                               openglHelpers.glDrawStringCenter(line)
                                glTranslatef(0, 2, 0)
-                               opengl.glDrawStringCenter(line)
+                               openglHelpers.glDrawStringCenter(line)
                                glTranslatef(2, 0, 0)
-                               opengl.glDrawStringCenter(line)
+                               openglHelpers.glDrawStringCenter(line)
                                glTranslatef(0, -2, 0)
-                               opengl.glDrawStringCenter(line)
+                               openglHelpers.glDrawStringCenter(line)
                                glPopMatrix()
 
                                glColor4ub(255,255,255,255)
-                               opengl.glDrawStringCenter(line)
+                               openglHelpers.glDrawStringCenter(line)
                                glTranslatef(0, 18, 0)
                        glPopMatrix()
 
@@ -597,8 +597,8 @@ class glComboButton(glButton):
                for n in xrange(0, len(self._imageIDs)):
                        glTranslatef(0, bs, 0)
                        glColor4ub(255,255,255,255)
-                       opengl.glDrawTexturedQuad(-0.5*bs,-0.5*bs,bs,bs, 0)
-                       opengl.glDrawTexturedQuad(-0.5*bs,-0.5*bs,bs,bs, self._imageIDs[n])
+                       openglHelpers.glDrawTexturedQuad(-0.5*bs,-0.5*bs,bs,bs, 0)
+                       openglHelpers.glDrawTexturedQuad(-0.5*bs,-0.5*bs,bs,bs, self._imageIDs[n])
                        glDisable(GL_TEXTURE_2D)
 
                        glPushMatrix()
@@ -607,17 +607,17 @@ class glComboButton(glButton):
                        glPushMatrix()
                        glColor4ub(60,60,60,255)
                        glTranslatef(-1, -1, 0)
-                       opengl.glDrawStringRight(self._tooltips[n])
+                       openglHelpers.glDrawStringRight(self._tooltips[n])
                        glTranslatef(0, 2, 0)
-                       opengl.glDrawStringRight(self._tooltips[n])
+                       openglHelpers.glDrawStringRight(self._tooltips[n])
                        glTranslatef(2, 0, 0)
-                       opengl.glDrawStringRight(self._tooltips[n])
+                       openglHelpers.glDrawStringRight(self._tooltips[n])
                        glTranslatef(0, -2, 0)
-                       opengl.glDrawStringRight(self._tooltips[n])
+                       openglHelpers.glDrawStringRight(self._tooltips[n])
                        glPopMatrix()
 
                        glColor4ub(255,255,255,255)
-                       opengl.glDrawStringRight(self._tooltips[n])
+                       openglHelpers.glDrawStringRight(self._tooltips[n])
                        glPopMatrix()
                glPopMatrix()
 
@@ -678,7 +678,7 @@ class glFrame(glGuiContainer):
 
                size = self._layout.getLayoutSize()
                glColor4ub(255,255,255,255)
-               opengl.glDrawStretchedQuad(pos[0], pos[1], size[0], size[1], bs*0.75, 0)
+               openglHelpers.glDrawStretchedQuad(pos[0], pos[1], size[0], size[1], bs*0.75, 0)
                #Draw the controls on the frame
                super(glFrame, self).draw()
 
@@ -757,7 +757,7 @@ class glLabel(glGuiControl):
                self._label = label
 
        def getMinSize(self):
-               w, h = opengl.glGetStringSize(self._label)
+               w, h = openglHelpers.glGetStringSize(self._label)
                return w + 10, h + 4
 
        def _getPixelPos(self):
@@ -784,7 +784,7 @@ class glLabel(glGuiControl):
 
                glTranslate(5, h - 5, 0)
                glColor4ub(255,255,255,255)
-               opengl.glDrawStringLeft(self._label)
+               openglHelpers.glDrawStringLeft(self._label)
                glPopMatrix()
 
        def _checkHit(self, x, y):
@@ -811,7 +811,7 @@ class glNumberCtrl(glGuiControl):
                self._value = str(value)
 
        def getMinSize(self):
-               w, h = opengl.glGetStringSize("VALUES")
+               w, h = openglHelpers.glGetStringSize("VALUES")
                return w + 10, h + 4
 
        def _getPixelPos(self):
@@ -841,10 +841,10 @@ class glNumberCtrl(glGuiControl):
 
                glTranslate(5, h - 5, 0)
                glColor4ub(0,0,0,255)
-               opengl.glDrawStringLeft(self._value)
+               openglHelpers.glDrawStringLeft(self._value)
                if self.hasFocus():
-                       glTranslate(opengl.glGetStringSize(self._value[0:self._selectPos])[0] - 2, -1, 0)
-                       opengl.glDrawStringLeft('|')
+                       glTranslate(openglHelpers.glGetStringSize(self._value[0:self._selectPos])[0] - 2, -1, 0)
+                       openglHelpers.glDrawStringLeft('|')
                glPopMatrix()
 
        def _checkHit(self, x, y):
@@ -942,9 +942,9 @@ class glCheckbox(glGuiControl):
 
                glColor3ub(255,255,255)
                if self._value:
-                       opengl.glDrawTexturedQuad(w/2-h/2,0, h, h, 28)
+                       openglHelpers.glDrawTexturedQuad(w/2-h/2,0, h, h, 28)
                else:
-                       opengl.glDrawTexturedQuad(w/2-h/2,0, h, h, 29)
+                       openglHelpers.glDrawTexturedQuad(w/2-h/2,0, h, h, 29)
 
                glPopMatrix()
 
@@ -1033,12 +1033,12 @@ class glSlider(glGuiControl):
                if True:  # self._focus:
                        glColor4ub(0,0,0,255)
                        glPushMatrix()
-                       glTranslate(-w/2,opengl.glGetStringSize(str(self._minValue))[1]/2,0)
-                       opengl.glDrawStringRight(str(self._minValue))
+                       glTranslate(-w/2,openglHelpers.glGetStringSize(str(self._minValue))[1]/2,0)
+                       openglHelpers.glDrawStringRight(str(self._minValue))
                        glTranslate(0,-scrollLength,0)
-                       opengl.glDrawStringRight(str(self._maxValue))
+                       openglHelpers.glDrawStringRight(str(self._maxValue))
                        glTranslate(w,scrollLength-scrollLength*valueNormalized,0)
-                       opengl.glDrawStringLeft(str(self.getValue()))
+                       openglHelpers.glDrawStringLeft(str(self.getValue()))
                        glPopMatrix()
                glColor4ub(255,255,255,240)
                glTranslate(0.0,-scrollLength*valueNormalized,0)
index d90feb480c2f4be202ed54acd724bf165ad7dfa1..d784d1cc9d3d640af2b5b995251d202baf59b383 100644 (file)
@@ -9,7 +9,7 @@ import OpenGL
 from OpenGL.GLU import *
 from OpenGL.GL import *
 
-from Cura.gui.util import opengl
+from Cura.gui.util import openglHelpers
 
 class toolNone(object):
        def __init__(self, parent):
@@ -63,7 +63,7 @@ class toolInfo(object):
                        glTranslate(0, (radius + 5) * (90 - self.parent.pitch) / 10,0)
                else:
                        glTranslate(0,-(radius + 5),0)
-               opengl.glDrawStringCenter("%dx%dx%d" % (size[0], size[1], size[2]))
+               openglHelpers.glDrawStringCenter("%dx%dx%d" % (size[0], size[1], size[2]))
                glPopMatrix()
 
                glColor(255,255,255)
@@ -208,7 +208,7 @@ class toolRotate(object):
                                glEnd()
                                glTranslatef(1.1,0,0)
                                glColor4ub(0,0,0,255)
-                               opengl.glDrawStringCenter("%d" % (abs(self.dragEndAngle - self.dragStartAngle) + 0.5))
+                               openglHelpers.glDrawStringCenter("%d" % (abs(self.dragEndAngle - self.dragStartAngle) + 0.5))
                                glColor4ub(255,64,64,255)
                                glPopMatrix()
                else:
@@ -237,7 +237,7 @@ class toolRotate(object):
                                glEnd()
                                glTranslatef(0,1.1,0)
                                glColor4ub(0,0,0,255)
-                               opengl.glDrawStringCenter("%d" % (abs(self.dragEndAngle - self.dragStartAngle)))
+                               openglHelpers.glDrawStringCenter("%d" % (abs(self.dragEndAngle - self.dragStartAngle)))
                                glColor4ub(64,255,64,255)
                                glPopMatrix()
                else:
@@ -266,7 +266,7 @@ class toolRotate(object):
                                glEnd()
                                glTranslatef(1.1,0,0)
                                glColor4ub(0,0,0,255)
-                               opengl.glDrawStringCenter("%d" % (abs(self.dragEndAngle - self.dragStartAngle)))
+                               openglHelpers.glDrawStringCenter("%d" % (abs(self.dragEndAngle - self.dragStartAngle)))
                                glColor4ub(255,255,0,255)
                                glPopMatrix()
                else:
@@ -408,7 +408,7 @@ class toolScale(object):
                        glTranslate(0,-(radius + 5),0)
                if self.parent.tempMatrix is not None:
                        size = (numpy.matrix([size]) * self.parent.tempMatrix).getA().flatten()
-               opengl.glDrawStringCenter("W, D, H: %0.1f, %0.1f, %0.1f mm" % (size[0], size[1], size[2]))
+               openglHelpers.glDrawStringCenter("W, D, H: %0.1f, %0.1f, %0.1f mm" % (size[0], size[1], size[2]))
                glPopMatrix()
 
                glLineWidth(1)
@@ -429,10 +429,10 @@ class toolScale(object):
                        glColor3ub(255,255,255)
                else:
                        glColor3ub(192,192,192)
-               opengl.DrawBox([-s,-s,-s], [s,s,s])
+               openglHelpers.DrawBox([-s,-s,-s], [s,s,s])
                if self.node == 1:
                        glColor3ub(0,0,0)
-                       opengl.glDrawStringCenter("%0.2f" % ((scaleX + scaleY + scaleZ) / 3.0))
+                       openglHelpers.glDrawStringCenter("%0.2f" % ((scaleX + scaleY + scaleZ) / 3.0))
 
                if self.node == 2:
                        glColor3ub(255,64,64)
@@ -440,10 +440,10 @@ class toolScale(object):
                        glColor3ub(128,0,0)
                glPushMatrix()
                glTranslatef(sx,0,0)
-               opengl.DrawBox([-s,-s,-s], [s,s,s])
+               openglHelpers.DrawBox([-s,-s,-s], [s,s,s])
                if self.node == 2:
                        glColor3ub(0,0,0)
-                       opengl.glDrawStringCenter("%0.2f" % (scaleX))
+                       openglHelpers.glDrawStringCenter("%0.2f" % (scaleX))
                glPopMatrix()
                if self.node == 3:
                        glColor3ub(64,255,64)
@@ -451,10 +451,10 @@ class toolScale(object):
                        glColor3ub(0,128,0)
                glPushMatrix()
                glTranslatef(0,sy,0)
-               opengl.DrawBox([-s,-s,-s], [s,s,s])
+               openglHelpers.DrawBox([-s,-s,-s], [s,s,s])
                if self.node == 3:
                        glColor3ub(0,0,0)
-                       opengl.glDrawStringCenter("%0.2f" % (scaleY))
+                       openglHelpers.glDrawStringCenter("%0.2f" % (scaleY))
                glPopMatrix()
                if self.node == 4:
                        glColor3ub(64,64,255)
@@ -462,10 +462,10 @@ class toolScale(object):
                        glColor3ub(0,0,128)
                glPushMatrix()
                glTranslatef(0,0,sz)
-               opengl.DrawBox([-s,-s,-s], [s,s,s])
+               openglHelpers.DrawBox([-s,-s,-s], [s,s,s])
                if self.node == 4:
                        glColor3ub(0,0,0)
-                       opengl.glDrawStringCenter("%0.2f" % (scaleZ))
+                       openglHelpers.glDrawStringCenter("%0.2f" % (scaleZ))
                glPopMatrix()
 
                glEnable(GL_DEPTH_TEST)