Commit 31063346d14008a4300a083d6729c225aea8fa58
1 parent
58501c8f
Exists in
master
and in
67 other branches
When changing the mask colour changing the pencil cursor colour too
Showing
2 changed files
with
6 additions
and
3 deletions
Show diff stats
invesalius/data/cursor_actors.py
| @@ -49,6 +49,7 @@ class CursorCircle: | @@ -49,6 +49,7 @@ class CursorCircle: | ||
| 49 | """ | 49 | """ |
| 50 | Function to plot the circle | 50 | Function to plot the circle |
| 51 | """ | 51 | """ |
| 52 | + print "Building circle cursor", self.orientation | ||
| 52 | r = self.radius | 53 | r = self.radius |
| 53 | t = 0 | 54 | t = 0 |
| 54 | 55 | ||
| @@ -68,6 +69,8 @@ class CursorCircle: | @@ -68,6 +69,8 @@ class CursorCircle: | ||
| 68 | 69 | ||
| 69 | self.mapper.SetInputConnection(self.segment.GetOutputPort()) | 70 | self.mapper.SetInputConnection(self.segment.GetOutputPort()) |
| 70 | self.actor.SetMapper(self.mapper) | 71 | self.actor.SetMapper(self.mapper) |
| 72 | + self.actor.GetProperty().SetOpacity(self.opacity) | ||
| 73 | + self.actor.GetProperty().SetColor(self.colour) | ||
| 71 | self.actor.PickableOff() | 74 | self.actor.PickableOff() |
| 72 | 75 | ||
| 73 | def GenerateCicleSegment(self, t): | 76 | def GenerateCicleSegment(self, t): |
| @@ -210,6 +213,7 @@ class CursorRectangle: | @@ -210,6 +213,7 @@ class CursorRectangle: | ||
| 210 | """ | 213 | """ |
| 211 | Function to plot the Retangle | 214 | Function to plot the Retangle |
| 212 | """ | 215 | """ |
| 216 | + print "Building rectangle cursor", self.orientation | ||
| 213 | mapper = vtk.vtkPolyDataMapper() | 217 | mapper = vtk.vtkPolyDataMapper() |
| 214 | self.retangle = vtk.vtkCubeSource() | 218 | self.retangle = vtk.vtkCubeSource() |
| 215 | self.actor = actor = vtk.vtkActor() | 219 | self.actor = actor = vtk.vtkActor() |
invesalius/data/viewer_slice.py
| @@ -522,9 +522,8 @@ class Viewer(wx.Panel): | @@ -522,9 +522,8 @@ class Viewer(wx.Panel): | ||
| 522 | colour_wx = pubsub_evt.data | 522 | colour_wx = pubsub_evt.data |
| 523 | colour_vtk = [colour/float(255) for colour in colour_wx] | 523 | colour_vtk = [colour/float(255) for colour in colour_wx] |
| 524 | self._brush_cursor_colour = colour_vtk | 524 | self._brush_cursor_colour = colour_vtk |
| 525 | - if self.cursor: | ||
| 526 | - self.cursor.SetColour(colour_vtk) | ||
| 527 | - self.interactor.Render() | 525 | + if self.slice_data.cursor: |
| 526 | + self.slice_data.cursor.SetColour(colour_vtk) | ||
| 528 | 527 | ||
| 529 | def ChangeBrushActor(self, pubsub_evt): | 528 | def ChangeBrushActor(self, pubsub_evt): |
| 530 | brush_type = pubsub_evt.data | 529 | brush_type = pubsub_evt.data |