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>

+ Inheritance diagram for CamiTKExtensionModelPresenter:
+ Collaboration diagram for CamiTKExtensionModelPresenter:

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 CamiTKExtensionModel::clear(), CamiTKExtensionModel::getModel(), isPython(), VariantDataModel::isValid(), CamiTKExtensionModel::load(), plusButtonClicked(), CamiTKExtensionModel::resetModel(), VariantDataModel::size(), tabCloseRequest(), and CamiTKExtensionModel::toJSON().

+ Here is the call graph for this function:

◆ ~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().

+ Here is the caller graph for this function:

◆ emitShowMessage()

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

make the presenter emit the show message signal

References showMessage().

Referenced by FieldEditor::deleteButtonClicked(), and QtPropertyFieldEditor::valueChangedInPropertyField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExtensionName()

QString CamiTKExtensionModelPresenter::getExtensionName ( )

get current extension name

References CamiTKExtensionModel::getModel().

Referenced by CamiTKExtensionEditor::saveClicked().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isHotPlug()

bool CamiTKExtensionModelPresenter::isHotPlug ( )

is the current model a hot plug extension

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

Referenced by CppExtensionTabPresenter::CppExtensionTabPresenter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isModified()

bool CamiTKExtensionModelPresenter::isModified ( )

is the current model modified (unsaved)

References CamiTKExtensionModel::isModified().

+ Here is the call graph for this function:

◆ isPython()

bool CamiTKExtensionModelPresenter::isPython ( )

is the current model a python extension

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

Referenced by CamiTKExtensionModelPresenter(), and plusButtonClicked().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modelUpdated

void CamiTKExtensionModelPresenter::modelUpdated ( )
slot

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

References dataModelUpdated(), and CamiTKExtensionModel::toJSON().

Referenced by FieldEditor::deleteButtonClicked(), QtPropertyFieldEditor::editTextChanged(), plusButtonClicked(), CamiTKPropertyListFieldEditor::plusButtonClicked(), tabCloseRequest(), ListFieldEditor::updateModel(), QtPropertyFieldEditor::valueChangedInPropertyField(), and TextFieldEditor::valueChangedInTextEdit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ plusButtonClicked

void CamiTKExtensionModelPresenter::plusButtonClicked ( )
slot

called when the user clicks on the "+" button to add an action tab

References VariantDataModel::append(), CustomInputDialog::getInput(), CamiTKExtensionModel::getModel(), isPython(), VariantDataModel::last(), modelUpdated(), showMessage(), and VariantDataModel::size().

Referenced by CamiTKExtensionModelPresenter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveExtensionFile()

void CamiTKExtensionModelPresenter::saveExtensionFile ( const QFile &  file)

save the data model

References CamiTKExtensionModel::save().

Referenced by CamiTKExtensionEditor::saveClicked().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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().

+ Here is the caller graph for this function:

◆ tabCloseRequest

void CamiTKExtensionModelPresenter::tabCloseRequest ( int  index)
slot

called when a tab is closed (only action tabs are closable)

References ExtensionTypeTabPresenter::getDataModel(), ExtensionTypeTabPresenter::getExtensionType(), VariantDataModel::isValid(), modelUpdated(), VariantDataModel::remove(), and showMessage().

Referenced by CamiTKExtensionModelPresenter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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