diff Sources/OrthancExplorer.js @ 62:b798387b085c

added 3DHOP viewer version 4.3
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 15 Jun 2024 16:08:52 +0200
parents c322c949bd8e
children 1fd6d0f8fdc9
line wrap: on
line diff
--- a/Sources/OrthancExplorer.js	Wed May 22 15:35:07 2024 +0200
+++ b/Sources/OrthancExplorer.js	Sat Jun 15 16:08:52 2024 +0200
@@ -27,7 +27,7 @@
 const STL_PLUGIN_SOP_CLASS_UID_RAW = '1.2.840.10008.5.1.4.1.1.66';
 
 
-function AddStlViewer(target, name, callback) {
+function AddViewer(target, name, callback) {
   var li = $('<li>', {
     name: name,
   }).click(callback);
@@ -59,11 +59,11 @@
         .attr('data-divider-theme', 'd')
         .attr('data-role', 'listview');
 
-    AddStlViewer(viewers, 'Basic viewer built using Three.js', function() {
+    AddViewer(viewers, 'Basic viewer built using Three.js', function() {
       window.open('../stl/app/three.html?instance=' + instanceId);
     });
 
-    AddStlViewer(viewers, 'Online3DViewer', function() {
+    AddViewer(viewers, 'Online3DViewer', function() {
       window.open('../stl/app/o3dv.html?instance=' + instanceId);
     });
 
@@ -510,7 +510,32 @@
           b.insertAfter($('#' + parent));
 
           b.click(function() {
-            window.open('../stl/nexus/threejs.html?model=../../instances/' + instanceId + '/nexus');
+            if (${IS_3DHOP_ENABLED}) {
+              var viewers = $('<ul>')
+                  .attr('data-divider-theme', 'd')
+                  .attr('data-role', 'listview');
+
+              AddViewer(viewers, 'Basic Nexus viewer', function() {
+                window.open('../stl/nexus/threejs.html?model=../../instances/' + instanceId + '/nexus');
+              });
+
+              AddViewer(viewers, '3DHOP', function() {
+                window.open('../stl/3dhop/3DHOP_all_tools.html?instance=' + instanceId);
+              });
+
+              // Launch the dialog
+              $('#dialog').simpledialog2({
+                mode: 'blank',
+                animate: false,
+                headerText: 'Choose Nexus viewer',
+                headerClose: true,
+                forceInput: false,
+                width: '100%',
+                blankContent: viewers
+              });
+            } else {
+              window.open('../stl/nexus/threejs.html?model=../../instances/' + instanceId + '/nexus');
+            }
           });
         }
       }