Commit 25d43e7999989cdc43c3b53de15f86e14411dffb
1 parent
7c5949ff
Exists in
master
and in
6 other branches
ENH: Linked new's icons of the reposition of the volume and surface
Showing
1 changed file
with
45 additions
and
48 deletions
Show diff stats
invesalius/gui/default_viewers.py
... | ... | @@ -39,26 +39,26 @@ class Panel(wx.Panel): |
39 | 39 | |
40 | 40 | |
41 | 41 | # TODO: Testar mais e verificar melhor opcao |
42 | - | |
42 | + | |
43 | 43 | # Position |
44 | 44 | # volume | pos = 0 |
45 | 45 | # sagital | pos = 1 |
46 | 46 | # coronal | pos = 2 |
47 | 47 | # axial | pos = 3 |
48 | 48 | # Automatico: assim que painel eh inserido ele ocupa local mais acima na janela (menor numero de posicao) |
49 | - | |
49 | + | |
50 | 50 | # Layer |
51 | 51 | # Layer 0 | Layer 1 | Layer 2 | ... |
52 | 52 | # Automatico: todos sao colocados no mesmo layer |
53 | - | |
53 | + | |
54 | 54 | # O que eh o Dockable? |
55 | - | |
55 | + | |
56 | 56 | # Row |
57 | 57 | # Row 0 | Row 1 |
58 | 58 | # Idem ao layer |
59 | - | |
59 | + | |
60 | 60 | # Como funciona Direction? |
61 | - | |
61 | + | |
62 | 62 | # Primeira alternativa: |
63 | 63 | # modo: 2 no Layer 0, 2 no Layer 1 por exemplo - posicao automatica (ao inves de Layer pode ser utilizado Row) |
64 | 64 | # problema: sash control soh aparece no sentido ertical |
... | ... | @@ -68,22 +68,22 @@ class Panel(wx.Panel): |
68 | 68 | s1 = wx.aui.AuiPaneInfo().Centre().Row(0).\ |
69 | 69 | Name("Axial Slice").Caption("Axial slice").\ |
70 | 70 | MaximizeButton(True).CloseButton(False) |
71 | - | |
71 | + | |
72 | 72 | p2 = slice_viewer.Viewer(self, "CORONAL") |
73 | 73 | s2 = wx.aui.AuiPaneInfo().Centre().Row(0).\ |
74 | 74 | Name("Coronal Slice").Caption("Coronal slice").\ |
75 | 75 | MaximizeButton(True).CloseButton(False) |
76 | - | |
76 | + | |
77 | 77 | p3 = slice_viewer.Viewer(self, "SAGITAL") |
78 | 78 | s3 = wx.aui.AuiPaneInfo().Centre().Row(1).\ |
79 | 79 | Name("Sagital Slice").Caption("Sagital slice").\ |
80 | 80 | MaximizeButton(True).CloseButton(False) |
81 | - | |
81 | + | |
82 | 82 | p4 = VolumeViewerCover(self) |
83 | 83 | s4 = wx.aui.AuiPaneInfo().Row(1).Name("Volume").\ |
84 | 84 | Bottom().Centre().Caption("Volume").\ |
85 | 85 | MaximizeButton(True).CloseButton(False) |
86 | - | |
86 | + | |
87 | 87 | if sys.platform == 'win32': |
88 | 88 | self.aui_manager.AddPane(p1, s1) |
89 | 89 | self.aui_manager.AddPane(p2, s2) |
... | ... | @@ -94,9 +94,9 @@ class Panel(wx.Panel): |
94 | 94 | self.aui_manager.AddPane(p3, s3) |
95 | 95 | self.aui_manager.AddPane(p2, s2) |
96 | 96 | self.aui_manager.AddPane(p1, s1) |
97 | - | |
97 | + | |
98 | 98 | self.aui_manager.Update() |
99 | - | |
99 | + | |
100 | 100 | |
101 | 101 | def __init_four_way_splitter(self): |
102 | 102 | |
... | ... | @@ -108,49 +108,49 @@ class Panel(wx.Panel): |
108 | 108 | |
109 | 109 | p1 = slice_viewer.Viewer(self, "AXIAL") |
110 | 110 | splitter.AppendWindow(p1) |
111 | - | |
111 | + | |
112 | 112 | p2 = slice_viewer.Viewer(self, "CORONAL") |
113 | 113 | splitter.AppendWindow(p2) |
114 | - | |
114 | + | |
115 | 115 | p3 = slice_viewer.Viewer(self, "SAGITAL") |
116 | 116 | splitter.AppendWindow(p3) |
117 | - | |
117 | + | |
118 | 118 | p4 = volume_viewer.Viewer(self) |
119 | 119 | splitter.AppendWindow(p4) |
120 | 120 | |
121 | - | |
121 | + | |
122 | 122 | def __init_mix(self): |
123 | 123 | aui_manager = wx.aui.AuiManager() |
124 | 124 | aui_manager.SetManagedWindow(self) |
125 | 125 | |
126 | 126 | |
127 | 127 | splitter = fws.FourWaySplitter(self, style=wx.SP_LIVE_UPDATE) |
128 | - | |
128 | + | |
129 | 129 | sizer = wx.BoxSizer(wx.HORIZONTAL) |
130 | 130 | sizer.Add(splitter, 1, wx.EXPAND) |
131 | 131 | self.SetSizer(sizer) |
132 | 132 | |
133 | 133 | |
134 | 134 | p1 = slice_viewer.Viewer(self, "AXIAL") |
135 | - aui_manager.AddPane(p1, | |
135 | + aui_manager.AddPane(p1, | |
136 | 136 | wx.aui.AuiPaneInfo(). |
137 | 137 | Name("Axial Slice").Caption("Axial slice"). |
138 | 138 | MaximizeButton(True).CloseButton(False)) |
139 | - | |
139 | + | |
140 | 140 | p2 = slice_viewer.Viewer(self, "CORONAL") |
141 | - aui_manager.AddPane(p2, | |
141 | + aui_manager.AddPane(p2, | |
142 | 142 | wx.aui.AuiPaneInfo(). |
143 | 143 | Name("Coronal Slice").Caption("Coronal slice"). |
144 | 144 | MaximizeButton(True).CloseButton(False)) |
145 | 145 | |
146 | 146 | p3 = slice_viewer.Viewer(self, "SAGITAL") |
147 | - aui_manager.AddPane(p3, | |
147 | + aui_manager.AddPane(p3, | |
148 | 148 | wx.aui.AuiPaneInfo(). |
149 | 149 | Name("Sagittal Slice").Caption("Sagittal slice"). |
150 | 150 | MaximizeButton(True).CloseButton(False)) |
151 | 151 | |
152 | 152 | #p4 = volume_viewer.Viewer(self) |
153 | - aui_manager.AddPane(VolumeViewerCover, | |
153 | + aui_manager.AddPane(VolumeViewerCover, | |
154 | 154 | wx.aui.AuiPaneInfo(). |
155 | 155 | Name("Volume").Caption("Volume"). |
156 | 156 | MaximizeButton(True).CloseButton(False)) |
... | ... | @@ -162,17 +162,17 @@ class Panel(wx.Panel): |
162 | 162 | |
163 | 163 | |
164 | 164 | aui_manager.Update() |
165 | - | |
165 | + | |
166 | 166 | class VolumeViewerCover(wx.Panel): |
167 | 167 | def __init__(self, parent): |
168 | 168 | wx.Panel.__init__(self, parent) |
169 | - | |
169 | + | |
170 | 170 | sizer = wx.BoxSizer(wx.HORIZONTAL) |
171 | 171 | sizer.Add(volume_viewer.Viewer(self), 1, wx.EXPAND|wx.GROW) |
172 | 172 | sizer.Add(VolumeToolPanel(self), 0, wx.EXPAND) |
173 | 173 | self.SetSizer(sizer) |
174 | 174 | sizer.Fit(self) |
175 | - | |
175 | + | |
176 | 176 | import wx.lib.platebtn as pbtn |
177 | 177 | import wx.lib.buttons as btn |
178 | 178 | import wx.lib.pubsub as ps |
... | ... | @@ -181,65 +181,62 @@ import wx.lib.colourselect as csel |
181 | 181 | class VolumeToolPanel(wx.Panel): |
182 | 182 | def __init__(self, parent): |
183 | 183 | wx.Panel.__init__(self, parent, size = (8,100)) |
184 | - | |
184 | + | |
185 | 185 | BMP_RAYCASTING = wx.Bitmap("../icons/volume_raycasting.png", wx.BITMAP_TYPE_PNG) |
186 | 186 | BMP_RAYCASTING.SetWidth(22) |
187 | 187 | BMP_RAYCASTING.SetHeight(22) |
188 | 188 | |
189 | - BMP_POSITION = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) | |
190 | - BMP_POSITION.SetWidth(22) | |
191 | - BMP_POSITION.SetHeight(22) | |
189 | + FRONT_BMP = wx.Bitmap("../icons/view_front.png", wx.BITMAP_TYPE_PNG) | |
192 | 190 | |
193 | 191 | button_raycasting=btn.GenBitmapToggleButton(self, 1, BMP_RAYCASTING, size=(24,24)) |
194 | 192 | button_raycasting.Bind(wx.EVT_BUTTON, self.OnToggleRaycasting) |
195 | 193 | self.button_raycasting = button_raycasting |
196 | - | |
194 | + | |
197 | 195 | menu = wx.Menu() |
198 | - | |
199 | - FRONT_BMP = wx.Bitmap("../icons/brush_circle.jpg", wx.BITMAP_TYPE_JPEG) | |
196 | + | |
200 | 197 | item = wx.MenuItem(menu, 0, "Front") |
201 | 198 | item.SetBitmap(FRONT_BMP) |
202 | 199 | |
203 | - BACK_BMP = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) | |
200 | + BACK_BMP = wx.Bitmap("../icons/view_back.png", wx.BITMAP_TYPE_PNG) | |
204 | 201 | item2 = wx.MenuItem(menu, 1, "Back") |
205 | 202 | item2.SetBitmap(BACK_BMP) |
206 | - | |
207 | - TOP_BMP = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) | |
203 | + | |
204 | + TOP_BMP = wx.Bitmap("../icons/view_top.png", wx.BITMAP_TYPE_PNG) | |
208 | 205 | item3 = wx.MenuItem(menu, 2, "Top") |
209 | 206 | item3.SetBitmap(TOP_BMP) |
210 | 207 | |
211 | - BOTTOM_BMP = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) | |
208 | + BOTTOM_BMP = wx.Bitmap("../icons/view_bottom.png", wx.BITMAP_TYPE_PNG) | |
212 | 209 | item4 = wx.MenuItem(menu, 3, "Bottom") |
213 | 210 | item4.SetBitmap(BOTTOM_BMP) |
214 | 211 | |
215 | - RIGHT_BMP = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) | |
212 | + RIGHT_BMP = wx.Bitmap("../icons/view_right.png", wx.BITMAP_TYPE_PNG) | |
216 | 213 | item5 = wx.MenuItem(menu, 4, "Right") |
217 | 214 | item5.SetBitmap(RIGHT_BMP) |
218 | 215 | |
219 | - LEFT_BMP = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) | |
216 | + LEFT_BMP = wx.Bitmap("../icons/view_left.png", wx.BITMAP_TYPE_PNG) | |
220 | 217 | item6 = wx.MenuItem(menu, 5, "Left") |
221 | 218 | item6.SetBitmap(LEFT_BMP) |
222 | - | |
223 | - ISOMETRIC_BMP = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) | |
219 | + | |
220 | + ISOMETRIC_BMP = wx.Bitmap("../icons/view_isometric.png", wx.BITMAP_TYPE_PNG) | |
224 | 221 | item7 = wx.MenuItem(menu, 6, "Isometric") |
225 | 222 | item7.SetBitmap(LEFT_BMP) |
226 | - | |
223 | + | |
227 | 224 | self.Bind(wx.EVT_MENU, self.OnMenu) |
228 | - | |
225 | + | |
229 | 226 | menu.AppendItem(item) |
230 | - menu.AppendItem(item2) | |
227 | + menu.AppendItem(item2) | |
231 | 228 | menu.AppendItem(item3) |
232 | 229 | menu.AppendItem(item4) |
233 | 230 | menu.AppendItem(item5) |
234 | 231 | menu.AppendItem(item6) |
235 | 232 | menu.AppendItem(item7) |
236 | - | |
237 | - button_position = pbtn.PlateButton(self, wx.ID_ANY,"", BMP_POSITION, | |
233 | + | |
234 | + button_position = pbtn.PlateButton(self, wx.ID_ANY,"", FRONT_BMP, | |
238 | 235 | style=pbtn.PB_STYLE_SQUARE, size=(24,24)) |
239 | - | |
236 | + | |
240 | 237 | button_position.SetMenu(menu) |
241 | 238 | self.button_position = button_position |
242 | - | |
239 | + | |
243 | 240 | button_colour= csel.ColourSelect(self, 111,colour=(0,0,0),size=(24,24)) |
244 | 241 | button_colour.Bind(csel.EVT_COLOURSELECT, self.OnSelectColour) |
245 | 242 | self.button_colour = button_colour |
... | ... | @@ -250,7 +247,7 @@ class VolumeToolPanel(wx.Panel): |
250 | 247 | sizer.Add(button_position, 0, wx.ALL, 1) |
251 | 248 | self.SetSizer(sizer) |
252 | 249 | sizer.Fit(self) |
253 | - | |
250 | + | |
254 | 251 | def OnMenu(self, evt): |
255 | 252 | values = {0:"FRONT", 1:"BACK", 2:"TOP",\ |
256 | 253 | 3:"BOTTOM", 4:"RIGHT", 5:"LEFT",\ | ... | ... |