changeset 66:88e98907b140

provide a way to go back to Nexus viewer 4.2
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 15 Jun 2024 17:01:32 +0200
parents 6a891818bad5
children d34f662a3a6c
files .reuse/dep5 CMakeLists.txt Resources/CMake/NexusViewer-4.2.cmake Resources/CMake/NexusViewer-4.2.patch Resources/CMake/NexusViewer-4.3.cmake Resources/CMake/NexusViewer-4.3.patch Resources/CMake/NexusViewer.cmake Resources/CMake/nexus-viewer-4.2.patch Resources/CMake/nexus-viewer-4.3.patch
diffstat 9 files changed, 123 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/.reuse/dep5	Sat Jun 15 16:51:42 2024 +0200
+++ b/.reuse/dep5	Sat Jun 15 17:01:32 2024 +0200
@@ -7,8 +7,8 @@
   NEWS
   README
   Resources/CMake/3dhop-4.3.patch
-  Resources/CMake/nexus-viewer-4.2.patch
-  Resources/CMake/nexus-viewer-4.3.patch
+  Resources/CMake/NexusViewer-4.2.patch
+  Resources/CMake/NexusViewer-4.3.patch
   Resources/CreateThreeDist.txt
   Resources/Nexus.txt
   WebApplications/o3dv.html
--- a/CMakeLists.txt	Sat Jun 15 16:51:42 2024 +0200
+++ b/CMakeLists.txt	Sat Jun 15 17:01:32 2024 +0200
@@ -198,7 +198,8 @@
 list(APPEND STATIC_ASSETS_CONTENT  "${CMAKE_SOURCE_DIR}/JavaScriptLibraries/dist-three")
 
 if (ENABLE_NEXUS)
-  include(${CMAKE_SOURCE_DIR}/Resources/CMake/NexusViewer.cmake)
+  #include(${CMAKE_SOURCE_DIR}/Resources/CMake/NexusViewer-4.2.cmake)
+  include(${CMAKE_SOURCE_DIR}/Resources/CMake/NexusViewer-4.3.cmake)
 
   list(APPEND STATIC_ASSETS_PREFIXES "nexus")
   list(APPEND STATIC_ASSETS_CONTENT  ${NEXUS_VIEWER_DIR})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/CMake/NexusViewer-4.2.cmake	Sat Jun 15 17:01:32 2024 +0200
@@ -0,0 +1,50 @@
+# SPDX-FileCopyrightText: 2023-2024 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+
+# STL plugin for Orthanc
+# Copyright (C) 2023-2024 Sebastien Jodogne, UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+DownloadPackage(
+  "6069b141edb7ce1d543b53ddaa4b41d1"
+  "https://orthanc.uclouvain.be/downloads/third-party-downloads/STL/nexus-4.2.zip"
+  "${CMAKE_BINARY_DIR}/nexus-4.2")
+
+set(NEXUS_VIEWER_DIR  ${CMAKE_CURRENT_BINARY_DIR}/nexus)
+file(MAKE_DIRECTORY ${NEXUS_VIEWER_DIR})
+
+DownloadCompressedFile(
+  "df21a4a192c0952a1189125609cc76f9"
+  "https://orthanc.uclouvain.be/downloads/third-party-downloads/STL/three-84.js.gz"
+  "${NEXUS_VIEWER_DIR}/three-84.js")
+
+file(COPY
+  ${CMAKE_BINARY_DIR}/nexus-4.2/html/js
+  ${CMAKE_BINARY_DIR}/nexus-4.2/html/threejs.html
+  DESTINATION
+  ${NEXUS_VIEWER_DIR}
+  )
+
+execute_process(
+  COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
+  ${CMAKE_CURRENT_LIST_DIR}/NexusViewer-4.2.patch
+  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+  RESULT_VARIABLE Failure
+  )
+
+list(APPEND STATIC_ASSETS_PREFIXES "nexus")
+list(APPEND STATIC_ASSETS_CONTENT  ${NEXUS_VIEWER_DIR})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/CMake/NexusViewer-4.2.patch	Sat Jun 15 17:01:32 2024 +0200
@@ -0,0 +1,12 @@
+diff -urEb nexus.orig/threejs.html nexus/threejs.html
+--- nexus.orig/threejs.html	2024-06-15 16:27:10.763574203 +0200
++++ nexus/threejs.html	2024-06-15 16:28:03.807136118 +0200
+@@ -5,7 +5,7 @@
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
+ <style>body { margin: 0px; overflow: hidden; }</style>
+-<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/84/three.js"></script>
++<script src="three-84.js"></script>
+ <script src="js/TrackballControls.js"></script>
+ <script src="js/nexus.js"></script>
+ <script src="js/nexus_three.js"></script>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/CMake/NexusViewer-4.3.cmake	Sat Jun 15 17:01:32 2024 +0200
@@ -0,0 +1,45 @@
+# SPDX-FileCopyrightText: 2023-2024 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+
+# STL plugin for Orthanc
+# Copyright (C) 2023-2024 Sebastien Jodogne, UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+DownloadPackage(
+  "bf61d139b592eb5b724f0f8a3f53bb04"
+  "https://orthanc.uclouvain.be/downloads/third-party-downloads/STL/nexus-4.3.zip"
+  "${CMAKE_BINARY_DIR}/nexus-4.3")
+
+set(NEXUS_VIEWER_DIR  ${CMAKE_CURRENT_BINARY_DIR}/nexus)
+file(MAKE_DIRECTORY ${NEXUS_VIEWER_DIR})
+
+file(COPY
+  ${CMAKE_BINARY_DIR}/nexus-4.3/html/js
+  ${CMAKE_BINARY_DIR}/nexus-4.3/html/threejs.html
+  DESTINATION
+  ${NEXUS_VIEWER_DIR}
+  )
+
+execute_process(
+  COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
+  ${CMAKE_CURRENT_LIST_DIR}/NexusViewer-4.3.patch
+  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+  RESULT_VARIABLE Failure
+  )
+
+list(APPEND STATIC_ASSETS_PREFIXES "nexus")
+list(APPEND STATIC_ASSETS_CONTENT  ${NEXUS_VIEWER_DIR})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/CMake/NexusViewer-4.3.patch	Sat Jun 15 17:01:32 2024 +0200
@@ -0,0 +1,12 @@
+diff -urEb nexus.orig/threejs.html nexus/threejs.html
+--- nexus.orig/threejs.html	2024-06-15 16:43:08.948546947 +0200
++++ nexus/threejs.html	2024-06-15 16:43:46.232375961 +0200
+@@ -4,7 +4,7 @@
+ <title>Nexus threejs</title>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
+-<style> body { margin:0; width:100vw; height:100vh; } #container { width:100vw; height:100vh; } </style>
++<style> body { margin:0; width:100vw; height:100vh; overflow-x: hidden; overflow-y: hidden; } #container { width:100vw; height:100vh; } </style>
+ <script src="js/three.min.js"></script>
+ <script src="js/nexus.js"></script>
+ <script src="js/nexus_three.js"></script>
--- a/Resources/CMake/NexusViewer.cmake	Sat Jun 15 16:51:42 2024 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-# SPDX-FileCopyrightText: 2023-2024 Sebastien Jodogne, UCLouvain, Belgium
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-
-# STL plugin for Orthanc
-# Copyright (C) 2023-2024 Sebastien Jodogne, UCLouvain, Belgium
-#
-# This program is free software: you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-
-DownloadPackage(
-  "bf61d139b592eb5b724f0f8a3f53bb04"
-  "https://orthanc.uclouvain.be/downloads/third-party-downloads/STL/nexus-4.3.zip"
-  "${CMAKE_BINARY_DIR}/nexus-4.3")
-
-set(NEXUS_VIEWER_DIR  ${CMAKE_CURRENT_BINARY_DIR}/nexus)
-file(MAKE_DIRECTORY ${NEXUS_VIEWER_DIR})
-
-file(COPY
-  ${CMAKE_BINARY_DIR}/nexus-4.3/html/js
-  ${CMAKE_BINARY_DIR}/nexus-4.3/html/threejs.html
-  DESTINATION
-  ${NEXUS_VIEWER_DIR}
-  )
-
-execute_process(
-  COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
-  ${CMAKE_CURRENT_LIST_DIR}/nexus-viewer-4.3.patch
-  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-  RESULT_VARIABLE Failure
-  )
-
-list(APPEND STATIC_ASSETS_PREFIXES "nexus")
-list(APPEND STATIC_ASSETS_CONTENT  ${NEXUS_VIEWER_DIR})
--- a/Resources/CMake/nexus-viewer-4.2.patch	Sat Jun 15 16:51:42 2024 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-diff -urEb nexus.orig/threejs.html nexus/threejs.html
---- nexus.orig/threejs.html	2024-06-15 16:27:10.763574203 +0200
-+++ nexus/threejs.html	2024-06-15 16:28:03.807136118 +0200
-@@ -5,7 +5,7 @@
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <style>body { margin: 0px; overflow: hidden; }</style>
--<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/84/three.js"></script>
-+<script src="three-84.js"></script>
- <script src="js/TrackballControls.js"></script>
- <script src="js/nexus.js"></script>
- <script src="js/nexus_three.js"></script>
--- a/Resources/CMake/nexus-viewer-4.3.patch	Sat Jun 15 16:51:42 2024 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-diff -urEb nexus.orig/threejs.html nexus/threejs.html
---- nexus.orig/threejs.html	2024-06-15 16:43:08.948546947 +0200
-+++ nexus/threejs.html	2024-06-15 16:43:46.232375961 +0200
-@@ -4,7 +4,7 @@
- <title>Nexus threejs</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
--<style> body { margin:0; width:100vw; height:100vh; } #container { width:100vw; height:100vh; } </style>
-+<style> body { margin:0; width:100vw; height:100vh; overflow-x: hidden; overflow-y: hidden; } #container { width:100vw; height:100vh; } </style>
- <script src="js/three.min.js"></script>
- <script src="js/nexus.js"></script>
- <script src="js/nexus_three.js"></script>