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:

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]