Draw_Register

 

The "Draw_Register()" function is called at the start of the program.  If you want your module to participate in the drawing of the images in either 2D or 3D windows, you may want to register your module with the drawing process.

 

 

Syntax

 

extern "C" __declspec(dllexport)  UInt64  Draw_Register(

          void

)

 

 

Parameters

 

This function does not have a parameter.

 

 

Return value

 

The function return an "or" of all the bits for the drawing steps you which to be called back.  A complete list of these flags can be found in the file "flag_redraw.hpp".

 

 

Remarks

 

You will notice that each step in the drawing process is allocated 3 bits. By default, all sliceOmatic default drawing are done on the middle bit, this enable you to be called back just before, at the same time or just after sliceOmatic's default drawing functions.

 

For example, if you register with (REDRAW_3D_PRE<<1)you will be called just before any sliceOmatic REDRAW_3D_PRE steps, with (REDRAW_3D_PRE>>1) you will be called just after.

 

If on the, other hand, you have affected a region of the screen and you want that region (or a complete image) to be redrawn, you should notify sliceOmatic of these changes.  To do this, you use the "Fct_Redraw()" function.

 

Example: In the "Edit" mode, after "painting" a region with a brush, we need to tell sliceOmatic that the TAG values have changed and that the image in the painted region need to be updated

 

...

 

// --- Tell sliceO that the TAG image for "frame" has changed ---

Fct_Update( UPDATE_DISPLAY_TAG, CLASS_MODE_ALL, frame, &region ) ;

// --- we will need a redraw of this portion of the frame for all windows ---

Fct_Redraw( REDRAW_DB_OPENGL, CLASS_MODE_ALL, frame, &region ) ;

 

...

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

...

 

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

//

//          Function:          Draw_Register

//

//          Parameters:          (void)

//          Returns:          (unsigned int)                    drawing level flag

//

//          This function is used to register your "drawing" needs.  When the

//          program execute a redraw of the main window, it goes through 32 steps.

//          You register to which of these steps you want your own "Draw" function

//          to be called.

//

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

extern "C" __declspec(dllexport) UInt64          Draw_Register( void )

{

          return( REDRAW_DLL_OPENGL | REDRAW_3D_PRE ) ;

}

 

...

 

See also