Changeset 19771
- Timestamp:
- 11/20/15 12:05:30 (9 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/plot_manager.js
r19760 r19771 16 16 //standard plot: initialize open Gl for each canvas: 17 17 var canvas=document.getElementById(options.getfieldvalue('canvasid')); 18 //$.("<canvas id='"+options.getfieldvalue('canvasid')+"' width=640 height=480></canvas>)").append("body"); 18 19 19 20 // Initialize the GL context: … … 87 88 case 'mesh': 88 89 //plot_mesh(md,options,nlines,ncols,i); 89 plot_mesh(md .mesh.x,md.mesh.y,[0.0],md.mesh.elements,2,options,canvas,gl);90 plot_mesh(md,options,canvas,gl); 90 91 break; 91 92 case 'none': … … 209 210 210 211 if (typeof data !== 'string'){ 211 //process data and model212 var meshresults = processmesh(md,data,options);213 var x = meshresults[0];214 var y = meshresults[1];215 var z = meshresults[2];216 var elements = meshresults[3];217 var is2d = meshresults[4];218 var isplanet = meshresults[5];219 220 var dataresults = processdata(md,data,options);221 var data2 = dataresults[0];222 var datatype = dataresults[1];223 224 212 //plot unit 225 plot_unit( x,y,z,elements,data2,is2d,isplanet,datatype,options,canvas,gl);213 plot_unit(md,data,options,canvas,gl); 226 214 } 227 215 -
issm/trunk-jpl/src/m/plot/plot_mesh.js
r19760 r19771 1 function plot_mesh( x,y,z,elements,datatype,options,canvas,gl) {1 function plot_mesh(md,options,canvas,gl) { 2 2 // Usage: 3 // plot_mesh(md,options, nlines,ncols,i);3 // plot_mesh(md,options,canvas,gl); 4 4 // 5 5 // See also: PLOTMODEL … … 15 15 var zmin,zmax; 16 16 var scale; 17 //Process data and model 18 var x = md.x; 19 var y = md.y; 20 var z = [0.0]; 21 var elements = md.elements; 17 22 //}}} 18 23 -
issm/trunk-jpl/src/m/plot/plot_unit.js
r19763 r19771 1 function plot_unit( x,y,z,elements,data,is2d,isplanet,datatype,options,canvas,gl) {1 function plot_unit(md,data,options,canvas,gl) { 2 2 //PLOT_UNIT - unit plot, display data 3 3 // 4 4 // Usage: 5 // plot_unit( x,y,z,elements,data,is2d,isplanet,datatype,options);5 // plot_unit(md,data,options,canvas,gl); 6 6 // 7 7 // See also: PLOTMODEL, PLOT_MANAGER … … 18 18 var datamin,datamax; 19 19 var scale; 20 //Process data and model 21 var meshresults = processmesh(md,data,options); 22 var x = meshresults[0]; 23 var y = meshresults[1]; 24 var z = meshresults[2]; 25 var elements = meshresults[3]; 26 var is2d = meshresults[4]; 27 var isplanet = meshresults[5]; 28 29 var dataresults = processdata(md,data,options); 30 var data2 = dataresults[0]; 31 var datatype = dataresults[1]; 20 32 //}}} 21 33 22 34 //Initialize the buffer structure: 23 35 node = Node(gl,options); 36 24 37 25 38 //Compute coordinates and data range: -
issm/trunk-jpl/src/m/plot/webgl.js
r19745 r19771 41 41 canvas.addEventListener("DOMMouseScroll", function (e) {MouseWheelHandler(e,canvas)}, false); 42 42 // Mobile 43 //canvas.addEventListener("gesturechange", MousePinchHandler, false);43 canvas.addEventListener("gesturechange", MouseWheelHandler, false); 44 44 } 45 45 … … 233 233 // prevent scrolling when over canvas 234 234 e.preventDefault(); 235 var delta = 1/10 * clamp((e.wheelDelta || -e.detail), -1, 1); 235 var e = window.event || e; // old IE support 236 var delta = 1/10 * clamp((e.scale || e.wheelDelta || -e.detail), -1, 1); 236 237 canvas.zoomFactor = canvas.zoomFactor + -delta * canvas.zoomFactor; 237 238 } //}}}
Note:
See TracChangeset
for help on using the changeset viewer.