Browse Source

Quality of zoomed part related to setted quality

Aleksandr Lizin 9 years ago
parent
commit
83259dedc7

+ 3 - 0
static/js/threeJsHelper/dist/threeJsHelper.js

@@ -2046,6 +2046,8 @@ function isBottomFace(orientation, direction) {
     });
 
     function getSubvolume(realPoint, alreadyTranslated, zoomAction, sameDepth, fromDraggable) {
+        var requestedRes = typeof(window.requestedSize)=="undefined" ? config.defaultSize : requestedSize;
+
         if(alreadyTranslated == undefined || !alreadyTranslated) {
             realPoint = realPoint.applyMatrix4((new THREE.Matrix4).makeRotationX(Math.PI / -2));
             // retranslate the point into original position beginning from 0,0,0
@@ -2124,6 +2126,7 @@ function isBottomFace(orientation, direction) {
         }
 
         processingUrl += depth + '/';
+        processingUrl += requestedRes + '/';
 
         $.ajax({
             url: processingUrl,

File diff suppressed because it is too large
+ 1 - 1
static/js/threeJsHelper/dist/threeJsHelper.min.js


+ 3 - 0
static/js/threeJsHelper/src/Helpers/Zoom/ZoomHelper.js

@@ -85,6 +85,8 @@ var ZoomHelper = function() {
     });
 
     function getSubvolume(realPoint, alreadyTranslated, zoomAction, sameDepth, fromDraggable) {
+        var requestedRes = typeof(window.requestedSize)=="undefined" ? config.defaultSize : requestedSize;
+
         if(alreadyTranslated == undefined || !alreadyTranslated) {
             realPoint = realPoint.applyMatrix4((new THREE.Matrix4).makeRotationX(Math.PI / -2));
             // retranslate the point into original position beginning from 0,0,0
@@ -163,6 +165,7 @@ var ZoomHelper = function() {
         }
 
         processingUrl += depth + '/';
+        processingUrl += requestedRes + '/';
 
         $.ajax({
             url: processingUrl,

+ 2 - 2
volumes/processing/urls.py

@@ -7,8 +7,8 @@ from . import views
 urlpatterns = patterns(
     '',
     url(r'^generate-slice/$', views.generateslice, name='gen-slice'),
-    url(r'^sub/(?P<x>[\d]+)/(?P<y>[\d]+)/(?P<z>[\d]+)/(?P<t>[\d]+)/(?P<depth>[\d]+)/$', views.getSubvolume),
-    url(r'^sub/(?P<x>[\d]+)/(?P<y>[\d]+)/(?P<z>[\d]+)/(?P<t>[\d]+)/(?P<depth>[\d]+)/(?P<testId>[\da-z]+)/$', views.getSubvolume),
+    url(r'^sub/(?P<x>[\d]+)/(?P<y>[\d]+)/(?P<z>[\d]+)/(?P<t>[\d]+)/(?P<depth>[\d]+)/(?P<requestedRes>[\d]+)/$', views.getSubvolume),
+    url(r'^sub/(?P<x>[\d]+)/(?P<y>[\d]+)/(?P<z>[\d]+)/(?P<t>[\d]+)/(?P<depth>[\d]+)/(?P<requestedRes>[\d]+)/(?P<testId>[\da-z]+)/$', views.getSubvolume),
     url(r'^sprite/(?P<spriteId>[a-z\d]+)/show/$', views.getSubvolumeSprite),
     url(r'^sprite/(?P<spriteId>[a-z\d]+)/available/$', views.subvolumeAvailable),
     url(r'^sub/list/$', views.listfiles),

+ 6 - 4
volumes/processing/views.py

@@ -52,7 +52,7 @@ def generateslice(request, id):
     return HttpResponseRedirect(reverse('volumes:show', args=(id,)))
 
 
-def getSubvolume(request, id, x, y, z, t, depth, testId=None):
+def getSubvolume(request, id, x, y, z, t, depth, requestedRes, testId=None):
     starttime = time.time()
     try:
         volume = Volume.objects(id=id)[0]
@@ -168,9 +168,11 @@ def getSubvolume(request, id, x, y, z, t, depth, testId=None):
     creatorThread.start()
     '''
 
-    requestedRes = int(request.session.get('requestedRes', 2048))
-    if requestedRes is None or requestedRes < 2048:
-        requestedRes = 2048
+    # requestedRes = int(request.session.get('requestedRes', 2048))
+    # if requestedRes is None or requestedRes < 2048:
+    #     requestedRes = 2048
+
+    requestedRes = int(requestedRes)
 
     creatorProcess = Process(
         target=SubvolumeCreator.subvolumeCreator,

Some files were not shown because too many files changed in this diff