The data structure has a number of "callback" anchor points where you can hook your own function. These are mostly use to draw portion of the classes, but there is also a few callbacks to change the values of the pixels of the images, and return the metrics of the images.
Some callbacks are single function pointers. Assigning your own function to these pointers will remove the default value.
Others are array of functions. For those, you must first obtain an ID so that you can assign your function to the appropriate slot in the array. To obtain this ID, you must define one of the following function in your module, if it exist, sliceOmatic will call the your function with your ID as parameter. This ID is unique and will not conflict with the callbacks from other modules.
The functions that provide callback IDs is:
The callback functions themselves are presented here and also, in the section describing the class where they are found.
Callbacks present in the "Class" class"
|
|
Some callbacks are specific to the "Frame" class
|
|
And finally we also have callbacks to redraw the geometries
|
|
Example
For example, we want to draw a 10x10 pixel red square around the center of each frames:
First, we need a callback ID for a "Fct_Draw_OpenGL()" callback:
|
|
Next we need our drawing function:
|
|
Next, we need a way to assign our function to the callback, and a way to remove it:
|
|
And finally we call these "Register" and "Reset" function when our module is activated, in this example we chose to enable the callback as soon as our module is activate (either as a tool or a mode):
|
|
Note:
|
|