Mercurial > hg > orthanc-stl
comparison Sources/OrthancExplorer.js @ 39:b6910092bcca
added button to open O3DV
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 05 Apr 2024 08:25:17 +0200 |
parents | 13698d34e059 |
children | 967f947014ac |
comparison
equal
deleted
inserted
replaced
38:970994058acd | 39:b6910092bcca |
---|---|
23 | 23 |
24 | 24 |
25 const STL_PLUGIN_SOP_CLASS_UID_STL = '1.2.840.10008.5.1.4.1.1.104.3'; | 25 const STL_PLUGIN_SOP_CLASS_UID_STL = '1.2.840.10008.5.1.4.1.1.104.3'; |
26 const STL_PLUGIN_SOP_CLASS_UID_RT_STRUCT = '1.2.840.10008.5.1.4.1.1.481.3'; | 26 const STL_PLUGIN_SOP_CLASS_UID_RT_STRUCT = '1.2.840.10008.5.1.4.1.1.481.3'; |
27 | 27 |
28 | |
29 function AddStlViewer(target, name, callback) { | |
30 var li = $('<li>', { | |
31 name: name, | |
32 }).click(callback); | |
33 | |
34 li.append($('<a>', { | |
35 href: '#', | |
36 rel: 'close', | |
37 text: name | |
38 })); | |
39 | |
40 target.append(li); | |
41 } | |
42 | |
43 | |
28 function AddOpenStlViewerButton(instanceId, id, parent) { | 44 function AddOpenStlViewerButton(instanceId, id, parent) { |
29 var b = $('<a>') | 45 var b = $('<a>') |
30 .attr('id', id) | 46 .attr('id', id) |
31 .attr('data-role', 'button') | 47 .attr('data-role', 'button') |
32 .attr('href', '#') | 48 .attr('href', '#') |
34 .attr('data-theme', 'e') | 50 .attr('data-theme', 'e') |
35 .text('STL viewer') | 51 .text('STL viewer') |
36 .button(); | 52 .button(); |
37 | 53 |
38 b.insertAfter($('#' + parent)); | 54 b.insertAfter($('#' + parent)); |
55 | |
39 b.click(function() { | 56 b.click(function() { |
40 if ($.mobile.pageData) { | 57 var viewers = $('<ul>') |
58 .attr('data-divider-theme', 'd') | |
59 .attr('data-role', 'listview'); | |
60 | |
61 AddStlViewer(viewers, 'Basic viewer built using Three.js', function() { | |
41 window.open('../stl/app/three.html?instance=' + instanceId); | 62 window.open('../stl/app/three.html?instance=' + instanceId); |
42 } | 63 }); |
64 | |
65 AddStlViewer(viewers, 'Online3DViewer', function() { | |
66 window.open('../stl/app/o3dv.html?instance=' + instanceId); | |
67 }); | |
68 | |
69 // Launch the dialog | |
70 $('#dialog').simpledialog2({ | |
71 mode: 'blank', | |
72 animate: false, | |
73 headerText: 'Choose STL viewer', | |
74 headerClose: true, | |
75 forceInput: false, | |
76 width: '100%', | |
77 blankContent: viewers | |
78 }); | |
43 }); | 79 }); |
44 } | 80 } |
45 | 81 |
46 | 82 |
47 function AddGenerateFromRtStructButton(instanceId, id, parent) { | 83 function AddGenerateFromRtStructButton(instanceId, id, parent) { |