diff --git a/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.cpp b/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.cpp index 55d731fed8..60257f9dea 100644 --- a/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.cpp +++ b/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.cpp @@ -1,87 +1,87 @@ $(license) // Blueberry #include #include // Qmitk #include "$(view-file-name).h" // Qt #include // mitk image #include -const std::string $(view - class - name)::VIEW_ID = "$(view-id)"; +const std::string $(view-class-name)::VIEW_ID = "$(view-id)"; -void $(view - class - name)::SetFocus() +void $(view-class-name)::SetFocus() { m_Controls.buttonPerformImageProcessing->setFocus(); } -void $(view - class - name)::CreateQtPartControl(QWidget *parent) +void $(view-class-name)::CreateQtPartControl(QWidget *parent) { // create GUI widgets from the Qt Designer's .ui file m_Controls.setupUi(parent); connect(m_Controls.buttonPerformImageProcessing, SIGNAL(clicked()), this, SLOT(DoImageProcessing())); } -void $(view - class - name)::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/, +void $(view-class-name)::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/, const QList &nodes) { // iterate all selected objects, adjust warning visibility foreach (mitk::DataNode::Pointer node, nodes) { if (node.IsNotNull() && dynamic_cast(node->GetData())) { m_Controls.labelWarning->setVisible(false); m_Controls.buttonPerformImageProcessing->setEnabled(true); return; } } m_Controls.labelWarning->setVisible(true); m_Controls.buttonPerformImageProcessing->setEnabled(false); } -void $(view - class - name)::DoImageProcessing() +void $(view-class-name)::DoImageProcessing() { QList nodes = this->GetDataManagerSelection(); if (nodes.empty()) return; mitk::DataNode *node = nodes.front(); if (!node) { // Nothing selected. Inform the user and return QMessageBox::information(NULL, "Template", "Please load and select an image before starting image processing."); return; } // here we have a valid mitk::DataNode // a node itself is not very useful, we need its data item (the image) mitk::BaseData *data = node->GetData(); if (data) { // test if this data item is an image or not (could also be a surface or something totally different) mitk::Image *image = dynamic_cast(data); if (image) { std::stringstream message; std::string name; message << "Performing image processing for image "; if (node->GetName(name)) { // a property called "name" was found for this DataNode message << "'" << name << "'"; } message << "."; MITK_INFO << message.str(); // actually do something here... } } } diff --git a/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.h b/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.h index 75c18a3d72..4dfc824c98 100644 --- a/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.h +++ b/Applications/PluginGenerator/PluginTemplate/src/internal/QmitkTemplateView.h @@ -1,46 +1,46 @@ $(license) -#ifndef $(view - file - name) _h -#define $(view - file - name) _h +#ifndef $(view-file-name)_h +#define $(view-file-name)_h #include #include #include "ui_$(view-file-name)Controls.h" /** \brief $(view-class-name) \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ -class $(view - class - name) : public QmitkAbstractView +class $(view-class-name) : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; protected slots: /// \brief Called when the user clicks the GUI button void DoImageProcessing(); protected: virtual void CreateQtPartControl(QWidget *parent) override; virtual void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList &nodes) override; - Ui::$(view - file - name) Controls m_Controls; + Ui::$(view-file-name)Controls m_Controls; }; #endif // $(view-file-name)_h diff --git a/Applications/PluginGenerator/PluginTemplate/src/internal/mitkPluginActivator.cpp b/Applications/PluginGenerator/PluginTemplate/src/internal/mitkPluginActivator.cpp index 606f39882c..d69639ad56 100644 --- a/Applications/PluginGenerator/PluginTemplate/src/internal/mitkPluginActivator.cpp +++ b/Applications/PluginGenerator/PluginTemplate/src/internal/mitkPluginActivator.cpp @@ -1,14 +1,14 @@ $(license) #include "$(activator-file-name).h" #include "$(view-file-name).h" namespace mitk { - void $(activator - class - name)::start(ctkPluginContext *context) + void $(activator-class-name)::start(ctkPluginContext *context) { - BERRY_REGISTER_EXTENSION_CLASS($(view - class - name), context) + BERRY_REGISTER_EXTENSION_CLASS($(view-class-name), context) } - void $(activator - class - name)::stop(ctkPluginContext *context) { Q_UNUSED(context) } + void $(activator-class-name)::stop(ctkPluginContext *context) { Q_UNUSED(context) } } diff --git a/Applications/PluginGenerator/PluginTemplate/src/internal/mitkPluginActivator.h b/Applications/PluginGenerator/PluginTemplate/src/internal/mitkPluginActivator.h index 5016cf8368..9b14f7d376 100644 --- a/Applications/PluginGenerator/PluginTemplate/src/internal/mitkPluginActivator.h +++ b/Applications/PluginGenerator/PluginTemplate/src/internal/mitkPluginActivator.h @@ -1,23 +1,23 @@ $(license) -#ifndef $(activator - file - name) _h -#define $(activator - file - name) _h +#ifndef $(activator-file-name)_h +#define $(activator-file-name)_h #include namespace mitk { - class $(activator - class - name) : public QObject, public ctkPluginActivator + class $(activator-class-name) : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "$(plugin-target)") Q_INTERFACES(ctkPluginActivator) public: void start(ctkPluginContext *context); void stop(ctkPluginContext *context); }; // $(activator-class-name) } #endif // $(activator-file-name)_h