comparison OrthancStone/Resources/Graveyard/Deprecated/Samples/README.md @ 1512:244ad1e4e76a

reorganization of folders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 16:21:02 +0200
parents Resources/Graveyard/Deprecated/Samples/README.md@553084468225
children bc4c50a53bd3
comparison
equal deleted inserted replaced
1511:9dfeee74c1e6 1512:244ad1e4e76a
1
2 **These samples are deprecated and not guaranteed to work. A migration to a
3 new version of the Stone API is underway.**
4
5 Please read orthanc-stone/Samples/README.md first for general requirements.
6
7
8
9 Deprecated -- to be sorted
10 ===========================
11
12 The following assumes that the source code to be downloaded in
13 `~/orthanc-stone` and Orthanc source code to be checked out in
14 `~/orthanc`.
15
16 Building the WASM samples
17 -------------------------------------
18
19 ```
20 cd ~/orthanc-stone/Applications/Samples
21 ./build-wasm.sh
22 ```
23
24 Serving the WASM samples
25 ------------------------------------
26 ```
27 # launch an Orthanc listening on 8042 port:
28 Orthanc
29
30 # launch an nginx that will serve the WASM static files and reverse
31 # proxy
32 sudo nginx -p $(pwd) -c nginx.local.conf
33 ```
34
35 You can now open the samples in http://localhost:9977
36
37 Building the SDL native samples (SimpleViewer only)
38 ---------------------------------------------------
39
40 The following also assumes that you have checked out the Orthanc
41 source code in an `orthanc` folder next to the Stone of Orthanc
42 repository, please enter the following:
43
44 **Simple make generator with dynamic build**
45
46 ```
47 # Please set $currentDir to the current folder
48 mkdir -p ~/builds/orthanc-stone-build
49 cd ~/builds/orthanc-stone-build
50 cmake -DORTHANC_FRAMEWORK_SOURCE=path \
51 -DORTHANC_FRAMEWORK_ROOT=$currentDir/../../../orthanc \
52 -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON \
53 ~/orthanc-stone/Applications/Samples/
54 ```
55
56 **Ninja generator with static SDL build (pwsh script)**
57
58 ```
59 # Please yourself one level above the orthanc-stone and orthanc folders
60 if( -not (test-path stone_build_sdl)) { mkdir stone_build_sdl }
61 cd stone_build_sdl
62 cmake -G Ninja -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Applications/Samples/
63 ```
64
65 **Ninja generator with static SDL build (bash/zsh script)**
66
67 ```
68 # Please yourself one level above the orthanc-stone and orthanc folders
69 if( -not (test-path stone_build_sdl)) { mkdir stone_build_sdl }
70 cd stone_build_sdl
71 cmake -G Ninja -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="`pwd`/../orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Applications/Samples/
72 ```
73
74 **Visual Studio 2017 generator with static SDL build (pwsh script)**
75
76 ```
77 # The following will use Visual Studio 2017 to build the SDL samples
78 # in debug mode (with multiple compilers in parallel). NOTE: place
79 # yourself one level above the `orthanc-stone` and `orthanc` folders
80
81 if( -not (test-path stone_build_sdl)) { mkdir stone_build_sdl }
82 cd stone_build_sdl
83 cmake -G "Visual Studio 15 2017 Win64" -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Applications/Samples/
84 cmake --build . --config Debug
85 ```
86
87 If you are working on Windows, add the correct generator option to
88 cmake to, for instance, generate msbuild files for Visual Studio.
89
90 Then, under Linux:
91 ```
92 cmake --build . --target OrthancStoneSimpleViewer -- -j 5
93 ```
94
95 Note: replace `$($pwd)` with the current directory when not using Powershell
96
97 Building the Qt native samples (SimpleViewer only) under Windows:
98 ------------------------------------------------------------------
99
100 **Visual Studio 2017 generator with static Qt build (pwsh script)**
101
102 For instance, if Qt is installed in `C:\Qt\5.12.0\msvc2017_64`
103
104 ```
105 # The following will use Visual Studio 2017 to build the SDL samples
106 # in debug mode (with multiple compilers in parallel). NOTE: place
107 # yourself one level above the `orthanc-stone` and `orthanc` folders
108
109 if( -not (test-path stone_build_qt)) { mkdir stone_build_qt }
110 cd stone_build_qt
111 cmake -G "Visual Studio 15 2017 Win64" -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DCMAKE_PREFIX_PATH=C:\Qt\5.12.0\msvc2017_64 -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_QT=ON ../orthanc-stone/Applications/Samples/
112 cmake --build . --config Debug
113 ```
114
115 Note: replace `$($pwd)` with the current directory when not using Powershell
116
117
118
119
120
121
122 Building the SDL native samples (SimpleViewer only) under Windows:
123 ------------------------------------------------------------------
124 `cmake -DSTATIC_BUILD=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON -G "Visual Studio 15 2017 Win64" ../orthanc-stone/Applications/Samples/`
125
126 Note: replace `$($pwd)` with the current directory when not using Powershell
127
128 Executing the native samples:
129 --------------------------------
130 ```
131 # launch an Orthanc listening on 8042 port:
132 Orthanc
133
134 # launch the sample
135 ./OrthancStoneSimpleViewer --studyId=XX
136 ```
137
138 Build the Application Samples
139 -----------------------------
140
141 **Visual Studio 2008 (v90) **
142
143 ```
144 cmake -G "Visual Studio 9 2008" -DUSE_LEGACY_JSONCPP=ON -DENABLE_OPENGL=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Applications/Samples
145 ```
146
147 **Visual Studio 2019 (v142) **
148
149 ```
150 cmake -G "Visual Studio 16 2019" -A x64 -DMSVC_MULTIPLE_PROCESSES=ON -DENABLE_OPENGL=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Applications/Samples
151 ```
152
153 **Visual Studio 2017 (v140) **
154
155 ```
156 cmake -G "Visual Studio 15 2017 Win64" -DMSVC_MULTIPLE_PROCESSES=ON -DENABLE_OPENGL=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Applications/Samples
157 ```
158
159
160 Build the core Samples
161 ---------------------------
162 How to build the newest (2019-04-29) SDL samples under Windows, *inside* a
163 folder that is sibling to the orthanc-stone folder:
164
165 **Visual Studio 2019 (v142) **
166
167 ```
168 cmake -G "Visual Studio 16 2019" -A x64 -DMSVC_MULTIPLE_PROCESSES=ON -DENABLE_OPENGL=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Samples/Sdl
169 ```
170
171 **Visual Studio 2017 (v140) **
172
173 ```
174 cmake -G "Visual Studio 15 2017 Win64" -DMSVC_MULTIPLE_PROCESSES=ON -DENABLE_OPENGL=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Samples/Sdl
175 ```
176
177 **Visual Studio 2008 (v90) **
178
179 ```
180 cmake -G "Visual Studio 9 2008" -DUSE_LEGACY_JSONCPP=ON -DENABLE_OPENGL=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Samples/Sdl
181 ```
182
183 And under Ubuntu (note the /mnt/c/osi/dev/orthanc folder):
184 ```
185 cmake -G "Ninja" -DENABLE_OPENGL=ON -DSTATIC_BUILD=OFF -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="/mnt/c/osi/dev/orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Samples/Sdl
186 ```
187
188 TODO trackers:
189 - CANCELLED (using outlined text now) text overlay 50% --> ColorTextureLayer 50%
190 - DONE angle tracker: draw arcs
191 - Handles on arc
192 - Select measure tool with hit test --> Delete command
193
194
195