|
I am using alpha_wrap_3 in a semi interactive way. I have it running in its own thread, but give the user the ability to cancel the processing if its taking too long or they change their mind about the params or the call itself. What is the preferred way to do this, since i would rather have this stop gracefully and not have to kill the thread/process. Is there even a way? |
Replies: 3 comments 1 reply
|
Hi Stoyan, |
|
You can also have a look at https://github.com/CGAL/cgal/blob/main/Alpha_wrap_3/examples/Alpha_wrap_3/pause_and_resume_wrapping.cpp. Note that when you're interested in interrupting the wrapper, you should define the macro |
|
I think for my use case i am ok with not having usable results if i have to cancel as i am more worried about wasted compute/time as the user has already decided they don't want the result anyway. |
You can also have a look at https://github.com/CGAL/cgal/blob/main/Alpha_wrap_3/examples/Alpha_wrap_3/pause_and_resume_wrapping.cpp.
Note that when you're interested in interrupting the wrapper, you should define the macro
CGAL_AW3_USE_SORTED_PRIORITY_QUEUE, to use a queue that is sorted by facet size rather than a LIFO queue by default. The latter is faster, but then the wrapper carves deep rather than wide and an interrupted wrap with this strategy will likely not be very useful.