Commit 63a79179 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

ui for models alignment

parent 7c5d2701
...@@ -66,7 +66,9 @@ function manualposor_init(){ ...@@ -66,7 +66,9 @@ function manualposor_init(){
' <th align=\'left\' colspan=\'3\'>orientation, &deg;</th>', ' <th align=\'left\' colspan=\'3\'>orientation, &deg;</th>',
' </tr>', ' </tr>',
' <tr>', ' <tr>',
' <th colspan=\'4\'></th>', ' <th colspan=\'1\'></th>',
' <th colspan=\'2\'><button title=\'reset radios (r1 & r2)\' id=\'mpr_reset_radios\'>reset</button></th>',
' <th colspan=\'1\'></th>',
' <th class=\'mpr_name\'>step, m :</th>', ' <th class=\'mpr_name\'>step, m :</th>',
' <th class=\'mpr_name\'><input id=\'mpr_step_m\' type=\'text\' class=\'mpr_steps\' value=\'0.001\'></th>', ' <th class=\'mpr_name\'><input id=\'mpr_step_m\' type=\'text\' class=\'mpr_steps\' value=\'0.001\'></th>',
' <th></th>', ' <th></th>',
...@@ -154,6 +156,18 @@ function manualposor_init(){ ...@@ -154,6 +156,18 @@ function manualposor_init(){
}); });
}); });
$("#mpr_reset_radios").on('click',function(){
$(".mpr_r1").each(function(){
$(this).prop("checked",false);
});
$(".mpr_r2").each(function(){
$(this).prop("checked",false);
});
});
} }
// Loading // Loading
...@@ -369,8 +383,8 @@ function manualposor_refresh_content(){ ...@@ -369,8 +383,8 @@ function manualposor_refresh_content(){
$("#mpr_table").append($([ $("#mpr_table").append($([
'<tr class=\'mpr_content\'>', '<tr class=\'mpr_content\'>',
' <td align=\'center\' class=\'mpr_name mpr_modelname\'>'+name+'</td>', ' <td align=\'center\' class=\'mpr_name mpr_modelname\'>'+name+'</td>',
' <td><input type=\'radio\' class=\'mpr_r1\' name=\'r1\' ></td>', ' <td><input type=\'radio\' class=\'mpr_r1\' name=\'r1\' value=\''+name+'\' id=\'r1_'+name+'\'></td>',
' <td><input type=\'radio\' class=\'mpr_r2\' name=\'r2\' ></td>', ' <td><input type=\'radio\' class=\'mpr_r2\' name=\'r2\' value=\''+name+'\' id=\'r2_'+name+'\'></td>',
' <td><input type=\'checkbox\' class=\'mpr_hide\'></td>', ' <td><input type=\'checkbox\' class=\'mpr_hide\'></td>',
' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_x\' value=\''+tra_tra_rw.x.toFixed(3)+'\' \></td>', ' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_x\' value=\''+tra_tra_rw.x.toFixed(3)+'\' \></td>',
' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_y\' value=\''+tra_tra_rw.y.toFixed(3)+'\' \></td>', ' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_y\' value=\''+tra_tra_rw.y.toFixed(3)+'\' \></td>',
...@@ -383,6 +397,11 @@ function manualposor_refresh_content(){ ...@@ -383,6 +397,11 @@ function manualposor_refresh_content(){
}); });
// rebind all
$(".mpr_r1[name=r1]").off('change').change(function(){
console.log("Go "+this.value);
});
// remove entry if inline missing // remove entry if inline missing
$(".mpr_modelname").each(function(){ $(".mpr_modelname").each(function(){
...@@ -522,4 +541,36 @@ function manualposor_update(elem){ ...@@ -522,4 +541,36 @@ function manualposor_update(elem){
} }
function manualposor_rotate_glued(){
$(".mpr_r1[name=r1]:checked").each(function(){
var modelname = $(this).val();
var tmptransform = $("inline[name=x3d_"+modelname+"]").parent().parent();
var vm = Scene.element.runtime.viewMatrix().inverse();
});
}
...@@ -427,6 +427,9 @@ function deep_init(){ ...@@ -427,6 +427,9 @@ function deep_init(){
//x3dom_testbox(); //x3dom_testbox();
x3dom_setUpRight(); x3dom_setUpRight();
if (SETTINGS.manualposor){
manualposor_rotate_glued();
}
} }
......
...@@ -841,13 +841,13 @@ function x3dom_update_map(){ ...@@ -841,13 +841,13 @@ function x3dom_update_map(){
} }
function x3dom_testbox(){ function x3dom_testbox(){
// keep the test cube // keep the test cube
var mat = Scene.element.runtime.viewMatrix().inverse(); var mat = Scene.element.runtime.viewMatrix().inverse();
var Q = new x3dom.fields.Quaternion(0, 0, 1, 0); var Q = new x3dom.fields.Quaternion(0, 0, 1, 0);
Q.setValue(mat); Q.setValue(mat);
var AA = Q.toAxisAngle(); var AA = Q.toAxisAngle();
var testbox = $("#testbox"); var testbox = $("#testbox");
testbox.attr("rotation",AA[0].toString()+" "+AA[1]); testbox.attr("rotation",AA[0].toString()+" "+AA[1]);
} }
// uses globals // uses globals
...@@ -872,4 +872,3 @@ function x3dom_setViewpoint(m){ ...@@ -872,4 +872,3 @@ function x3dom_setViewpoint(m){
Data.camera.Matrices.RC_w = m; Data.camera.Matrices.RC_w = m;
} }
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