When sliceOmatic re-draw the content of a window, either a 2D or a 3D window, it does this in a number of steps.
Your module can ask to be called-in to participate in any of these steps. For this, you must first register your module, with the "Draw_Register" function, specifying at which step(s) you want to be called using a 64 bit flag. The program will then call your "Draw" function for each of the desired step. A complete list of these flags can be found in the file "flag_redraw.hpp".
If your module define a Mode, then you can also specify the shape of the cursor that will be used by the program while the cursor is in a window where your module is active.
Note:
SliceOmatic already provide the basic Draw functions for the GLI and TAG data, you only need to provide your own Draw() function if you want to add something to the image windows.
For example, the "Edit" mode does not provide any Draw() functions. When it modify the TAG values, it just has to tell sliceOmatic to redraw a portion of the screen and sliceOmatic will do it in the next redraw.
However, the "Point" tool add points to the frames, so that tool need to have a mechanism to draw these points. The points are visible in both 2D and 3D windows. In 2D the points are draw in the OpenGL drawing step, so we will have to register to be called back at "REDRAW_DLL_OPENGL". in 3D we want to draw the points just before the geometries, once the Lights and transformation Matrices are fixed, so we register with "REDRAW_3D_PRE".
Please note that there is also another mechanism to draw to the image windows. During the drawing steps, sliceOmatic will call all registered Draw() functions, but it will also go through the database of structures and call all the redraw callback functions. So if you need to draw something that is associated with one of the structures you might want to use a callback instead.
For example, the "Morpho" mode add water-parting lines to the frames. You could use the Draw_Register()/Draw() functions to draw these lines, but in your Draw() function you would need to go through the database and draw the lines for each frames that are visible. You are better to add a callback to the frames and let sliceOmatic know that it need to redraw the frames.
More information on the callbacks can be found here.
Program flow
A simplified flow chart of the 2D Drawing can be found here:
A simplified flow chart of the 3D Drawing can be found here: