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 | 222 | self.last_x, self.last_y = iren.GetLastEventPosition() |
| 223 | 223 | |
| 224 | 224 | |
| 225 | -class LinearMeasure(ZoomInteractorStyle): | |
| 225 | +class LinearMeasureInteractorStyle(ZoomInteractorStyle): | |
| 226 | 226 | """ |
| 227 | 227 | Interactor style responsible for insert linear measurements. |
| 228 | 228 | """ |
| ... | ... | @@ -251,22 +251,7 @@ class LinearMeasure(ZoomInteractorStyle): |
| 251 | 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 | 256 | Interactor style responsible for insert angular measurements. |
| 272 | 257 | """ |
| ... | ... | @@ -295,6 +280,21 @@ class AngularMeasure(ZoomInteractorStyle): |
| 295 | 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 | 298 | class ViewerStyle: |
| 299 | 299 | def __init__(self): |
| 300 | 300 | self.interactor = None | ... | ... |
invesalius/data/viewer_slice.py
| ... | ... | @@ -206,13 +206,13 @@ class Viewer(wx.Panel): |
| 206 | 206 | self.interactor.Render() |
| 207 | 207 | |
| 208 | 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 | 210 | self.style = style |
| 211 | 211 | self.interactor.SetInteractorStyle(style) |
| 212 | 212 | self.interactor.Render() |
| 213 | 213 | |
| 214 | 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 | 216 | self.style = style |
| 217 | 217 | self.interactor.SetInteractorStyle(style) |
| 218 | 218 | self.interactor.Render() | ... | ... |