Changeset 5329 for nanovis/branches


Ignore:
Timestamp:
Apr 27, 2015, 7:50:15 PM (4 years ago)
Author:
ldelgass
Message:

merge r5328 from nanovis trunk

Location:
nanovis/branches/1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.2

  • nanovis/branches/1.2/Unirect.cpp

    r4904 r5329  
    521521        } else if (sscanf(line, "delta %lg %lg %lg", &ddx, &ddy, &ddz) == 3) {
    522522            /* Found one of the delta lines. */
     523            int count = 0;
    523524            if (ddx != 0.0) {
    524525                dx = ddx;
     526                count++;
    525527            } else if (ddy != 0.0) {
    526528                dy = ddy;
     529                count++;
    527530            } else if (ddz != 0.0) {
    528531                dz = ddz;
     532                count++;
     533            }
     534            if (count > 1) {
     535                ERROR("don't know how to handle multiple non-zero delta values");
     536                return false;
    529537            }
    530538        } else if (sscanf(line, "object %*d class array type %*s shape 3"
     
    554562        ERROR("inconsistent data: expected %d points"
    555563              " but found %d points", nx*ny*nz, npts);
     564        return false;
     565    }
     566    if (npts > 1 && ((dx == dy) && (dx == dz) && (dx == 0.0))) {
     567        ERROR("Missing or invalid deltas in DX file: %g %g %g", dx, dy, dz);
     568        return false;
     569    }
     570    if (dx < 0.0 || dy < 0.0 || dz < 0.0) {
     571        ERROR("Negative deltas not supported in DX file: %g %g %g", dx, dy, dz);
    556572        return false;
    557573    }
Note: See TracChangeset for help on using the changeset viewer.