Tebtative terrain grading key ------------------------------- Functionality: total 70 ------------------------------- 1. Grid constructor: total 20 the constructor should take open the file, read it, and initialize correctly the grid with nrows, ncols, NODATA value and data values. the file name should be argument to the constructor, not hardcoded. 2. printGrid 5 points 3. printInfo 5 points 4. Grid render: total 30 There should be a separate function to render (if not, take out points for lack of style, see below). a. the window size should be set so that it has the same aspect ratio as the grid. the image should not look distorted when rendered. aa. test kaweah.asc, and check whether the window is larger than the screen. it should not be (that is, the window shoudl be set so it fits on screen). b. the grid should scale down to the image size, in case that the grid is larger than the image. test this with set1.asc, brunsdem.asc, kaweah.asc. c. the grid should scale up to the image size, in case the grid is smaller than the image. test this by loading and rendering test1.asc and/or test2.asc. you should see the points clearly spread out overt the window. d. the rendering should not be inverted. that is (i,j) should be rendered as (x=j, y=i) and not the other way around. 2 points. e. gray scale. f. buckets g. gradient the hard part is giving credit when the code does not fully work (gives an errors). check the code and see how much it accomplishes. 5. GridGIS: total 10 At the very least, there should be a text interface as specified in the lab, where you can do something like: Grid elev = new Grid("set1.asc"); elev.printInfo(); elev.render(); Give extra points of people have done a GUI (like selecting the name of a file, and so on). ---------------------------------- Style: total 30 ---------------------------------- rendering the grid should be a separate function, as stated in the lab. if they wrote the rendering code as part of the constructor, not good. it may be called from the constructor, but it should still be a separate function. i would like to see that the render code is clean. that is, there shoudl be a loop like this: for i for j x = map j to window coordinates y = map i to window coordinates Color = computeColor(grid[i][j]); setColor(Color). drawLine(x, y, x,y); in other words, the computation of the color should be separate, and outside the render function, encapsulated in a separate function. GridGIS should provide easy support to testing. comments for what each function does, headers, etc, in general easy readability of the code.