Realsoft 3D
The top level object implementing Realsoft 3D. It consists of two sub objects: a model object (functionality) and a user interface object. Both of these have their own hierarchical sub structure. The two are attached through model-view concept. The class also loads plugin libraries, handles startup parameters and calls the registered startup callbacks right before passing the control to the user interface for running the event processing loop.
The startup callbacks can be used for adding plugin specific tools or other user interface objects into the loaded user interface.
To register a startup hook:
#include <real/widget/r3realsoft.h>
if(R3ClassFind(R3CLID_REALSOFT))
R3DoClassA(R3CLID_REALSOFT, R3RSCM_REGISTERSTARTUPHOOK, mystartuphook);
The startup hook takes one parameter: the main window object, through which you can access the user interface. For example, to add new new tool bar into the tabbed tool bar:
#include <real/widget/r3mainw.h>
static void mystartuphook(R3OBJ *mainwin) {
R3OBJ *tabbed;
R3OBJ *layerlist;
R3GetAttrs(mainwin,
R3T(R3MWIA_LayerList, &layerlist),
R3TAG_END);
if(tabbed = R3DoA(mainwin, R3WGM_FINDBYNAMEANYWHERE, "TabbedToolBar")) {
if(!(mytabwin = R3DoA(tabbed, R3GUITABM_FINDTAB, "My Tools"))) {
if(mytabwin = R3DoA(tabbed, R3GUITABM_ADDTAB, "My Tools")) {
...
}
For more information about the startup callbacks see the sample
plugin sdk/samples/plugins/geometrics/sphere.
To fetch the object:
rs = R3AppGetRoot(app);
To fetch the model and view objects:
#include <real/widget/r3realsoft.h>
R3OBJ *model, *view;
R3GetAttrs(rs,
R3T(R3RSA_Model, &model),
R3T(R3RSA_View, &view),
R3TAG_END);