Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
b825e1f0
Commit
b825e1f0
authored
Sep 27, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loading extra models: load, move, save rotation, hide selected on shift-key
parent
a3c408ea
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
443 additions
and
136 deletions
+443
-136
index.js
js/index.js
+10
-8
ui.css
js/ui.css
+11
-4
ui_extra_models.js
js/ui_extra_models.js
+410
-4
ui_init.js
js/ui_init.js
+7
-3
ui_menu.js
js/ui_menu.js
+1
-113
x3dom_functions.js
js/x3dom_functions.js
+1
-1
x3dom_init.js
js/x3dom_init.js
+1
-1
viewer.html
viewer.html
+2
-2
No files found.
js/index.js
View file @
b825e1f0
...
...
@@ -455,15 +455,17 @@ function wheelEvent_list(event){
var
delta
=
0
;
if
(
!
event
)
event
=
window
.
event
;
// IE
if
(
event
.
wheelDelta
)
{
//IE+Opera
delta
=
event
.
wheelDelta
/
120
;
if
(
window
.
opera
)
delta
=
-
delta
;
}
else
if
(
event
.
detail
)
{
// Mozilla
delta
=
-
event
.
detail
;
delta
=
event
.
wheelDelta
/
120
;
if
(
window
.
opera
)
delta
=
-
delta
;
}
else
if
(
event
.
detail
)
{
// Mozilla
delta
=
-
event
.
detail
;
}
if
(
delta
){
handleWheel_list
(
event
,
delta
,
shiftKey
);
}
if
(
event
.
preventDefault
){
event
.
preventDefault
();
}
if
(
delta
)
handleWheel_list
(
event
,
delta
,
shiftKey
);
if
(
event
.
preventDefault
)
event
.
preventDefault
();
event
.
returnValue
=
false
;
}
...
...
js/ui.css
View file @
b825e1f0
...
...
@@ -303,6 +303,7 @@ html, body, #x3d_wrapper {
color
:
black
;
font-size
:
16px
;
margin-bottom
:
2px
;
outline
:
0
;
}
#window-error
{
...
...
@@ -416,9 +417,15 @@ html, body, #x3d_wrapper {
height
:
25px
;
}
.mpr_name
{
font-size
:
12px
;
}
.mpr_input
,
.mpr_steps
{
width
:
50px
;
text-align
:
right
;
}
#mpr_save
{
margin
:
5px
;
}
js/ui_extra_models.js
View file @
b825e1f0
This diff is collapsed.
Click to expand it.
js/ui_init.js
View file @
b825e1f0
...
...
@@ -38,6 +38,7 @@
var
Data
=
{
camera
:{},
markers
:[],
extra_models
:[]
};
var
Scene
;
...
...
@@ -211,6 +212,7 @@ function light_init(){
var
x3delement
=
$
(
"#x3d_id"
).
find
(
"scene"
);
var
model_url
=
SETTINGS
.
files
.
x3d
;
var
model_name
=
SETTINGS
.
path
;
var
model_back_url
=
SETTINGS
.
files
.
x3d_background
;
// multiple models in one scene test
...
...
@@ -218,9 +220,11 @@ function light_init(){
var
model
=
$
([
'<group>'
,
' <transform id=
\'
x3d_transform
\'
>'
,
' <inline name="x3d" namespacename="x3d" url="'
+
model_url
+
'"></inline>'
,
' </transform>'
,
' <switch whichChoice=
\'
0
\'
>'
,
' <transform id=
\'
x3d_transform
\'
class=
\'
inline_wrapper
\'
>'
,
' <inline name="x3d_'
+
model_name
+
'" namespacename="x3d_'
+
model_name
+
'" url="'
+
model_url
+
'"></inline>'
,
' </transform>'
,
' </switch>'
,
'</group>'
,
// multiple models in one scene test
//'<group>',
...
...
js/ui_menu.js
View file @
b825e1f0
...
...
@@ -106,6 +106,7 @@ function menu_init(){
work_with_kml_init
();
save_rating_init
();
editmode_init
();
// see extra_models.js
extra_models_init
();
manualposor_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, °</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
(){
if
(
!
SETTINGS
.
experimental
){
...
...
@@ -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
();
}
});
}
js/x3dom_functions.js
View file @
b825e1f0
...
...
@@ -149,7 +149,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
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
=
(
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
;
...
...
js/x3dom_init.js
View file @
b825e1f0
...
...
@@ -1284,7 +1284,7 @@ X3DOMObject.displayViewInfo = function(e){
' <th style=
\'
width:60px;
\'
>z</th>'
,
' <th>azimuth</th>'
,
' <th>elevation</th>'
,
' <th>
skew
</th>'
,
' <th>
roll
</th>'
,
'</tr>'
,
'<tr>'
,
' <td>mouse</td>'
,
...
...
viewer.html
View file @
b825e1f0
...
...
@@ -102,7 +102,7 @@ Instructions:
<div
id=
'window-error'
></div>
<div
id=
'window-viewinfo'
></div>
<div
id=
'window-markinfo'
></div>
<div
id=
'window-extrainfo'
></div>
<div
id=
'window-extrainfo'
tabindex=
'1'
></div>
<div
id=
'window-info'
></div>
</div>
<div
id=
'menu-content'
>
...
...
@@ -118,7 +118,7 @@ Instructions:
<td><input
id=
'markinfo'
type=
'checkbox'
class=
'my-check-box donothide'
/></td>
</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>
</tr>
<tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment