Home > Getting Started Guide > Installation and Integration
Interrupting ACIS Operations
Installing an interrupt checker with the set_acis_interrupt_checker function allows the application to gracefully interrupt the current ACIS operations and regain control of the process. This is a useful feature when applications want to be responsive to end-user input, such as responding to Ctrl+C input during lengthy operations. This function allows user to install a callback function that is frequently called from various places within ACIS code so that application side events can be evaluated. The callback function receives an informative string, which describes the current function in ACIS. Based on the user request, the callback function can do one of the following:
- call the interrupt_acis function, which will interrupt the process in a synchronous manner (preferred)
- call the sys_error function with the SIGINT_FAULT argument, which will interrupt the operation asynchronously (immediately)
- application can simply return from the callback, which allows the operation to continue
This section contains snippets of C++ code to illustrate how to interrupt ACIS operations by defining and installing a callback function. These snippets are designed to be very simple starting points for developing your own code - they are not complete, compiling and runtime programs.
Sample Code
// define the callback function
void acis_interrupt_checker( const char* func_name )
{
if( end_user_requests_interrupt() )
{
printf("Synchronous user interrupt requested during %s\n", func_name);
// interrupt the current operation at the next good location
interrupt_acis();
}
else if( end_user_requests_immediate_interrupt() )
{
printf("Asynchronous user interrupt requested during %s\n", func_name);
// interrupt the current operation immediately
sys_error(SIGINT_FAULT);
}
// else do nothing and continue the process
return;
}
// install the callback function
set_acis_interrupt_checker( acis_interrupt_checker );[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.