Commit 354f97e80f0f917cc825554b4cf077bbd410a15b
1 parent
87eacea8
Exists in
interactor_style
STYLE: Renamed the class LinearMeasure and AngularMeasure
Showing
2 changed files
with
19 additions
and
19 deletions
Show diff stats
invesalius/data/styles.py
| @@ -222,7 +222,7 @@ class WWWLInteractorStyle(ZoomInteractorStyle): | @@ -222,7 +222,7 @@ class WWWLInteractorStyle(ZoomInteractorStyle): | ||
| 222 | self.last_x, self.last_y = iren.GetLastEventPosition() | 222 | self.last_x, self.last_y = iren.GetLastEventPosition() |
| 223 | 223 | ||
| 224 | 224 | ||
| 225 | -class LinearMeasure(ZoomInteractorStyle): | 225 | +class LinearMeasureInteractorStyle(ZoomInteractorStyle): |
| 226 | """ | 226 | """ |
| 227 | Interactor style responsible for insert linear measurements. | 227 | Interactor style responsible for insert linear measurements. |
| 228 | """ | 228 | """ |
| @@ -251,22 +251,7 @@ class LinearMeasure(ZoomInteractorStyle): | @@ -251,22 +251,7 @@ class LinearMeasure(ZoomInteractorStyle): | ||
| 251 | Publisher.sendMessage('Update slice viewer') | 251 | Publisher.sendMessage('Update slice viewer') |
| 252 | 252 | ||
| 253 | 253 | ||
| 254 | -class PanMoveInteractorStyle(ZoomInteractorStyle): | ||
| 255 | - """ | ||
| 256 | - Interactor style responsible for translate the camera. | ||
| 257 | - """ | ||
| 258 | - def __init__(self): | ||
| 259 | - ZoomInteractorStyle.__init__(self) | ||
| 260 | - self.AddObserver("MouseMoveEvent", self.OnPanMove) | ||
| 261 | - | ||
| 262 | - def OnPanMove(self, obj, evt): | ||
| 263 | - print "PAN" | ||
| 264 | - if self.left_pressed: | ||
| 265 | - obj.Pan() | ||
| 266 | - obj.OnRightButtonDown() | ||
| 267 | - | ||
| 268 | - | ||
| 269 | -class AngularMeasure(ZoomInteractorStyle): | 254 | +class AngularMeasureInteractorStyle(ZoomInteractorStyle): |
| 270 | """ | 255 | """ |
| 271 | Interactor style responsible for insert angular measurements. | 256 | Interactor style responsible for insert angular measurements. |
| 272 | """ | 257 | """ |
| @@ -295,6 +280,21 @@ class AngularMeasure(ZoomInteractorStyle): | @@ -295,6 +280,21 @@ class AngularMeasure(ZoomInteractorStyle): | ||
| 295 | Publisher.sendMessage('Update slice viewer') | 280 | Publisher.sendMessage('Update slice viewer') |
| 296 | 281 | ||
| 297 | 282 | ||
| 283 | +class PanMoveInteractorStyle(ZoomInteractorStyle): | ||
| 284 | + """ | ||
| 285 | + Interactor style responsible for translate the camera. | ||
| 286 | + """ | ||
| 287 | + def __init__(self): | ||
| 288 | + ZoomInteractorStyle.__init__(self) | ||
| 289 | + self.AddObserver("MouseMoveEvent", self.OnPanMove) | ||
| 290 | + | ||
| 291 | + def OnPanMove(self, obj, evt): | ||
| 292 | + print "PAN" | ||
| 293 | + if self.left_pressed: | ||
| 294 | + obj.Pan() | ||
| 295 | + obj.OnRightButtonDown() | ||
| 296 | + | ||
| 297 | + | ||
| 298 | class ViewerStyle: | 298 | class ViewerStyle: |
| 299 | def __init__(self): | 299 | def __init__(self): |
| 300 | self.interactor = None | 300 | self.interactor = None |
invesalius/data/viewer_slice.py
| @@ -206,13 +206,13 @@ class Viewer(wx.Panel): | @@ -206,13 +206,13 @@ class Viewer(wx.Panel): | ||
| 206 | self.interactor.Render() | 206 | self.interactor.Render() |
| 207 | 207 | ||
| 208 | elif state == const.STATE_MEASURE_DISTANCE: | 208 | elif state == const.STATE_MEASURE_DISTANCE: |
| 209 | - style = styles.LinearMeasure(self.orientation, self.slice_data) | 209 | + style = styles.LinearMeasureInteractorStyle(self.orientation, self.slice_data) |
| 210 | self.style = style | 210 | self.style = style |
| 211 | self.interactor.SetInteractorStyle(style) | 211 | self.interactor.SetInteractorStyle(style) |
| 212 | self.interactor.Render() | 212 | self.interactor.Render() |
| 213 | 213 | ||
| 214 | elif state == const.STATE_MEASURE_ANGLE: | 214 | elif state == const.STATE_MEASURE_ANGLE: |
| 215 | - style = styles.AngularMeasure(self.orientation, self.slice_data) | 215 | + style = styles.AngularMeasureInteractorStyle(self.orientation, self.slice_data) |
| 216 | self.style = style | 216 | self.style = style |
| 217 | self.interactor.SetInteractorStyle(style) | 217 | self.interactor.SetInteractorStyle(style) |
| 218 | self.interactor.Render() | 218 | self.interactor.Render() |