This project is the first project of SJTU 2023 Fall Course CS2309 Problem Solving and Practice.
fltk-version >= 1.3.4
Linux is recommended
-
run cmd
make map
under the root directory to compile the project. -
execute the program by
./main [option1] [option2]
, where[option1]
is the file name of the image under./assets
without the format suffix while[option2]
is the format suffix of that image file. For example, enter./main testcase1 png
to run the program with the image./assets/testcase1.png
.
First, you need to set the scale of the map,
-
Caribrate the scale of the map by placing two cursor at two ends of the scale segment bottom left corner and enter the real distance it represents.
-
Enter the pixel length and real distance manually if you have known the scale of this map image.
Confirm by clicking the "Confirm" button after you set the scale in either way.
Then, click points on the map image to select vertices of the polygon to draw and compute the area. You can click "Uodo" button to undo the click of last point.
If you confirm the choices with less than 3 points or leaving edges intersected with each other, the program reject the confirm and prompt the exception.
After you confirm with valid polygon, you can cancel your choice by button and do points selection again.