Changeset 20585


Ignore:
Timestamp:
04/30/16 18:46:15 (9 years ago)
Author:
dlcheng
Message:

CHG (javascript): Fixing plot_unit transient data not displaying. Adding support for edgecolor for mesh and quiver plots.

Location:
issm/trunk-jpl/src/m/plot
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/plot_mesh.js

    r20584 r20585  
    6464        node["drawMode"] = gl.LINES;
    6565        node["drawOrder"] = 0;
    66         node["maskEnabled"] = options.exist('mask');
    67         node["maskHeight"] = options.getfieldvalue('maskheight',150.0)*options.getfieldvalue('heightscale',1);
    68         node["maskColor"] = options.getfieldvalue('maskcolor',[0.0,0.0,1.0,1.0]);
     66        node["maskEnabled"] = options.getfieldvalue('innermask','off') == 'on';
     67        node["maskHeight"] = options.getfieldvalue('innermaskheight',150.0)*options.getfieldvalue('heightscale',1);
     68        node["maskColor"] = options.getfieldvalue('innermaskcolor',[0.0,0.0,1.0,1.0]);
    6969                               
    7070        //some defaults:
     
    7373        //retrieve some options
    7474        var linewidth=options.getfieldvalue('linewidth',1);
    75         var edgecolor=options.getfieldvalue('edgecolor','black');
     75        var edgecolor=new RGBColor(options.getfieldvalue('edgecolor','black'));
     76        if (edgecolor.ok) edgecolor = [edgecolor.r/255.0, edgecolor.g/255.0, edgecolor.b/255.0, 1.0];
     77        else throw Error(sprintf("s%s%s\n","initWebGL error message: cound not find out edgecolor color for curent canvas ",canvas));
    7678
    7779        //node plot {{{
     
    8688                var vertex = vec3.create();
    8789                var magnitude;
    88                 var color = [0.0, 0.0, 0.0, 1.0];       
     90                var color = edgecolor;
    8991                for(var i = 0; i < x.length; i++){
    9092                        //Check for NaN values and remove from indices array as necessary, but preserve vertex array spacing
  • issm/trunk-jpl/src/m/plot/plot_quiver.js

    r20584 r20585  
    6868        node["useIndexBuffer"] = false;
    6969        node["drawOrder"] = 0;
    70         node["maskEnabled"] = options.exist('mask');
    71         node["maskHeight"] = options.getfieldvalue('maskheight',150.0)*options.getfieldvalue('heightscale',1);
    72         node["maskColor"] = options.getfieldvalue('maskcolor',[0.0,0.0,1.0,1.0]);
     70        node["maskEnabled"] = options.getfieldvalue('innermask','off') == 'on';
     71        node["maskHeight"] = options.getfieldvalue('innermaskheight',150.0)*options.getfieldvalue('heightscale',1);
     72        node["maskColor"] = options.getfieldvalue('innermaskcolor',[0.0,0.0,1.0,1.0]);
    7373                               
    7474        //some defaults:
     
    7777        //retrieve some options
    7878        var linewidth=options.getfieldvalue('linewidth',1);
    79         var edgecolor=options.getfieldvalue('edgecolor',[0.0,0.0,0.0,1.0]); //have RGBColor switch with array color?
    80         //var edgecolor=options.getfieldvalue('edgecolor','black'); //have RGBColor switch with array color?
     79       
     80        var edgecolor=new RGBColor(options.getfieldvalue('edgecolor','black'));
     81        if (edgecolor.ok) edgecolor = [edgecolor.r/255.0, edgecolor.g/255.0, edgecolor.b/255.0, 1.0];
     82        else throw Error(sprintf("s%s%s\n","initWebGL error message: cound not find out edgecolor color for curent canvas ",canvas));
    8183
    8284        //node plot {{{
     
    105107                       
    106108                        xyz2 = vec3.fromValues(vx[i], vy[i], 0.0);
    107                         magnitude = 100000.0; //mesh resolution
     109                        magnitude = 1000.0; //mesh resolution
    108110                        vec3.normalize(direction, xyz2);
    109111                        vec3.scale(direction, direction, magnitude);
  • issm/trunk-jpl/src/m/plot/plot_unit.js

    r20584 r20585  
    175175                                for(var i = 0; i < x.length; i++){
    176176                                        //Check for NaN values and remove from indices array as necessary, but preserve vertex array spacing
    177                                         if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) || isNaN(data[i])) {
     177                                        if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) || isNaN(data[i][0])) {
    178178                                                nanindices[i] = i;
    179179                                                vertices[vertices.length] = vertex[0];
  • issm/trunk-jpl/src/m/plot/webgl.js

    r20584 r20585  
    498498        var gl = canvas.gl;
    499499        var backgroundcolor = new RGBColor(options.getfieldvalue('backgroundcolor','lightcyan'));
    500         if(backgroundcolor.ok){
    501                 gl.clearColor(backgroundcolor.r/255.0, backgroundcolor.g/255.0, backgroundcolor.b/255.0, 1.0);
    502         }
     500        if (backgroundcolor.ok) gl.clearColor(backgroundcolor.r/255.0, backgroundcolor.g/255.0, backgroundcolor.b/255.0, 1.0);
    503501        else throw Error(sprintf("s%s%s\n","initWebGL error message: cound not find out background color for curent canvas ",canvas));
    504502               
Note: See TracChangeset for help on using the changeset viewer.