2020from __future__ import print_function
2121
2222import logging
23- import os
2423import sys
2524
2625from OCC .Display import OCCViewer
@@ -111,8 +110,6 @@ def __init__(self, *kargs):
111110 self ._selection = None
112111 self ._drawtext = True
113112 self ._key_map = {}
114- self ._current_cursor = "arrow"
115- self ._available_cursors = {}
116113
117114 @property
118115 def qApp (self ):
@@ -130,26 +127,6 @@ def InitDriver(self):
130127 self ._SetupKeyMap ()
131128 #
132129 self ._display .thisown = False
133- self .createCursors ()
134-
135- def createCursors (self ):
136- module_pth = os .path .abspath (os .path .dirname (__file__ ))
137- icon_pth = os .path .join (module_pth , "icons" )
138-
139- _CURSOR_PIX_ROT = QtGui .QPixmap (os .path .join (icon_pth , "cursor-rotate.png" ))
140- _CURSOR_PIX_PAN = QtGui .QPixmap (os .path .join (icon_pth , "cursor-pan.png" ))
141- _CURSOR_PIX_ZOOM = QtGui .QPixmap (os .path .join (icon_pth , "cursor-magnify.png" ))
142- _CURSOR_PIX_ZOOM_AREA = QtGui .QPixmap (os .path .join (icon_pth , "cursor-magnify-area.png" ))
143-
144- self ._available_cursors = {
145- "arrow" : QtGui .QCursor (QtCore .Qt .ArrowCursor ), # default
146- "pan" : QtGui .QCursor (_CURSOR_PIX_PAN ),
147- "rotate" : QtGui .QCursor (_CURSOR_PIX_ROT ),
148- "zoom" : QtGui .QCursor (_CURSOR_PIX_ZOOM ),
149- "zoom-area" : QtGui .QCursor (_CURSOR_PIX_ZOOM_AREA ),
150- }
151-
152- self ._current_cursor = "arrow"
153130
154131 def _SetupKeyMap (self ):
155132 self ._key_map = {ord ('W' ): self ._display .SetModeWireFrame ,
@@ -197,22 +174,6 @@ def wheelEvent(self, event):
197174 def dragMoveEvent (self , event ):
198175 pass
199176
200- @property
201- def cursor (self ):
202- return self ._current_cursor
203-
204- @cursor .setter
205- def cursor (self , value ):
206- if not self ._current_cursor == value :
207-
208- self ._current_cursor = value
209- cursor = self ._available_cursors .get (value )
210-
211- if cursor :
212- self .qApp .setOverrideCursor (cursor )
213- else :
214- self .qApp .restoreOverrideCursor ()
215-
216177 def mousePressEvent (self , event ):
217178 self .setFocus ()
218179 ev = event .pos ()
@@ -247,7 +208,6 @@ def mouseReleaseEvent(self, event):
247208 self ._display .ZoomArea (Xmin , Ymin , Xmin + dx , Ymin + dy )
248209 self ._zoom_area = False
249210
250- self .cursor = "arrow"
251211
252212 def DrawBox (self , event ):
253213 tolerance = 2
@@ -266,13 +226,11 @@ def mouseMoveEvent(self, evt):
266226 # ROTATE
267227 if (buttons == QtCore .Qt .LeftButton and
268228 not modifiers == QtCore .Qt .ShiftModifier ):
269- self .cursor = "rotate"
270229 self ._display .Rotation (pt .x (), pt .y ())
271230 self ._drawbox = False
272231 # DYNAMIC ZOOM
273232 elif (buttons == QtCore .Qt .RightButton and
274233 not modifiers == QtCore .Qt .ShiftModifier ):
275- self .cursor = "zoom"
276234 self ._display .Repaint ()
277235 self ._display .DynamicZoom (abs (self .dragStartPosX ),
278236 abs (self .dragStartPosY ), abs (pt .x ()),
@@ -286,15 +244,13 @@ def mouseMoveEvent(self, evt):
286244 dy = pt .y () - self .dragStartPosY
287245 self .dragStartPosX = pt .x ()
288246 self .dragStartPosY = pt .y ()
289- self .cursor = "pan"
290247 self ._display .Pan (dx , - dy )
291248 self ._drawbox = False
292249 # DRAW BOX
293250 # ZOOM WINDOW
294251 elif (buttons == QtCore .Qt .RightButton and
295252 modifiers == QtCore .Qt .ShiftModifier ):
296253 self ._zoom_area = True
297- self .cursor = "zoom-area"
298254 self .DrawBox (evt )
299255 # SELECT AREA
300256 elif (buttons == QtCore .Qt .LeftButton and
@@ -304,4 +260,3 @@ def mouseMoveEvent(self, evt):
304260 else :
305261 self ._drawbox = False
306262 self ._display .MoveTo (pt .x (), pt .y ())
307- self .cursor = "arrow"
0 commit comments