Update_A & Update_B

 

Update_A

Update_B

 

If they exist, the Update_A() and Update_B() function are called by sliceOmatic when the update flag contain one of the bits you have registered for with the Update_Register() function.

 

Update_A is called as soon as the changes are detected (one per loop).

 

Update_B will only be called when more immediate operations have been done (once all current redraw demand have been met). This is used to update non-essential part of the interface.  For example, the "Blow-up" tool register the flag "UPDATE_CURSOR" to know when the cursor is moved, but only re-draw the blow-up window in the "Update_B()" function.

 

Both function receive a 64 bit unsigned integer as argument.  This argument is the current value of the update flag.

 

 

Syntax

 

extern "C" __declspec(dllexport) int          Update_A(

          UInt64 flag

)

 

extern "C" __declspec(dllexport) int          Update_B(

          UInt64 flag

)

 

 

Parameters

 

flag

The current "Update Flag" value.  This is an "or" of all the updates that occurred since the last processing of the updates.

 

 

Return value

 

The function returns 0 if an error occurred, 1 otherwise.

 

 

Remarks

 

These function are optional.  If you do not have any updates to do, you can omit them.

 

There are 2 copies of the update flag, Each function receive its own copy. Once all registered "Update_A()" functions have been called, one copy is reset, once all registered "Update_B()" have been called, the second copy is reset.

 

Usually, this function will only re-direct the call to you local "Ctrl_Update()" function.  However if you use both "Update_A()" and "Update_B()" in the same module, you may need to look at the content of the "flag" argument to know which updates to skip in Update_A().

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

Example 1: We have registered for a few update signals, and we redirect the actual work to Crtl_Update().

 

// ----------------------------------------------------------------------------

//

//          Update_A

//

// ----------------------------------------------------------------------------

extern "C" __declspec(dllexport) int          Update_A( UInt64 flag )

{

          // --- The actual work is done un "Ctrl_Update()" ---

          Ctrl_Update( flag ) ;

 

          return( 1 ) ;

}

 

 

Example 2: We have registered for a few update signals. However, for one of these: "UPDATE_CURSOR", we only want to act when the program has some time for it.

 

// ----------------------------------------------------------------------------

//

//          Update_A

//

//          Called once per loop

//

// ----------------------------------------------------------------------------

extern "C" __declspec(dllexport) int          Update_A( UInt64 flag )

{

          // --- We skip UPDATE_CURSOR here since it will be catched by Upadte_B() ---

          if ( flag & UPDATE_CURSOR )

                    return( 1 ) ;

 

          ...

 

          return( 1 ) ;

}

 

// ----------------------------------------------------------------------------

//

//          Update_B

//

//          Called only when no pending redraw

//

// ----------------------------------------------------------------------------

extern "C" __declspec(dllexport) int          Update_B( UInt64 flag )

{

          // --- We only want UPDATE_CURSOR ---

          if ( ! (flag & UPDATE_CURSOR) )

                    return( 1 ) ;

 

          ...

 

          return( 1 ) ;

}

 

 

See also

 

Ctrl_Update