summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-19 09:15:29 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-19 09:15:29 (GMT)
commit8101d4c77c6babf125dbe8d4a40f1b2a72a70376 (patch)
tree44d0b8f4409eb7fd20118fe4c1b3799fb9496377 /apps
parent34a0e939c0e5b54e6de18b23d38e56ba327c5c24 (diff)
downloaduscxml-8101d4c77c6babf125dbe8d4a40f1b2a72a70376.zip
uscxml-8101d4c77c6babf125dbe8d4a40f1b2a72a70376.tar.gz
uscxml-8101d4c77c6babf125dbe8d4a40f1b2a72a70376.tar.bz2
Reset controls when setting the pose
Diffstat (limited to 'apps')
-rw-r--r--apps/samples/vrml/annotations.js6
-rw-r--r--apps/samples/vrml/viewer.js26
2 files changed, 24 insertions, 8 deletions
diff --git a/apps/samples/vrml/annotations.js b/apps/samples/vrml/annotations.js
index ca9bf0a..b91ccfa 100644
--- a/apps/samples/vrml/annotations.js
+++ b/apps/samples/vrml/annotations.js
@@ -34,13 +34,11 @@ function Annotations(element, params) {
var pose = dojo.clone(self.vrmlViewer.pose);
var imageURL = self.vrmlViewer.imageURL;
var annoLink = document.createElement("a");
- annoLink.setAttribute("href", "#");
var annoText = document.createTextNode(text + "\n");
+ annoLink.setAttribute("href", "#");
annoLink.appendChild(annoText);
annoLink.onclick = function() {
- self.vrmlViewer.pose = pose;
- self.vrmlViewer.imageURL = imageURL;
- self.vrmlViewer.updateScene();
+ self.vrmlViewer.setPose(imageURL, pose);
}
this.messagesElem.appendChild(annoLink);
}
diff --git a/apps/samples/vrml/viewer.js b/apps/samples/vrml/viewer.js
index 75b7b90..dedeb44 100644
--- a/apps/samples/vrml/viewer.js
+++ b/apps/samples/vrml/viewer.js
@@ -7,7 +7,8 @@ function VRMLViewer(element, params) {
if (!VRMLViewer.instances)
VRMLViewer.instances = 0;
var instanceId = VRMLViewer.instances++;
-
+ var batchChanges = false;
+
// public attributes
this.pose = {};
this.pose.pitch = 0;
@@ -325,7 +326,7 @@ function VRMLViewer(element, params) {
// privileged public methods
this.updateScene = function() {
- if (self.imageURL) {
+ if (self.imageURL && !self.batchChanges) {
self.imgElem.src = self.imageURL +
'?width=' + self.pose.width +
'&height=' + self.pose.height +
@@ -341,8 +342,8 @@ function VRMLViewer(element, params) {
}
this.refreshServer = function(server) {
- serverURL = server;
- self.localStorage.put("vrmlServer", serverURL, null);
+ self.serverURL = server;
+ self.localStorage.put("vrmlServer", self.serverURL, null);
self.xhr.get({
// The URL to request
url: server,
@@ -365,6 +366,23 @@ function VRMLViewer(element, params) {
});
}
+ this.setPose = function(imageURL, pose) {
+ self.imageURL = imageURL;
+ self.pose = pose;
+
+ self.batchChanges = true;
+// self.fileList.set('item', imageURL);
+ self.xSpinner.set('value',pose.x);
+ self.ySpinner.set('value',pose.y);
+ self.zSpinner.set('value',pose.z);
+ self.pitchSlide.attr('value',pose.pitch);
+ self.rollSlide.attr('value',pose.roll);
+ self.yawSlide.attr('value',pose.yaw);
+ self.zoomSlide.attr('value',pose.zoom);
+ self.batchChanges = false;
+ updateScene();
+ }
+
/*
view = "normal";
// if (params.view == "maximized") {