Loading js/ui_align.js +4 −0 Original line number Original line Diff line number Diff line Loading @@ -413,6 +413,10 @@ function x3dom_align_art(){ //test_height_alignment_set3_2points(); //test_height_alignment_set3_2points(); if (Data.markers.length<2){ if (Data.markers.length<2){ var msg = "Alignment error: too few markers"; ui_showMessage("window-error",msg); console.log("Too few points"); console.log("Too few points"); return; return; } } Loading js/ui_init.js +50 −13 Original line number Original line Diff line number Diff line Loading @@ -202,6 +202,8 @@ function background_init(){ function light_init(){ function light_init(){ var mode = "t"; var x3delement = $("#x3d_id").find("scene"); var x3delement = $("#x3d_id").find("scene"); var model_url = SETTINGS.files.x3d; var model_url = SETTINGS.files.x3d; Loading @@ -219,17 +221,17 @@ function light_init(){ $.ajax({ $.ajax({ url: SETTINGS.files.kml+"?"+Date.now(), url: SETTINGS.files.kml+"?"+Date.now(), success: function(response){ success: function(response){ parse_light_init_response(response,"init"); parse_light_init_response(response,"init",mode); }, }, error: function(response){ error: function(response){ console.log("Init: KML not found. Using defaults"); console.log("Init: KML not found. Using defaults"); parse_light_init_response(response,"init"); parse_light_init_response(response,"init",mode); } } }); }); } } function parse_light_init_response(response,state){ function parse_light_init_response(response,state,mode){ var latitude = parseFloat($(response).find("Camera").find("latitude").text()) || 40.7233861; var latitude = parseFloat($(response).find("Camera").find("latitude").text()) || 40.7233861; var longitude = parseFloat($(response).find("Camera").find("longitude").text()) || -111.9328843; var longitude = parseFloat($(response).find("Camera").find("longitude").text()) || -111.9328843; Loading Loading @@ -285,7 +287,7 @@ function parse_light_init_response(response,state){ deep_init(); deep_init(); //align_init(); //align_init(); x3d_initial_camera_placement(); x3d_initial_camera_placement(mode); Scene.resize(); Scene.resize(); x3d_events(); x3d_events(); leaf_events(); leaf_events(); Loading @@ -299,7 +301,7 @@ function parse_light_init_response(response,state){ Map.marker.setBasePoint(new L.LatLng(latitude,longitude)); Map.marker.setBasePoint(new L.LatLng(latitude,longitude)); Map.marker._syncMeasureMarkersToBasePoint(); Map.marker._syncMeasureMarkersToBasePoint(); x3d_initial_camera_placement(); x3d_initial_camera_placement(mode); //x3d_mouseMove(); //x3d_mouseMove(); Scene.resize(); Scene.resize(); Loading @@ -309,16 +311,16 @@ function parse_light_init_response(response,state){ } } function reset_to_initial_position(){ function reset_to_initial_position(mode){ $.ajax({ $.ajax({ url: SETTINGS.files.kml+"?"+Date.now(), url: SETTINGS.files.kml+"?"+Date.now(), success: function(response){ success: function(response){ parse_light_init_response(response,"reset"); parse_light_init_response(response,"reset",mode); }, }, error: function(response){ error: function(response){ console.log("Reset: KML not found. Using defaults"); console.log("Reset: KML not found. Using defaults"); parse_light_init_response(response,"reset"); parse_light_init_response(response,"reset",mode); } } }); }); Loading Loading @@ -417,7 +419,15 @@ function deep_init(){ } } function x3d_initial_camera_placement(){ function x3d_initial_camera_placement(mode){ if (mode==undefined){ // reset horizontal mode = "r"; }else{ // reset with tilt mode = "t"; } Scene.old_view_translation = null; Scene.old_view_translation = null; Loading Loading @@ -452,8 +462,12 @@ function x3d_initial_camera_placement(){ // exclude tilt and roll // exclude tilt and roll var RC0_rw = T.inverse().mult(Mh).mult(T); var RC0_rw = T.inverse().mult(Mh).mult(T); var RC0_rw_t = T.inverse().mult(Mh).mult(Mt).mult(T); // what's this?! // what's this?! var RC_w = R0.inverse().mult(RC0_rw); var RC_w = R0.inverse().mult(RC0_rw); var RC_wt = R0.inverse().mult(RC0_rw_t); // store matrices // store matrices Data.camera.Matrices = { Data.camera.Matrices = { R0 : R0, R0 : R0, Loading @@ -462,7 +476,11 @@ function x3d_initial_camera_placement(){ RC_w0: RC_w RC_w0: RC_w }; }; if (mode=="r"){ x3dom_setViewpoint(RC_w); x3dom_setViewpoint(RC_w); }else{ x3dom_setViewpoint(RC_wt); } //x3dom_setViewpoint(RC0_rw); //x3dom_setViewpoint(RC0_rw); //x3dom_setViewpoint(R0); //x3dom_setViewpoint(R0); Loading Loading @@ -929,10 +947,29 @@ function leaf_translation_v1(p0,p1){ } } function x3d_mouseMove(){ function x3d_mouseMove(){ x3dom_update_map(); x3dom_update_map(); } } function remove_markers(){ var index; var elem; Scene.highlighted_marker_index = null; var n = Data.markers.length; for(var i=0;i<n;i++){ index = n-1-i; elem = $("#my-sph-"+index); Data.markers.splice(index,1); Map.deleteMarker(index); elem.remove(); } } js/ui_menu.js +13 −0 Original line number Original line Diff line number Diff line Loading @@ -102,6 +102,7 @@ function menu_init(){ shiftspeed_init(); shiftspeed_init(); marker_size_color_init(); marker_size_color_init(); reset_view_init(); reset_view_init(); remove_markers_init(); align_init(); align_init(); work_with_kml_init(); work_with_kml_init(); save_rating_init(); save_rating_init(); Loading Loading @@ -158,6 +159,18 @@ function reset_view_init(){ reset_to_initial_position(); reset_to_initial_position(); }); }); $("#reset_view_t").on('click',function(){ reset_to_initial_position("t"); }); } function remove_markers_init(){ $("#remove_markers").on('click',function(){ remove_markers(); }); } } function work_with_kml_init(){ function work_with_kml_init(){ Loading js/x3dom_init.js +5 −1 Original line number Original line Diff line number Diff line Loading @@ -249,7 +249,11 @@ X3DOMObject.prototype.KeyEvents = function(){ self.element.addEventListener('keypress',function(e){ self.element.addEventListener('keypress',function(e){ if (e.key=="r"){ if (e.key=="r"){ //reset to initial position - no tilt = horizontal $("#reset_view").click(); $("#reset_view").click(); }else if(e.key=="t"){ //reset to initial position with tilt reset_to_initial_position("t"); } } }); }); Loading viewer.html +13 −1 Original line number Original line Diff line number Diff line Loading @@ -150,7 +150,11 @@ Instructions: <td> </td> <td> </td> </tr> </tr> <tr> <tr> <td><button id='reset_view' class='donothide'>Reset view</button></td> <td> <button id='reset_view' class='donothide' title='Horizontal: heading=initial, tilt=0, roll=0. Or press r-key'>Reset view (r)</button> <button id='reset_view_t' class='donothide' title='Tilted: heading=initial, tilt=initial, roll=0. Or press t-key'>Reset view (t)</button> <button id='remove_markers' class='donothide' >Remove markers</button> </td> </tr> </tr> <tr> <tr> <td> </td> <td> </td> Loading Loading @@ -274,6 +278,14 @@ Instructions: </ul> </ul> </td> </td> </tr> </tr> <tr> <td><b>r</b>-key</td> <td>reset view (heading = initial, tilt = 0, roll = 0)</td> </tr> <tr> <td><b>t</b>-key</td> <td>reset view (heading = initial, tilt = initial, roll = 0)</td> </tr> <tr> <tr> <td><button>Close</button></td> <td><button>Close</button></td> </tr> </tr> Loading Loading
js/ui_align.js +4 −0 Original line number Original line Diff line number Diff line Loading @@ -413,6 +413,10 @@ function x3dom_align_art(){ //test_height_alignment_set3_2points(); //test_height_alignment_set3_2points(); if (Data.markers.length<2){ if (Data.markers.length<2){ var msg = "Alignment error: too few markers"; ui_showMessage("window-error",msg); console.log("Too few points"); console.log("Too few points"); return; return; } } Loading
js/ui_init.js +50 −13 Original line number Original line Diff line number Diff line Loading @@ -202,6 +202,8 @@ function background_init(){ function light_init(){ function light_init(){ var mode = "t"; var x3delement = $("#x3d_id").find("scene"); var x3delement = $("#x3d_id").find("scene"); var model_url = SETTINGS.files.x3d; var model_url = SETTINGS.files.x3d; Loading @@ -219,17 +221,17 @@ function light_init(){ $.ajax({ $.ajax({ url: SETTINGS.files.kml+"?"+Date.now(), url: SETTINGS.files.kml+"?"+Date.now(), success: function(response){ success: function(response){ parse_light_init_response(response,"init"); parse_light_init_response(response,"init",mode); }, }, error: function(response){ error: function(response){ console.log("Init: KML not found. Using defaults"); console.log("Init: KML not found. Using defaults"); parse_light_init_response(response,"init"); parse_light_init_response(response,"init",mode); } } }); }); } } function parse_light_init_response(response,state){ function parse_light_init_response(response,state,mode){ var latitude = parseFloat($(response).find("Camera").find("latitude").text()) || 40.7233861; var latitude = parseFloat($(response).find("Camera").find("latitude").text()) || 40.7233861; var longitude = parseFloat($(response).find("Camera").find("longitude").text()) || -111.9328843; var longitude = parseFloat($(response).find("Camera").find("longitude").text()) || -111.9328843; Loading Loading @@ -285,7 +287,7 @@ function parse_light_init_response(response,state){ deep_init(); deep_init(); //align_init(); //align_init(); x3d_initial_camera_placement(); x3d_initial_camera_placement(mode); Scene.resize(); Scene.resize(); x3d_events(); x3d_events(); leaf_events(); leaf_events(); Loading @@ -299,7 +301,7 @@ function parse_light_init_response(response,state){ Map.marker.setBasePoint(new L.LatLng(latitude,longitude)); Map.marker.setBasePoint(new L.LatLng(latitude,longitude)); Map.marker._syncMeasureMarkersToBasePoint(); Map.marker._syncMeasureMarkersToBasePoint(); x3d_initial_camera_placement(); x3d_initial_camera_placement(mode); //x3d_mouseMove(); //x3d_mouseMove(); Scene.resize(); Scene.resize(); Loading @@ -309,16 +311,16 @@ function parse_light_init_response(response,state){ } } function reset_to_initial_position(){ function reset_to_initial_position(mode){ $.ajax({ $.ajax({ url: SETTINGS.files.kml+"?"+Date.now(), url: SETTINGS.files.kml+"?"+Date.now(), success: function(response){ success: function(response){ parse_light_init_response(response,"reset"); parse_light_init_response(response,"reset",mode); }, }, error: function(response){ error: function(response){ console.log("Reset: KML not found. Using defaults"); console.log("Reset: KML not found. Using defaults"); parse_light_init_response(response,"reset"); parse_light_init_response(response,"reset",mode); } } }); }); Loading Loading @@ -417,7 +419,15 @@ function deep_init(){ } } function x3d_initial_camera_placement(){ function x3d_initial_camera_placement(mode){ if (mode==undefined){ // reset horizontal mode = "r"; }else{ // reset with tilt mode = "t"; } Scene.old_view_translation = null; Scene.old_view_translation = null; Loading Loading @@ -452,8 +462,12 @@ function x3d_initial_camera_placement(){ // exclude tilt and roll // exclude tilt and roll var RC0_rw = T.inverse().mult(Mh).mult(T); var RC0_rw = T.inverse().mult(Mh).mult(T); var RC0_rw_t = T.inverse().mult(Mh).mult(Mt).mult(T); // what's this?! // what's this?! var RC_w = R0.inverse().mult(RC0_rw); var RC_w = R0.inverse().mult(RC0_rw); var RC_wt = R0.inverse().mult(RC0_rw_t); // store matrices // store matrices Data.camera.Matrices = { Data.camera.Matrices = { R0 : R0, R0 : R0, Loading @@ -462,7 +476,11 @@ function x3d_initial_camera_placement(){ RC_w0: RC_w RC_w0: RC_w }; }; if (mode=="r"){ x3dom_setViewpoint(RC_w); x3dom_setViewpoint(RC_w); }else{ x3dom_setViewpoint(RC_wt); } //x3dom_setViewpoint(RC0_rw); //x3dom_setViewpoint(RC0_rw); //x3dom_setViewpoint(R0); //x3dom_setViewpoint(R0); Loading Loading @@ -929,10 +947,29 @@ function leaf_translation_v1(p0,p1){ } } function x3d_mouseMove(){ function x3d_mouseMove(){ x3dom_update_map(); x3dom_update_map(); } } function remove_markers(){ var index; var elem; Scene.highlighted_marker_index = null; var n = Data.markers.length; for(var i=0;i<n;i++){ index = n-1-i; elem = $("#my-sph-"+index); Data.markers.splice(index,1); Map.deleteMarker(index); elem.remove(); } }
js/ui_menu.js +13 −0 Original line number Original line Diff line number Diff line Loading @@ -102,6 +102,7 @@ function menu_init(){ shiftspeed_init(); shiftspeed_init(); marker_size_color_init(); marker_size_color_init(); reset_view_init(); reset_view_init(); remove_markers_init(); align_init(); align_init(); work_with_kml_init(); work_with_kml_init(); save_rating_init(); save_rating_init(); Loading Loading @@ -158,6 +159,18 @@ function reset_view_init(){ reset_to_initial_position(); reset_to_initial_position(); }); }); $("#reset_view_t").on('click',function(){ reset_to_initial_position("t"); }); } function remove_markers_init(){ $("#remove_markers").on('click',function(){ remove_markers(); }); } } function work_with_kml_init(){ function work_with_kml_init(){ Loading
js/x3dom_init.js +5 −1 Original line number Original line Diff line number Diff line Loading @@ -249,7 +249,11 @@ X3DOMObject.prototype.KeyEvents = function(){ self.element.addEventListener('keypress',function(e){ self.element.addEventListener('keypress',function(e){ if (e.key=="r"){ if (e.key=="r"){ //reset to initial position - no tilt = horizontal $("#reset_view").click(); $("#reset_view").click(); }else if(e.key=="t"){ //reset to initial position with tilt reset_to_initial_position("t"); } } }); }); Loading
viewer.html +13 −1 Original line number Original line Diff line number Diff line Loading @@ -150,7 +150,11 @@ Instructions: <td> </td> <td> </td> </tr> </tr> <tr> <tr> <td><button id='reset_view' class='donothide'>Reset view</button></td> <td> <button id='reset_view' class='donothide' title='Horizontal: heading=initial, tilt=0, roll=0. Or press r-key'>Reset view (r)</button> <button id='reset_view_t' class='donothide' title='Tilted: heading=initial, tilt=initial, roll=0. Or press t-key'>Reset view (t)</button> <button id='remove_markers' class='donothide' >Remove markers</button> </td> </tr> </tr> <tr> <tr> <td> </td> <td> </td> Loading Loading @@ -274,6 +278,14 @@ Instructions: </ul> </ul> </td> </td> </tr> </tr> <tr> <td><b>r</b>-key</td> <td>reset view (heading = initial, tilt = 0, roll = 0)</td> </tr> <tr> <td><b>t</b>-key</td> <td>reset view (heading = initial, tilt = initial, roll = 0)</td> </tr> <tr> <tr> <td><button>Close</button></td> <td><button>Close</button></td> </tr> </tr> Loading