From 67ac56922ff0d98d0bcae32091dc6a32cd4aec9a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 25 Jun 2024 11:08:50 +0200 Subject: [PATCH] Fix commenti e continuo reorg codice --- WebDoorView/3DM_test/test_js_call/index3.html | 17 +++++- .../webgl-door-visualizer/webgl_draw.js | 56 +++++++++++-------- 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/WebDoorView/3DM_test/test_js_call/index3.html b/WebDoorView/3DM_test/test_js_call/index3.html index 7ff0d4b..4a7655c 100644 --- a/WebDoorView/3DM_test/test_js_call/index3.html +++ b/WebDoorView/3DM_test/test_js_call/index3.html @@ -73,6 +73,9 @@ modelPath: 'https://iis01.egalware.com/Test3D/THREEJS_DOORS/Door_models', fName: getUrlParameter('src') } + + // init controllo + WGL.initcall(options); // Reading URL parameters ------------------------------------------------------------------------- function getUrlParameter( name) { @@ -140,8 +143,6 @@ WGL.toggleRotation(); } - WGL.initcall(options); - // Event Listner ------------------------------------------------------------------- // KEY document.addEventListener( "keypress", function( event) { @@ -164,6 +165,18 @@ else if ( event.key.toLowerCase() === 'g') toggleGrid(); }) ; + + // Elements + var helpButton = document.getElementById( "helpButton") ; + var infoDiv = document.getElementById( "infoDiv") ; + infoDiv.style.display = "none"; + helpButton.addEventListener( "click", function() { + if ( infoDiv.style.display === "none") + infoDiv.style.display = "block" ; + else + infoDiv.style.display = "none"; + }) ; + \ No newline at end of file diff --git a/WebDoorView/3DM_test/test_js_call/lib/node_modules/webgl-door-visualizer/webgl_draw.js b/WebDoorView/3DM_test/test_js_call/lib/node_modules/webgl-door-visualizer/webgl_draw.js index bbb299b..b398c99 100644 --- a/WebDoorView/3DM_test/test_js_call/lib/node_modules/webgl-door-visualizer/webgl_draw.js +++ b/WebDoorView/3DM_test/test_js_call/lib/node_modules/webgl-door-visualizer/webgl_draw.js @@ -67,8 +67,16 @@ const gridGroup = new THREE.Group() ; const frameGroup = new THREE.Group() ; -//init(); +/* +* Oggetto principale gestione WebGL Door visualizer +*/ class webgl_original { + + /** + * Metodo Init con visualizzazzione dati + * @param {string} modelPath Percorso base recupero modello 3dm + * @param {string} fName Nome del modello 3dm da visualizzare + */ async initcall({ modelPath, fName}) { PATH = modelPath; FILE_NAME = fName; @@ -83,49 +91,65 @@ class webgl_original { console.log('init done in : ' + timeElapsed); } - // reset posizione camera + /** + * reset posizione camera + */ resetCamera() { myResetCamera(); } - // imposta vista isometrica/ortografica + /** + * imposta vista isometrica/ortografica + */ setCameraOrtho() { mySetCameraOrtho() } - // imposta vista prospettica + /** + * imposta vista prospettica + */ setCameraPersp() { mySetCameraPersp() } - // toggle visualizzaizone cubo + /** + * toggle visualizzazione cubo + */ toggleCube() { myToggleCubeVisibility(); } - // toggle visualizzazione frame assi + /** + * toggle visualizzazione frame assi + */ toggleFrame() { myToggleFrameVisibility(); } - // toggle visualizzazione griglia + /** + * toggle visualizzazione griglia + */ toggleGrid() { myToggleGridVisibility(); } - // toggle visualizzazione quotature + /** + * toggle visualizzazione quotature + */ toggleQuotes() { myToggleQuote() } - // toggle rotazione + /** + * toggle rotazione + */ toggleRotation() { myToggleRotation() @@ -407,17 +431,3 @@ function mySetCameraPersp() { function myResetCamera() { setCameraPosition() ; } - - - - // Elements -var helpButton = document.getElementById( "helpButton") ; -var infoDiv = document.getElementById( "infoDiv") ; -infoDiv.style.display = "none"; -helpButton.addEventListener( "click", function() { - if ( infoDiv.style.display === "none") - infoDiv.style.display = "block" ; - else - infoDiv.style.display = "none"; -}) ; -