comparison libinterp/corefcn/gl-render.cc @ 17558:e48a22b94727

Don't plot NaN values in cdata (bug #40114). * libinterp/corefcn/gl-render.cc(draw_surface): Check colordata for NaNs in addition to x,y,z data and set clip() matrix appropriately.
author Rik <rik@octave.org>
date Thu, 03 Oct 2013 16:42:42 -0700
parents 5b088598df1d
children c3aadd228c37
comparison
equal deleted inserted replaced
17557:58039875767d 17558:e48a22b94727
1598 bool x_mat = (x.rows () == z.rows ()); 1598 bool x_mat = (x.rows () == z.rows ());
1599 bool y_mat = (y.columns () == z.columns ()); 1599 bool y_mat = (y.columns () == z.columns ());
1600 1600
1601 i1 = i2 = j1 = j2 = 0; 1601 i1 = i2 = j1 = j2 = 0;
1602 1602
1603 if ((fc_mode > 0 && fc_mode < 3) || ec_mode > 0)
1604 c = props.get_color_data ().array_value ();
1605
1603 boolMatrix clip (z.dims (), false); 1606 boolMatrix clip (z.dims (), false);
1604 1607
1605 for (int i = 0; i < zr; i++) 1608 for (int i = 0; i < zr; i++)
1606 { 1609 {
1607 if (x_mat) 1610 if (x_mat)
1611 { 1614 {
1612 if (y_mat) 1615 if (y_mat)
1613 j1 = j; 1616 j1 = j;
1614 1617
1615 clip(i,j) = is_nan_or_inf (x(i1,j), y(i,j1), z(i,j)); 1618 clip(i,j) = is_nan_or_inf (x(i1,j), y(i,j1), z(i,j));
1616 } 1619 if (fc_mode == 1 || fc_mode == 2)
1617 } 1620 clip(i,j) |= (xisnan (c(i,j)) || xisinf (c(i,j)));
1618 1621 }
1619 if ((fc_mode > 0 && fc_mode < 3) || ec_mode > 0) 1622 }
1620 c = props.get_color_data ().array_value ();
1621 1623
1622 if (fa_mode > 0 || ea_mode > 0) 1624 if (fa_mode > 0 || ea_mode > 0)
1623 { 1625 {
1624 // FIXME: implement alphadata conversion 1626 // FIXME: implement alphadata conversion
1625 //a = props.get_alpha_data (); 1627 //a = props.get_alpha_data ();