Skip to content

Toolkit Architecture

Jonathan Lin edited this page Feb 24, 2021 · 2 revisions

RBDL-Toolkit Archiecture

I will describe the architecture of the rbdl-toolkit so that other developers have a place to look for information.

Toolkit Main Application

RBDL-Toolkit is a Qt application, with the main class being the ToolkitApp. It is responsible for setting up the base ui and rendering window, as well as loading the models and setting up the plugins. And it provides the plugins with all the hooks they need to interact with the environment via its public functions. It also provides signal and slots so that other QObjects can react to different types of events.

class ToolkitApp : public QMainWindow
{
Q_OBJECT
private:
	...
public:
    ToolkitSettings toolkit_settings;

    ToolkitApp(QWidget *parent = 0);
    std::vector<RBDLModelWrapper*>* getLoadedModels();

    RBDLModelWrapper* selectModel(ModelFilter filter);

    void addView(QString name, QWidget *view_widget, Qt::DockWidgetArea area=Qt::RightDockWidgetArea, bool show_tilte = true);
    void deleteView(QString name);

    void addFileAction(QAction* file_action);

    QMenu* getMenu(std::string menu_name);
    void deleteMenu(QMenu* menu);

    void addCmdOption(QCommandLineOption &option, std::function<void(QCommandLineParser&)>);
    void parseCmd(QApplication& app);

    void showWarningDialog(QString warning_msg);

    static void showExceptionDialog(std::exception& e);

    ToolkitTimeline* getToolkitTimeline() { return timeline; }
    SceneWidget* getSceneObj() { return main_display; }

public slots:
    void action_reload_files();
    void action_load_model();

    void model_visual_update(Qt3DCore::QEntity* visual);

    void loadModel(const QString &model_file); 

signals:
    void reload();
    void reloaded_model(RBDLModelWrapper* model);
    void model_loaded(RBDLModelWrapper* model);

};
Clone this wiki locally