Commit fbdb35a1297c74b360ee4dc1c8858fb703cf7e35
1 parent
d7fa8b4f
Exists in
master
and in
6 other branches
ADD: Brush change size
Showing
4 changed files
with
17 additions
and
10 deletions
Show diff stats
invesalius/data/cursor_actors.py
... | ... | @@ -77,7 +77,8 @@ class CursorCircle: |
77 | 77 | |
78 | 78 | def SetSize(self, radius): |
79 | 79 | self.radius = radius |
80 | - disk.SetInnerRadius(radius) | |
80 | + self.disk.SetInnerRadius(radius-1) # filled = self.radius | |
81 | + self.disk.SetOuterRadius(radius) # filled = 0x | |
81 | 82 | self.__calculate_area_pixels() |
82 | 83 | |
83 | 84 | def SetColour(self, colour): | ... | ... |
invesalius/data/viewer_slice.py
... | ... | @@ -129,6 +129,12 @@ class Viewer(wx.Panel): |
129 | 129 | |
130 | 130 | self.cursor = cursor |
131 | 131 | |
132 | + def ChangeBrushSize(self, pubsub_evt): | |
133 | + print "*****ChangeBrushSize" | |
134 | + size = pubsub_evt.data | |
135 | + self.cursor.SetSize(size) | |
136 | + self.ren.Render() | |
137 | + self.interactor.Render() | |
132 | 138 | |
133 | 139 | |
134 | 140 | def OnMouseClick(self, obj, evt_vtk): |
... | ... | @@ -258,6 +264,7 @@ class Viewer(wx.Panel): |
258 | 264 | ps.Publisher().subscribe(self.UpdateRender, 'Update slice viewer') |
259 | 265 | ps.Publisher().subscribe(self.ChangeSliceNumber, ('Set scroll position', |
260 | 266 | self.orientation)) |
267 | + ps.Publisher().subscribe(self.ChangeBrushSize,'Set edition brush size') | |
261 | 268 | |
262 | 269 | def __bind_events_wx(self): |
263 | 270 | self.scroll.Bind(wx.EVT_SCROLL, self.OnScrollBar) |
... | ... | @@ -269,10 +276,7 @@ class Viewer(wx.Panel): |
269 | 276 | def SetInput(self, imagedata): |
270 | 277 | |
271 | 278 | self.imagedata = imagedata |
272 | - | |
273 | - print "************************************" | |
274 | - print "spacing:", imagedata.GetSpacing() | |
275 | - print "************************************" | |
279 | + | |
276 | 280 | ren = self.ren |
277 | 281 | interactor = self.interactor |
278 | 282 | ... | ... |
invesalius/gui/default_tasks.py
... | ... | @@ -174,7 +174,7 @@ class UpperTaskPanel(wx.Panel): |
174 | 174 | |
175 | 175 | fold_panel.AddFoldPanelWindow(item, importer.TaskPanel(item), Spacing= 0, |
176 | 176 | leftSpacing=0, rightSpacing=0) |
177 | - fold_panel.Expand(fold_panel.GetFoldPanel(0)) | |
177 | + #fold_panel.Expand(fold_panel.GetFoldPanel(0)) | |
178 | 178 | |
179 | 179 | # Fold 2 - Mask for segmentation and edition |
180 | 180 | |
... | ... | @@ -185,7 +185,7 @@ class UpperTaskPanel(wx.Panel): |
185 | 185 | |
186 | 186 | fold_panel.AddFoldPanelWindow(item, slice_.TaskPanel(item), Spacing= 0, |
187 | 187 | leftSpacing=0, rightSpacing=0) |
188 | - #fold_panel.Expand(fold_panel.GetFoldPanel(1)) | |
188 | + fold_panel.Expand(fold_panel.GetFoldPanel(1)) | |
189 | 189 | |
190 | 190 | # Fold 3 |
191 | 191 | # select mask - combo | ... | ... |
invesalius/gui/task_slice.py
... | ... | @@ -483,16 +483,18 @@ class EditionTools(wx.Panel): |
483 | 483 | self.btn_brush_type.SetBitmap(bitmap[evt.GetId()]) |
484 | 484 | |
485 | 485 | print "TODO: Send Signal - Change brush format to %s"% name[evt.GetId()] |
486 | + ps.Publisher().sendMessage('Set brush format', name[evt.GetId()]) | |
486 | 487 | |
487 | 488 | def OnBrushSize(self, evt): |
488 | 489 | """ """ |
489 | 490 | # FIXME: Using wx.EVT_SPINCTRL in MacOS it doesnt capture changes only |
490 | 491 | # in the text ctrl - so we are capturing only changes on text |
491 | 492 | # Strangelly this is being called twice |
492 | - print "TODO: Send Signal - Change brush size to %s" % self.spin.GetValue() | |
493 | + print "TODO: Send Signal - Change brush size to %s" %self.spin.GetValue() | |
494 | + ps.Publisher().sendMessage('Set edition brush size',self.spin.GetValue()) | |
493 | 495 | |
494 | 496 | def OnComboBrushOp(self, evt): |
495 | - print "TODO: Send Signal - Change brush operation: %s" % (evt.GetString()) | |
497 | + print "TODO: Send Signal - Change brush operation: %s" %(evt.GetString()) | |
498 | + ps.Publisher().sendMessage('Set edition operation',evt.GetString()) | |
496 | 499 | |
497 | 500 | |
498 | -# TODO: Bind gradient related events | ... | ... |