Skip to content

Commit bd3d7d8

Browse files
committed
fix: added back world coordinates
1 parent e83a533 commit bd3d7d8

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

imports/ui/qc.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ var logpoint = function(e, template, type){
246246
//console.log("pushed contours", contours)
247247
}
248248

249-
249+
var world = new papaya.core.Coordinate();
250+
papayaContainers[0].viewer.getWorldCoordinateAtIndex(originalCoord.x, originalCoord.y, originalCoord.z, world);
250251
var selectContour = getSelectedDrawing(template)//contours[contours.length-1].contours //OR: selected contour
251252
//console.log("selectContours is", selectContour)
252253
if (selectContour.length == 0){
@@ -260,6 +261,7 @@ var logpoint = function(e, template, type){
260261
selectContour.push({complete: false, matrix_coor:[], world_coor:[]})
261262
currentContour = selectContour[selectContour.length-1]
262263
currentContour.matrix_coor.push(originalCoord)
264+
currentContour.world_coor.push(world)
263265
}
264266
template.contours.set(contours)
265267
Session.set("isDrawing", true)
@@ -272,7 +274,8 @@ var logpoint = function(e, template, type){
272274

273275
//papayaContainers[0].viewer.cursorPosition isn't updated on mousedrag
274276
var originalCoord = papayaContainers[0].viewer.convertScreenToImageCoordinate(screenCoor.x, screenCoor.y, viewer.mainImage);
275-
277+
var world = new papaya.core.Coordinate();
278+
papayaContainers[0].viewer.getWorldCoordinateAtIndex(originalCoord.x, originalCoord.y, originalCoord.z, world);
276279
var contours = template.contours.get()
277280

278281
if (contours.length){
@@ -284,7 +287,7 @@ var logpoint = function(e, template, type){
284287
if (currentContour.complete==false){
285288

286289
currentContour.matrix_coor.push(originalCoord)
287-
//currentContour.world_coor.push(world)
290+
currentContour.world_coor.push(world)
288291
template.contours.set(contours)
289292
Session.set("isDrawing", true)
290293

@@ -624,15 +627,16 @@ Template.view_images.helpers({
624627
var images = Session.get("loadableImages")
625628
var to_display = []
626629
var output = []
627-
628-
images.forEach(function(val, idx, arr){
629-
var last = val.split("/").pop()
630-
var tmp = {}
631-
tmp["absolute_path"] = images[idx]
632-
tmp["name"] = last
633-
to_display.push(tmp)
634-
})
635-
return to_display
630+
if (images){
631+
images.forEach(function(val, idx, arr){
632+
var last = val.split("/").pop()
633+
var tmp = {}
634+
tmp["absolute_path"] = images[idx]
635+
tmp["name"] = last
636+
to_display.push(tmp)
637+
})
638+
return to_display
639+
}
636640
}
637641

638642

0 commit comments

Comments
 (0)