Commit b825e1f0 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

loading extra models: load, move, save rotation, hide selected on shift-key

parent a3c408ea
...@@ -457,13 +457,15 @@ function wheelEvent_list(event){ ...@@ -457,13 +457,15 @@ function wheelEvent_list(event){
if (event.wheelDelta) { //IE+Opera if (event.wheelDelta) { //IE+Opera
delta = event.wheelDelta/120; delta = event.wheelDelta/120;
if (window.opera) delta = -delta; if (window.opera) delta = -delta;
} else if (event.detail) { // Mozilla }else if (event.detail) { // Mozilla
delta = -event.detail; delta = -event.detail;
} }
if (delta) if (delta){
handleWheel_list(event,delta,shiftKey); handleWheel_list(event,delta,shiftKey);
if (event.preventDefault) }
if (event.preventDefault){
event.preventDefault(); event.preventDefault();
}
event.returnValue = false; event.returnValue = false;
} }
......
...@@ -303,6 +303,7 @@ html, body, #x3d_wrapper { ...@@ -303,6 +303,7 @@ html, body, #x3d_wrapper {
color: black; color: black;
font-size: 16px; font-size: 16px;
margin-bottom: 2px; margin-bottom: 2px;
outline:0;
} }
#window-error{ #window-error{
...@@ -416,9 +417,15 @@ html, body, #x3d_wrapper { ...@@ -416,9 +417,15 @@ html, body, #x3d_wrapper {
height: 25px; height: 25px;
} }
.mpr_name{
font-size:12px;
}
.mpr_input, .mpr_steps{
width:50px;
text-align:right;
}
#mpr_save{
margin: 5px;
}
This diff is collapsed.
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
var Data = { var Data = {
camera:{}, camera:{},
markers:[], markers:[],
extra_models:[]
}; };
var Scene; var Scene;
...@@ -211,6 +212,7 @@ function light_init(){ ...@@ -211,6 +212,7 @@ function light_init(){
var x3delement = $("#x3d_id").find("scene"); var x3delement = $("#x3d_id").find("scene");
var model_url = SETTINGS.files.x3d; var model_url = SETTINGS.files.x3d;
var model_name = SETTINGS.path;
var model_back_url = SETTINGS.files.x3d_background; var model_back_url = SETTINGS.files.x3d_background;
// multiple models in one scene test // multiple models in one scene test
...@@ -218,9 +220,11 @@ function light_init(){ ...@@ -218,9 +220,11 @@ function light_init(){
var model = $([ var model = $([
'<group>', '<group>',
' <transform id=\'x3d_transform\'>', ' <switch whichChoice=\'0\'>',
' <inline name="x3d" namespacename="x3d" url="'+model_url+'"></inline>', ' <transform id=\'x3d_transform\' class=\'inline_wrapper\'>',
' <inline name="x3d_'+model_name+'" namespacename="x3d_'+model_name+'" url="'+model_url+'"></inline>',
' </transform>', ' </transform>',
' </switch>',
'</group>', '</group>',
// multiple models in one scene test // multiple models in one scene test
//'<group>', //'<group>',
......
...@@ -106,6 +106,7 @@ function menu_init(){ ...@@ -106,6 +106,7 @@ function menu_init(){
work_with_kml_init(); work_with_kml_init();
save_rating_init(); save_rating_init();
editmode_init(); editmode_init();
// see extra_models.js
extra_models_init(); extra_models_init();
manualposor_init(); manualposor_init();
...@@ -292,45 +293,6 @@ function editmode_init(){ ...@@ -292,45 +293,6 @@ function editmode_init(){
} }
function manualposor_init(){
$("#window-extrainfo").html([
'<div>',
' <table id=\'mpr_table\'>',
' <tr>',
' <th></th>',
' <th colspan=\'3\'>position, m</th>',
' <th colspan=\'3\'>orientation, &deg;</th>',
' </tr>',
' <tr>',
' <th>Model</th>',
' <th>x</th>',
' <th>y</th>',
' <th>z</th>',
' <th>azimuth</th>',
' <th>elevation</th>',
' <th>skew</th>',
' </tr>',
' </table>',
'</div>'
].join('\n'));
if (SETTINGS.manualposor){
$("#window-extrainfo").show();
}else{
$("#window-extrainfo").hide();
}
$("#manualposor").on('click',function(){
if (SETTINGS.manualposor){
$("#window-extrainfo").show();
}else{
$("#window-extrainfo").hide();
}
});
}
function controls_showhide(){ function controls_showhide(){
if (!SETTINGS.experimental){ if (!SETTINGS.experimental){
...@@ -351,77 +313,3 @@ function controls_showhide(){ ...@@ -351,77 +313,3 @@ function controls_showhide(){
} }
} }
function extra_models_init(){
var emc = $("#extra_models-content");
// get content
$.ajax({
url: [SETTINGS.basepath,SETTINGS.path,"extra.xml"].join("/"),
success: function(response){
var eml = ['<table>'];
$(response).find("model").each(function(){
var name = $(this).attr("name");
var version = $(this).attr("version");
eml.push([
'<tr>',
' <td><input type=\'checkbox\' class=\'my-check-box donothide\' /></td>',
' <td class=\'extra_model_item\' version=\''+version+'\'>'+name+'</td>',
'</tr>'
].join('\n'));
});
eml.push('</table>');
emc.append($(eml.join('\n')));
var load_extra_models_button = $('<button>',{
id: 'load_extra_models_button',
title: 'load checked, hide unchecked',
class:'donothide'
}).html('Load');
emc.append('<br/>').append(load_extra_models_button);
load_extra_models_button.on('click',function(){
load_extra_models();
});
},
error: function(response){
emc.append($("<h2 style='color:red'>N/A</h2>"));
}
});
$("#extra_models_button").on("click",function(){
emc.show();
});
// changing a checkbox will not close menu
emc.on('click',function(e){
var test = $(e.target).hasClass("donothide");
if (!test){
emc.hide();
}
});
}
...@@ -149,7 +149,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){ ...@@ -149,7 +149,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
dist_xyz = null; dist_xyz = null;
} }
// azimuth, elevation and skew are relative to the camera location // azimuth, elevation and roll are relative to the camera location
az = Math.atan2(p_rw.x,-p_rw.z)*180/Math.PI; az = Math.atan2(p_rw.x,-p_rw.z)*180/Math.PI;
az = (az+360)%360; az = (az+360)%360;
el = Math.atan2(p_rw.y,Math.sqrt(p_rw.x*p_rw.x+p_rw.z*p_rw.z))*180/Math.PI; el = Math.atan2(p_rw.y,Math.sqrt(p_rw.x*p_rw.x+p_rw.z*p_rw.z))*180/Math.PI;
......
...@@ -1284,7 +1284,7 @@ X3DOMObject.displayViewInfo = function(e){ ...@@ -1284,7 +1284,7 @@ X3DOMObject.displayViewInfo = function(e){
' <th style=\'width:60px;\'>z</th>', ' <th style=\'width:60px;\'>z</th>',
' <th>azimuth</th>', ' <th>azimuth</th>',
' <th>elevation</th>', ' <th>elevation</th>',
' <th>skew</th>', ' <th>roll</th>',
'</tr>', '</tr>',
'<tr>', '<tr>',
' <td>mouse</td>', ' <td>mouse</td>',
......
...@@ -102,7 +102,7 @@ Instructions: ...@@ -102,7 +102,7 @@ Instructions:
<div id='window-error'></div> <div id='window-error'></div>
<div id='window-viewinfo'></div> <div id='window-viewinfo'></div>
<div id='window-markinfo'></div> <div id='window-markinfo'></div>
<div id='window-extrainfo'></div> <div id='window-extrainfo' tabindex='1'></div>
<div id='window-info'></div> <div id='window-info'></div>
</div> </div>
<div id='menu-content'> <div id='menu-content'>
...@@ -118,7 +118,7 @@ Instructions: ...@@ -118,7 +118,7 @@ Instructions:
<td><input id='markinfo' type='checkbox' class='my-check-box donothide' /></td> <td><input id='markinfo' type='checkbox' class='my-check-box donothide' /></td>
</tr> </tr>
<tr> <tr>
<td>Show view info (x, y, z, azimuth, elevation, skew)</td> <td>Show view info (x, y, z, azimuth, elevation, roll)</td>
<td><input id='viewinfo' type='checkbox' class='my-check-box donothide' /></td> <td><input id='viewinfo' type='checkbox' class='my-check-box donothide' /></td>
</tr> </tr>
<tr> <tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment