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
fecea71f
Commit
fecea71f
authored
Jun 29, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'trailing_whitespaces'
# Conflicts: # js/x3dom_init.js
parents
8bc06769
d656f5dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
5 deletions
+32
-5
ui.css
js/ui.css
+1
-0
x3dom_init.js
js/x3dom_init.js
+31
-5
No files found.
js/ui.css
View file @
fecea71f
body
{
body
{
user-select
:
none
;
padding
:
0px
;
padding
:
0px
;
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
margin
:
0px
;
margin
:
0px
;
...
...
js/x3dom_init.js
View file @
fecea71f
...
@@ -711,6 +711,7 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -711,6 +711,7 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
marker
.
on
(
'mousedown'
,
function
(
e
){
marker
.
on
(
'mousedown'
,
function
(
e
){
var
self
=
this
;
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
...
@@ -727,6 +728,13 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
...
@@ -727,6 +728,13 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
Scene
.
element
.
addEventListener
(
'mousemove'
,
X3DOMObject
.
Marker
.
mouseMove
,
true
);
Scene
.
element
.
addEventListener
(
'mousemove'
,
X3DOMObject
.
Marker
.
mouseMove
,
true
);
Scene
.
element
.
addEventListener
(
'mouseup'
,
X3DOMObject
.
Marker
.
mouseUp
,
true
);
Scene
.
element
.
addEventListener
(
'mouseup'
,
X3DOMObject
.
Marker
.
mouseUp
,
true
);
// check for button released outside the window
$
(
window
).
on
(
'mouseover.drag_marker'
,
function
(
e
)
{
if
(
e
&&
e
.
buttons
===
0
&&
Scene
.
markerToDrag
)
{
X3DOMObject
.
Marker
.
mouseUp
.
apply
(
self
,[
event
]);
}
});
});
});
marker
.
on
(
'mouseup'
,
function
(
e
){
marker
.
on
(
'mouseup'
,
function
(
e
){
...
@@ -751,10 +759,12 @@ X3DOMObject.Marker.mouseUp = function(){
...
@@ -751,10 +759,12 @@ X3DOMObject.Marker.mouseUp = function(){
X3DOMObject.Marker.toggle(elem);
X3DOMObject.Marker.toggle(elem);
}
}
*/
*/
Scene
.
element
.
removeEventListener
(
'mouseup'
,
X3DOMObject
.
Marker
.
mouseUp
,
true
);
Scene
.
markerToDrag
=
null
;
Scene
.
element
.
removeEventListener
(
'mouseup'
,
X3DOMObject
.
Marker
.
mouseUp
,
true
);
Scene
.
element
.
removeEventListener
(
'mousemove'
,
X3DOMObject
.
Marker
.
mouseMove
,
true
);
Scene
.
element
.
removeEventListener
(
'mousemove'
,
X3DOMObject
.
Marker
.
mouseMove
,
true
);
$
(
window
).
off
(
'.drag_marker'
);
Scene
.
draggedTransformNode
=
null
;
Scene
.
draggedTransformNode
=
null
;
Scene
.
draggingUpVec
=
null
;
Scene
.
draggingUpVec
=
null
;
Scene
.
draggingRightVec
=
null
;
Scene
.
draggingRightVec
=
null
;
...
@@ -768,6 +778,8 @@ X3DOMObject.Marker.mouseUp = function(){
...
@@ -768,6 +778,8 @@ X3DOMObject.Marker.mouseUp = function(){
// from https://x3dom.org/x3dom/example/MovingObjectsWithDOMEvents.html
// from https://x3dom.org/x3dom/example/MovingObjectsWithDOMEvents.html
X3DOMObject
.
Marker
.
dragStart
=
function
(
elem
){
X3DOMObject
.
Marker
.
dragStart
=
function
(
elem
){
Scene
.
markerToDrag
=
elem
;
// move up from <shape> to <transform>
// move up from <shape> to <transform>
var
transformNode
=
$
(
elem
).
parent
();
var
transformNode
=
$
(
elem
).
parent
();
var
tr0
=
$
(
transformNode
).
attr
(
"translation"
);
var
tr0
=
$
(
transformNode
).
attr
(
"translation"
);
...
@@ -825,7 +837,9 @@ X3DOMObject.Marker.mouseMove = function(event){
...
@@ -825,7 +837,9 @@ X3DOMObject.Marker.mouseMove = function(event){
if
(
!
SETTINGS
.
slidingdrag
){
if
(
!
SETTINGS
.
slidingdrag
){
X3DOMObject
.
Marker
.
drag
(
event
.
offsetX
-
Scene
.
lastMouseX
,
event
.
offsetY
-
Scene
.
lastMouseY
);
X3DOMObject
.
Marker
.
drag
(
event
.
offsetX
-
Scene
.
lastMouseX
,
event
.
offsetY
-
Scene
.
lastMouseY
);
}
else
{
}
else
{
Scene
.
markerToDrag
.
isPickable
=
false
;
var
sr
=
Scene
.
element
.
runtime
.
shootRay
(
event
.
clientX
,
event
.
clientY
);
var
sr
=
Scene
.
element
.
runtime
.
shootRay
(
event
.
clientX
,
event
.
clientY
);
Scene
.
markerToDrag
.
isPickable
=
true
;
if
(
sr
.
pickObject
!=
null
){
if
(
sr
.
pickObject
!=
null
){
if
(
!
$
(
sr
.
pickObject
).
hasClass
(
"shapemarker"
)){
if
(
!
$
(
sr
.
pickObject
).
hasClass
(
"shapemarker"
)){
var
sphere
=
Scene
.
draggedTransformNode
.
parent
().
parent
();
var
sphere
=
Scene
.
draggedTransformNode
.
parent
().
parent
();
...
@@ -938,6 +952,7 @@ X3DOMObject.PointerMarker.prototype._init = function(){
...
@@ -938,6 +952,7 @@ X3DOMObject.PointerMarker.prototype._init = function(){
this
.
_elem
=
Scene
.
createMarker
(
0
,
0
,
0
,
"sliding_sphere"
);
this
.
_elem
=
Scene
.
createMarker
(
0
,
0
,
0
,
"sliding_sphere"
);
this
.
_shape
=
this
.
_elem
.
find
(
"shape"
);
this
.
_shape
=
this
.
_elem
.
find
(
"shape"
);
this
.
_shape
.
attr
(
'isPickable'
,
false
);
this
.
_registerEvents
();
this
.
_registerEvents
();
this
.
_elem
.
find
(
"switch"
).
attr
(
"whichChoice"
,
-
1
);
this
.
_elem
.
find
(
"switch"
).
attr
(
"whichChoice"
,
-
1
);
...
@@ -949,8 +964,19 @@ X3DOMObject.PointerMarker.prototype._registerEvents = function(){
...
@@ -949,8 +964,19 @@ X3DOMObject.PointerMarker.prototype._registerEvents = function(){
var
self
=
this
;
var
self
=
this
;
var
Camera
=
Map
.
marker
;
var
Camera
=
Map
.
marker
;
self
.
_shape
.
on
(
"click"
,
function
(
e
){
// PointerMarker MouseEvent are not triggered when isPickable is false
$
(
window
).
on
(
'mousedown'
,
function
(
e
){
self
.
_shape
.
attr
(
'isPickable'
,
true
);
});
$
(
window
).
on
(
'mouseup'
,
function
(){
self
.
_shape
.
attr
(
'isPickable'
,
false
);
});
// window mousedown above is run after x3dom mousedown handler
// so we must listen to x3dom 'mouseup' instead of 'click' below
self
.
_shape
.
on
(
"mouseup"
,
function
(
e
){
X3DOMObject
.
Marker
.
dehighlight
(
self
.
_elem
);
X3DOMObject
.
Marker
.
dehighlight
(
self
.
_elem
);
var
xyz
=
$
(
this
).
parent
().
attr
(
"translation"
);
var
xyz
=
$
(
this
).
parent
().
attr
(
"translation"
);
...
@@ -1291,5 +1317,5 @@ X3DOMObject.displayMarkInfo = function(index){
...
@@ -1291,5 +1317,5 @@ X3DOMObject.displayMarkInfo = function(index){
}
else
{
}
else
{
ui_showMessage
(
"window-markinfo"
,
msg
);
ui_showMessage
(
"window-markinfo"
,
msg
);
}
}
}
}
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