mgastner / cartogram-cpp

Cartogram generator in C++
MIT License
8 stars 4 forks source link

Too much control logic in main while loop #197

Open adisidev opened 5 hours ago

adisidev commented 5 hours ago

https://github.com/mgastner/cartogram-cpp/blob/99aed8f402d0e60f275e66ece181222f10980c47/src/main.cpp#L269-L396

adisidev commented 5 hours ago

We check for too much control logic in the main while loop. This makes main.cpp quite unreadable. Since the basic steps are the same, I believe we should shift all these changes to a larger function that redirects control appropriately.

For instance, before project, instead of checking at every step whether we use qtdt or triangulation or billinear_interpolation, we only call inset_state.project() and we put the control logic within inset_state.project().

adisidev commented 4 hours ago

This will also fix #189.