Mercurial > hg > orthanc-stone
annotate Applications/Samples/SingleFrameEditorApplication.h @ 535:79bb0a02d1cc bgo-commands-codegen
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
- Last fixes to new style command handling (removed useless commands and switch command handling in simple samples to use XxxxSerializedMessageXxxx instead of XxxxCommandXxxx
- Fixed hardcoded input instance in SingleFrameEditorApplication
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 19 Mar 2019 09:13:57 +0100 |
parents | 40bb5eb247a5 |
children | 4f2416d519b4 |
rev | line source |
---|---|
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
1 /** |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
2 * Stone of Orthanc |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
439 | 5 * Copyright (C) 2017-2019 Osimis S.A., Belgium |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
6 * |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
11 * |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
15 * Affero General Public License for more details. |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
16 * |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
19 **/ |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
20 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
21 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
22 #pragma once |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
23 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
24 #include "SampleApplicationBase.h" |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
25 |
415
c0589c3173fd
finished reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
414
diff
changeset
|
26 #include "../../Framework/Radiography/RadiographyLayerCropTracker.h" |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
27 #include "../../Framework/Radiography/RadiographyLayerMaskTracker.h" |
414 | 28 #include "../../Framework/Radiography/RadiographyLayerMoveTracker.h" |
415
c0589c3173fd
finished reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
414
diff
changeset
|
29 #include "../../Framework/Radiography/RadiographyLayerResizeTracker.h" |
414 | 30 #include "../../Framework/Radiography/RadiographyLayerRotateTracker.h" |
408 | 31 #include "../../Framework/Radiography/RadiographyScene.h" |
414 | 32 #include "../../Framework/Radiography/RadiographySceneCommand.h" |
413 | 33 #include "../../Framework/Radiography/RadiographyWidget.h" |
415
c0589c3173fd
finished reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
414
diff
changeset
|
34 #include "../../Framework/Radiography/RadiographyWindowingTracker.h" |
430 | 35 #include "../../Framework/Radiography/RadiographySceneWriter.h" |
36 #include "../../Framework/Radiography/RadiographySceneReader.h" | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
37 #include "../../Framework/Radiography/RadiographyMaskLayer.h" |
359
100df90bf0ea
preparing to implement Export
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
358
diff
changeset
|
38 |
418 | 39 #include <Core/HttpClient.h> |
343 | 40 #include <Core/Images/FontRegistry.h> |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
41 #include <Core/Logging.h> |
403 | 42 #include <Core/OrthancException.h> |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
43 |
407 | 44 |
45 // Export using PAM is faster than using PNG, but requires Orthanc | |
46 // core >= 1.4.3 | |
362
12cec26d08ce
export of a valid DICOM CR
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
361
diff
changeset
|
47 #define EXPORT_USING_PAM 1 |
12cec26d08ce
export of a valid DICOM CR
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
361
diff
changeset
|
48 |
340
f5d5814a41a0
rendering BitmapStack
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
339
diff
changeset
|
49 |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
50 namespace OrthancStone |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
51 { |
407 | 52 namespace Samples |
358 | 53 { |
408 | 54 class RadiographyEditorInteractor : |
430 | 55 public IWorldSceneInteractor, |
56 public IObserver | |
358 | 57 { |
407 | 58 private: |
59 enum Tool | |
60 { | |
61 Tool_Move, | |
62 Tool_Rotate, | |
63 Tool_Crop, | |
64 Tool_Resize, | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
65 Tool_Mask, |
407 | 66 Tool_Windowing |
67 }; | |
430 | 68 |
358 | 69 |
417
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
70 StoneApplicationContext* context_; |
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
71 UndoRedoStack undoRedoStack_; |
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
72 Tool tool_; |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
73 RadiographyMaskLayer* maskLayer_; |
407 | 74 |
75 | |
76 static double GetHandleSize() | |
77 { | |
78 return 10.0; | |
79 } | |
430 | 80 |
81 | |
407 | 82 public: |
408 | 83 RadiographyEditorInteractor(MessageBroker& broker) : |
407 | 84 IObserver(broker), |
417
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
85 context_(NULL), |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
86 tool_(Tool_Move), |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
87 maskLayer_(NULL) |
407 | 88 { |
89 } | |
417
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
90 |
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
91 void SetContext(StoneApplicationContext& context) |
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
92 { |
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
93 context_ = &context; |
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
94 } |
430 | 95 |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
96 void SetMaskLayer(RadiographyMaskLayer* maskLayer) |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
97 { |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
98 maskLayer_ = maskLayer; |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
99 } |
407 | 100 virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& worldWidget, |
101 const ViewportGeometry& view, | |
102 MouseButton button, | |
103 KeyboardModifiers modifiers, | |
104 int viewportX, | |
105 int viewportY, | |
106 double x, | |
107 double y, | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
108 IStatusBar* statusBar, |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
109 const std::vector<Touch>& displayTouches) |
357
ec4ad6c5eb99
avoid breaking class hierarchy
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
356
diff
changeset
|
110 { |
408 | 111 RadiographyWidget& widget = dynamic_cast<RadiographyWidget&>(worldWidget); |
407 | 112 |
113 if (button == MouseButton_Left) | |
358 | 114 { |
407 | 115 size_t selected; |
430 | 116 |
407 | 117 if (tool_ == Tool_Windowing) |
358 | 118 { |
408 | 119 return new RadiographyWindowingTracker( |
430 | 120 undoRedoStack_, widget.GetScene(), |
121 viewportX, viewportY, | |
122 RadiographyWindowingTracker::Action_DecreaseWidth, | |
123 RadiographyWindowingTracker::Action_IncreaseWidth, | |
124 RadiographyWindowingTracker::Action_DecreaseCenter, | |
125 RadiographyWindowingTracker::Action_IncreaseCenter); | |
358 | 126 } |
407 | 127 else if (!widget.LookupSelectedLayer(selected)) |
358 | 128 { |
407 | 129 // No layer is currently selected |
130 size_t layer; | |
131 if (widget.GetScene().LookupLayer(layer, x, y)) | |
358 | 132 { |
407 | 133 widget.Select(layer); |
358 | 134 } |
407 | 135 |
136 return NULL; | |
358 | 137 } |
407 | 138 else if (tool_ == Tool_Crop || |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
139 tool_ == Tool_Resize || |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
140 tool_ == Tool_Mask) |
358 | 141 { |
408 | 142 RadiographyScene::LayerAccessor accessor(widget.GetScene(), selected); |
410
6decc0ba9da5
rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
408
diff
changeset
|
143 |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
144 ControlPoint controlPoint; |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
145 if (accessor.GetLayer().LookupControlPoint(controlPoint, x, y, view.GetZoom(), GetHandleSize())) |
358 | 146 { |
407 | 147 switch (tool_) |
148 { | |
430 | 149 case Tool_Crop: |
150 return new RadiographyLayerCropTracker | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
151 (undoRedoStack_, widget.GetScene(), view, selected, controlPoint); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
152 |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
153 case Tool_Mask: |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
154 return new RadiographyLayerMaskTracker |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
155 (undoRedoStack_, widget.GetScene(), view, selected, controlPoint); |
407 | 156 |
430 | 157 case Tool_Resize: |
158 return new RadiographyLayerResizeTracker | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
159 (undoRedoStack_, widget.GetScene(), selected, controlPoint, |
408 | 160 (modifiers & KeyboardModifiers_Shift)); |
407 | 161 |
430 | 162 default: |
163 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | |
407 | 164 } |
384
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
165 } |
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
166 else |
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
167 { |
407 | 168 size_t layer; |
430 | 169 |
407 | 170 if (widget.GetScene().LookupLayer(layer, x, y)) |
384
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
171 { |
407 | 172 widget.Select(layer); |
384
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
173 } |
407 | 174 else |
175 { | |
176 widget.Unselect(); | |
177 } | |
430 | 178 |
384
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
179 return NULL; |
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
180 } |
358 | 181 } |
182 else | |
183 { | |
407 | 184 size_t layer; |
185 | |
186 if (widget.GetScene().LookupLayer(layer, x, y)) | |
187 { | |
188 if (layer == selected) | |
189 { | |
190 switch (tool_) | |
191 { | |
430 | 192 case Tool_Move: |
193 return new RadiographyLayerMoveTracker | |
408 | 194 (undoRedoStack_, widget.GetScene(), layer, x, y, |
195 (modifiers & KeyboardModifiers_Shift)); | |
407 | 196 |
430 | 197 case Tool_Rotate: |
198 return new RadiographyLayerRotateTracker | |
408 | 199 (undoRedoStack_, widget.GetScene(), view, layer, x, y, |
200 (modifiers & KeyboardModifiers_Shift)); | |
430 | 201 |
202 default: | |
203 break; | |
407 | 204 } |
205 | |
206 return NULL; | |
207 } | |
208 else | |
209 { | |
210 widget.Select(layer); | |
211 return NULL; | |
212 } | |
213 } | |
214 else | |
215 { | |
216 widget.Unselect(); | |
217 return NULL; | |
218 } | |
219 } | |
220 } | |
221 else | |
222 { | |
223 return NULL; | |
224 } | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
225 return NULL; |
407 | 226 } |
227 | |
228 virtual void MouseOver(CairoContext& context, | |
229 WorldSceneWidget& worldWidget, | |
230 const ViewportGeometry& view, | |
231 double x, | |
232 double y, | |
233 IStatusBar* statusBar) | |
234 { | |
408 | 235 RadiographyWidget& widget = dynamic_cast<RadiographyWidget&>(worldWidget); |
407 | 236 |
237 #if 0 | |
238 if (statusBar != NULL) | |
239 { | |
240 char buf[64]; | |
241 sprintf(buf, "X = %.02f Y = %.02f (in cm)", x / 10.0, y / 10.0); | |
242 statusBar->SetMessage(buf); | |
243 } | |
244 #endif | |
245 | |
246 size_t selected; | |
247 | |
248 if (widget.LookupSelectedLayer(selected) && | |
249 (tool_ == Tool_Crop || | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
250 tool_ == Tool_Resize || |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
251 tool_ == Tool_Mask)) |
407 | 252 { |
408 | 253 RadiographyScene::LayerAccessor accessor(widget.GetScene(), selected); |
430 | 254 |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
255 ControlPoint controlPoint; |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
256 if (accessor.GetLayer().LookupControlPoint(controlPoint, x, y, view.GetZoom(), GetHandleSize())) |
407 | 257 { |
258 double z = 1.0 / view.GetZoom(); | |
430 | 259 |
407 | 260 context.SetSourceColor(255, 0, 0); |
261 cairo_t* cr = context.GetObject(); | |
262 cairo_set_line_width(cr, 2.0 * z); | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
263 cairo_move_to(cr, controlPoint.x - GetHandleSize() * z, controlPoint.y - GetHandleSize() * z); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
264 cairo_line_to(cr, controlPoint.x + GetHandleSize() * z, controlPoint.y - GetHandleSize() * z); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
265 cairo_line_to(cr, controlPoint.x + GetHandleSize() * z, controlPoint.y + GetHandleSize() * z); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
266 cairo_line_to(cr, controlPoint.x - GetHandleSize() * z, controlPoint.y + GetHandleSize() * z); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
267 cairo_line_to(cr, controlPoint.x - GetHandleSize() * z, controlPoint.y - GetHandleSize() * z); |
407 | 268 cairo_stroke(cr); |
358 | 269 } |
270 } | |
339 | 271 } |
407 | 272 |
273 virtual void MouseWheel(WorldSceneWidget& widget, | |
274 MouseWheelDirection direction, | |
275 KeyboardModifiers modifiers, | |
276 IStatusBar* statusBar) | |
344
fdec8e6893cb
ordering of bitmap layers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
343
diff
changeset
|
277 { |
358 | 278 } |
407 | 279 |
280 virtual void KeyPressed(WorldSceneWidget& worldWidget, | |
281 KeyboardKeys key, | |
282 char keyChar, | |
283 KeyboardModifiers modifiers, | |
284 IStatusBar* statusBar) | |
345 | 285 { |
408 | 286 RadiographyWidget& widget = dynamic_cast<RadiographyWidget&>(worldWidget); |
407 | 287 |
288 switch (keyChar) | |
358 | 289 { |
430 | 290 case 'a': |
291 widget.FitContent(); | |
292 break; | |
293 | |
294 case 'c': | |
295 tool_ = Tool_Crop; | |
296 break; | |
407 | 297 |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
298 case 'm': |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
299 tool_ = Tool_Mask; |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
300 widget.Select(1); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
301 break; |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
302 |
430 | 303 case 'd': |
304 { | |
305 // dump to json and reload | |
306 Json::Value snapshot; | |
307 RadiographySceneWriter writer; | |
308 writer.Write(snapshot, widget.GetScene()); | |
407 | 309 |
430 | 310 LOG(INFO) << "JSON export was successful: " |
311 << snapshot.toStyledString(); | |
312 | |
313 boost::shared_ptr<RadiographyScene> scene(new RadiographyScene(GetBroker())); | |
314 RadiographySceneReader reader(*scene, context_->GetOrthancApiClient()); | |
315 | |
316 Orthanc::FontRegistry fontRegistry; | |
317 fontRegistry.AddFromResource(Orthanc::EmbeddedResources::FONT_UBUNTU_MONO_BOLD_16); | |
318 | |
319 reader.SetFontRegistry(fontRegistry); | |
320 reader.Read(snapshot); | |
407 | 321 |
430 | 322 widget.SetScene(scene); |
323 };break; | |
324 | |
325 case 'e': | |
326 { | |
327 Orthanc::DicomMap tags; | |
407 | 328 |
430 | 329 // Minimal set of tags to generate a valid CR image |
330 tags.SetValue(Orthanc::DICOM_TAG_ACCESSION_NUMBER, "NOPE", false); | |
331 tags.SetValue(Orthanc::DICOM_TAG_BODY_PART_EXAMINED, "PELVIS", false); | |
332 tags.SetValue(Orthanc::DICOM_TAG_INSTANCE_NUMBER, "1", false); | |
333 //tags.SetValue(Orthanc::DICOM_TAG_LATERALITY, "", false); | |
334 tags.SetValue(Orthanc::DICOM_TAG_MANUFACTURER, "OSIMIS", false); | |
335 tags.SetValue(Orthanc::DICOM_TAG_MODALITY, "CR", false); | |
336 tags.SetValue(Orthanc::DICOM_TAG_PATIENT_BIRTH_DATE, "20000101", false); | |
337 tags.SetValue(Orthanc::DICOM_TAG_PATIENT_ID, "hello", false); | |
338 tags.SetValue(Orthanc::DICOM_TAG_PATIENT_NAME, "HELLO^WORLD", false); | |
339 tags.SetValue(Orthanc::DICOM_TAG_PATIENT_ORIENTATION, "", false); | |
340 tags.SetValue(Orthanc::DICOM_TAG_PATIENT_SEX, "M", false); | |
341 tags.SetValue(Orthanc::DICOM_TAG_REFERRING_PHYSICIAN_NAME, "HOUSE^MD", false); | |
342 tags.SetValue(Orthanc::DICOM_TAG_SERIES_NUMBER, "1", false); | |
343 tags.SetValue(Orthanc::DICOM_TAG_SOP_CLASS_UID, "1.2.840.10008.5.1.4.1.1.1", false); | |
344 tags.SetValue(Orthanc::DICOM_TAG_STUDY_ID, "STUDY", false); | |
345 tags.SetValue(Orthanc::DICOM_TAG_VIEW_POSITION, "", false); | |
346 | |
347 if (context_ != NULL) | |
348 { | |
349 widget.GetScene().ExportDicom(context_->GetOrthancApiClient(), | |
350 tags, std::string(), 0.1, 0.1, widget.IsInverted(), | |
351 widget.GetInterpolation(), EXPORT_USING_PAM); | |
407 | 352 } |
353 | |
430 | 354 break; |
355 } | |
356 | |
357 case 'i': | |
358 widget.SwitchInvert(); | |
359 break; | |
360 | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
361 case 't': |
430 | 362 tool_ = Tool_Move; |
363 break; | |
364 | |
365 case 'n': | |
366 { | |
367 switch (widget.GetInterpolation()) | |
368 { | |
369 case ImageInterpolation_Nearest: | |
370 LOG(INFO) << "Switching to bilinear interpolation"; | |
371 widget.SetInterpolation(ImageInterpolation_Bilinear); | |
407 | 372 break; |
373 | |
430 | 374 case ImageInterpolation_Bilinear: |
375 LOG(INFO) << "Switching to nearest neighbor interpolation"; | |
376 widget.SetInterpolation(ImageInterpolation_Nearest); | |
407 | 377 break; |
378 | |
430 | 379 default: |
380 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | |
381 } | |
382 | |
383 break; | |
384 } | |
407 | 385 |
430 | 386 case 'r': |
387 tool_ = Tool_Rotate; | |
388 break; | |
389 | |
390 case 's': | |
391 tool_ = Tool_Resize; | |
392 break; | |
393 | |
394 case 'w': | |
395 tool_ = Tool_Windowing; | |
396 break; | |
407 | 397 |
430 | 398 case 'y': |
399 if (modifiers & KeyboardModifiers_Control) | |
400 { | |
401 undoRedoStack_.Redo(); | |
402 widget.NotifyContentChanged(); | |
403 } | |
404 break; | |
407 | 405 |
430 | 406 case 'z': |
407 if (modifiers & KeyboardModifiers_Control) | |
408 { | |
409 undoRedoStack_.Undo(); | |
410 widget.NotifyContentChanged(); | |
411 } | |
412 break; | |
413 | |
414 default: | |
415 break; | |
358 | 416 } |
345 | 417 } |
407 | 418 }; |
336
c7fdc8bac581
creating GrayscaleBitmapStack
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
334
diff
changeset
|
419 |
430 | 420 |
421 | |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
422 class SingleFrameEditorApplication : |
430 | 423 public SampleSingleCanvasApplicationBase, |
424 public IObserver | |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
425 { |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
426 private: |
430 | 427 boost::shared_ptr<RadiographyScene> scene_; |
428 RadiographyEditorInteractor interactor_; | |
429 Orthanc::FontRegistry fontRegistry_; | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
430 RadiographyMaskLayer* maskLayer_; |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
431 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
432 public: |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
433 SingleFrameEditorApplication(MessageBroker& broker) : |
362
12cec26d08ce
export of a valid DICOM CR
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
361
diff
changeset
|
434 IObserver(broker), |
12cec26d08ce
export of a valid DICOM CR
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
361
diff
changeset
|
435 interactor_(broker) |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
436 { |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
437 } |
384
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
438 |
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
439 virtual ~SingleFrameEditorApplication() |
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
440 { |
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
441 LOG(WARNING) << "Destroying the application"; |
d20d75f20c5d
better following of the MVC design pattern
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
377
diff
changeset
|
442 } |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
443 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
444 virtual void DeclareStartupOptions(boost::program_options::options_description& options) |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
445 { |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
446 boost::program_options::options_description generic("Sample options"); |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
447 generic.add_options() |
430 | 448 ("instance", boost::program_options::value<std::string>(), |
449 "Orthanc ID of the instance") | |
450 ("frame", boost::program_options::value<unsigned int>()->default_value(0), | |
451 "Number of the frame, for multi-frame DICOM instances") | |
452 ; | |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
453 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
454 options.add(generic); |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
455 } |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
456 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
457 virtual void Initialize(StoneApplicationContext* context, |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
458 IStatusBar& statusBar, |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
459 const boost::program_options::variables_map& parameters) |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
460 { |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
461 using namespace OrthancStone; |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
462 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
463 context_ = context; |
417
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
464 interactor_.SetContext(*context); |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
465 |
358 | 466 statusBar.SetMessage("Use the key \"a\" to reinitialize the layout"); |
467 statusBar.SetMessage("Use the key \"c\" to crop"); | |
359
100df90bf0ea
preparing to implement Export
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
358
diff
changeset
|
468 statusBar.SetMessage("Use the key \"e\" to export DICOM to the Orthanc server"); |
358 | 469 statusBar.SetMessage("Use the key \"f\" to switch full screen"); |
470 statusBar.SetMessage("Use the key \"i\" to invert contrast"); | |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
471 statusBar.SetMessage("Use the key \"m\" to modify the mask"); |
359
100df90bf0ea
preparing to implement Export
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
358
diff
changeset
|
472 statusBar.SetMessage("Use the key \"n\" to switch between nearest neighbor and bilinear interpolation"); |
358 | 473 statusBar.SetMessage("Use the key \"r\" to rotate objects"); |
407 | 474 statusBar.SetMessage("Use the key \"s\" to resize objects (not applicable to DICOM layers)"); |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
475 statusBar.SetMessage("Use the key \"t\" to move (translate) objects"); |
358 | 476 statusBar.SetMessage("Use the key \"w\" to change windowing"); |
477 | |
478 statusBar.SetMessage("Use the key \"ctrl-z\" to undo action"); | |
479 statusBar.SetMessage("Use the key \"ctrl-y\" to redo action"); | |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
480 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
481 if (parameters.count("instance") != 1) |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
482 { |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
483 LOG(ERROR) << "The instance ID is missing"; |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
484 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
485 } |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
486 |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
487 std::string instance = parameters["instance"].as<std::string>(); |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
488 int frame = parameters["frame"].as<unsigned int>(); |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
489 |
430 | 490 fontRegistry_.AddFromResource(Orthanc::EmbeddedResources::FONT_UBUNTU_MONO_BOLD_16); |
343 | 491 |
417
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
492 scene_.reset(new RadiographyScene(GetBroker())); |
535
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
518
diff
changeset
|
493 |
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
518
diff
changeset
|
494 RadiographyLayer& dicomLayer = scene_->LoadDicomFrame(context->GetOrthancApiClient(), instance, 0, false, NULL); |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
495 //scene_->LoadDicomFrame(instance, frame, false); //.SetPan(200, 0); |
535
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
518
diff
changeset
|
496 // = scene_->LoadDicomFrame(context->GetOrthancApiClient(), "61f3143e-96f34791-ad6bbb8d-62559e75-45943e1b", 0, false, NULL); |
418 | 497 |
498 #if !defined(ORTHANC_ENABLE_WASM) || ORTHANC_ENABLE_WASM != 1 | |
499 Orthanc::HttpClient::ConfigureSsl(true, "/etc/ssl/certs/ca-certificates.crt"); | |
500 #endif | |
501 | |
417
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
502 //scene_->LoadDicomWebFrame(context->GetWebService()); |
aee3d7941c9b
preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
415
diff
changeset
|
503 |
518
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
504 std::vector<Orthanc::ImageProcessing::ImagePoint> mask; |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
505 mask.push_back(Orthanc::ImageProcessing::ImagePoint(1100, 100)); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
506 mask.push_back(Orthanc::ImageProcessing::ImagePoint(1100, 1000)); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
507 mask.push_back(Orthanc::ImageProcessing::ImagePoint(2000, 1000)); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
508 mask.push_back(Orthanc::ImageProcessing::ImagePoint(2200, 150)); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
509 mask.push_back(Orthanc::ImageProcessing::ImagePoint(1500, 550)); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
510 maskLayer_ = dynamic_cast<RadiographyMaskLayer*>(&(scene_->LoadMask(mask, dynamic_cast<RadiographyDicomLayer&>(dicomLayer), 128.0f, NULL))); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
511 interactor_.SetMaskLayer(maskLayer_); |
40bb5eb247a5
Reverted a couple of files to AM version (wrong changes on my end)
Benjamin Golinvaux <bgo@osimis.io>
parents:
516
diff
changeset
|
512 |
354 | 513 { |
430 | 514 RadiographyLayer& layer = scene_->LoadText(fontRegistry_.GetFont(0), "Hello\nworld", NULL); |
410
6decc0ba9da5
rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
408
diff
changeset
|
515 layer.SetResizeable(true); |
354 | 516 } |
517 | |
518 { | |
430 | 519 RadiographyLayer& layer = scene_->LoadTestBlock(100, 50, NULL); |
410
6decc0ba9da5
rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
408
diff
changeset
|
520 layer.SetResizeable(true); |
6decc0ba9da5
rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
408
diff
changeset
|
521 layer.SetPan(0, 200); |
354 | 522 } |
523 | |
337 | 524 |
428
751fb354149e
ability to change the scene of the RadiographyWidget
am@osimis.io
parents:
418
diff
changeset
|
525 mainWidget_ = new RadiographyWidget(GetBroker(), scene_, "main-widget"); |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
526 mainWidget_->SetTransmitMouseOver(true); |
358 | 527 mainWidget_->SetInteractor(interactor_); |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
528 |
407 | 529 //scene_->SetWindowing(128, 256); |
325
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
530 } |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
531 }; |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
532 } |
37ab9d83dc9b
reactivate SingleFrameApplication sample + Added SingleFrameEditorApplication (SDL only)
am@osimis.io
parents:
diff
changeset
|
533 } |