Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
CamiTKExtensionModelPresenter Class Reference

Presenter for a CamiTK extension file model. More...

#include <CamiTKExtensionModelPresenter.h>

Public Slots

void modelUpdated ()
 called when the model has changed, the GUI/JSON is to be updated
void plusButtonClicked ()
 called when the user clicks on the "+" button to add an action tab
void tabCloseRequest (int index)
 called when a tab is closed (only action tabs are closable)

Signals

void dataModelUpdated ()
 emitted when the data model was updated by the user
void showMessage (const QString &message, int durationMilliseconds=2000, bool warning=false)
 emitted when a message has to be displayed to the user

Public Member Functions

 CamiTKExtensionModelPresenter (const QString &camitkFilePath, const QString &newExtensionName, const QString &language=QString(), const QString &cppGenerationType=QString(), QWidget *parent=nullptr)
 constructor If the camitkFilePath does not have a valid model, this will create a new one
void emitShowMessage (const QString &message, int durationMilliseconds=2000, bool warning=false)
 make the presenter emit the show message signal
QString getExtensionName ()
 get current extension name
bool isHotPlug ()
 is the current model a hot plug extension
bool isModified ()
 is the current model modified (unsaved)
bool isPython ()
 is the current model a python extension
void saveExtensionFile (const QFile &file)
 save the data model
 ~CamiTKExtensionModelPresenter ()
 destructor

Detailed Description

Presenter for a CamiTK extension file model.

Note
The only implemented extension model is action extension

This creates

  • a tab to edit the action extension,
  • one tab per action
  • one tab with the resulting (updated) CamiTK extension JSON

Constructor & Destructor Documentation

◆ CamiTKExtensionModelPresenter()

CamiTKExtensionModelPresenter::CamiTKExtensionModelPresenter ( const QString & camitkFilePath,
const QString & newExtensionName,
const QString & language = QString(),
const QString & cppGenerationType = QString(),
QWidget * parent = nullptr )

constructor If the camitkFilePath does not have a valid model, this will create a new one

Parameters
camitkFilePathpath to the CamiTK extension file to edit
newExtensionNamethe extension name ("action", "component", or "viewer"), needed for creating of a new extension
parent(optional)

References isPython(), plusButtonClicked(), VariantDataModel::size(), and tabCloseRequest().

◆ ~CamiTKExtensionModelPresenter()

CamiTKExtensionModelPresenter::~CamiTKExtensionModelPresenter ( )

destructor

Member Function Documentation

◆ dataModelUpdated

void CamiTKExtensionModelPresenter::dataModelUpdated ( )
signal

emitted when the data model was updated by the user

Referenced by CamiTKExtensionEditor::CamiTKExtensionEditor(), and modelUpdated().

◆ emitShowMessage()

void CamiTKExtensionModelPresenter::emitShowMessage ( const QString & message,
int durationMilliseconds = 2000,
bool warning = false )

make the presenter emit the show message signal

References showMessage().

◆ getExtensionName()

QString CamiTKExtensionModelPresenter::getExtensionName ( )

get current extension name

◆ isHotPlug()

bool CamiTKExtensionModelPresenter::isHotPlug ( )

is the current model a hot plug extension

Referenced by CppExtensionTabPresenter::CppExtensionTabPresenter().

◆ isModified()

bool CamiTKExtensionModelPresenter::isModified ( )

is the current model modified (unsaved)

◆ isPython()

bool CamiTKExtensionModelPresenter::isPython ( )

is the current model a python extension

References VariantDataModel::isValid(), and VariantDataModel::toString().

Referenced by CamiTKExtensionModelPresenter(), and plusButtonClicked().

◆ modelUpdated

void CamiTKExtensionModelPresenter::modelUpdated ( )
slot

called when the model has changed, the GUI/JSON is to be updated

References dataModelUpdated().

Referenced by plusButtonClicked(), and tabCloseRequest().

◆ plusButtonClicked

void CamiTKExtensionModelPresenter::plusButtonClicked ( )
slot

◆ saveExtensionFile()

void CamiTKExtensionModelPresenter::saveExtensionFile ( const QFile & file)

save the data model

◆ showMessage

void CamiTKExtensionModelPresenter::showMessage ( const QString & message,
int durationMilliseconds = 2000,
bool warning = false )
signal

emitted when a message has to be displayed to the user

Referenced by CamiTKExtensionEditor::CamiTKExtensionEditor(), emitShowMessage(), plusButtonClicked(), and tabCloseRequest().

◆ tabCloseRequest

void CamiTKExtensionModelPresenter::tabCloseRequest ( int index)
slot

The documentation for this class was generated from the following files: