Quellcode durchsuchen

Fix indent, private member start with uppercase, add virtual keywords

Jean-Christophe Fillion-Robin vor 15 Jahren
Ursprung
Commit
f98d9c0546
45 geänderte Dateien mit 606 neuen und 434 gelöschten Zeilen
  1. 33 27
      Applications/ctkExampleHost/ctkExampleHostMain.cpp
  2. 70 57
      Applications/ctkExampleHost/ctkHostAppExampleWidget.cpp
  3. 2 2
      Applications/ctkExampleHost/ctkHostAppExampleWidget.h
  4. 15 11
      Plugins/org.commontk.dah.app/ctkAppSoapMessageProcessor.cpp
  5. 3 2
      Plugins/org.commontk.dah.app/ctkAppSoapMessageProcessor.h
  6. 28 23
      Plugins/org.commontk.dah.app/ctkDicomAppPlugin.cpp
  7. 6 5
      Plugins/org.commontk.dah.app/ctkDicomAppPlugin_p.h
  8. 40 32
      Plugins/org.commontk.dah.app/ctkDicomAppServer.cpp
  9. 11 9
      Plugins/org.commontk.dah.app/ctkDicomAppServer_p.h
  10. 11 0
      Plugins/org.commontk.dah.app/ctkDicomHostService.cpp
  11. 9 8
      Plugins/org.commontk.dah.app/ctkDicomHostService_p.h
  12. 6 2
      Plugins/org.commontk.dah.core/ctkDicomAppHostingCorePlugin.cpp
  13. 2 2
      Plugins/org.commontk.dah.core/ctkDicomAppHostingCorePlugin_p.h
  14. 19 3
      Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.h
  15. 5 2
      Plugins/org.commontk.dah.core/ctkDicomExchangeService.cpp
  16. 14 8
      Plugins/org.commontk.dah.core/ctkExchangeSoapMessageProcessor.cpp
  17. 1 1
      Plugins/org.commontk.dah.core/ctkExchangeSoapMessageProcessor.h
  18. 25 19
      Plugins/org.commontk.dah.core/ctkSimpleSoapClient.cpp
  19. 2 0
      Plugins/org.commontk.dah.core/ctkSimpleSoapServer.cpp
  20. 4 1
      Plugins/org.commontk.dah.core/ctkSimpleSoapServer.h
  21. 33 29
      Plugins/org.commontk.dah.core/ctkSoapConnectionRunnable.cpp
  22. 5 2
      Plugins/org.commontk.dah.core/ctkSoapMessageProcessor.cpp
  23. 2 0
      Plugins/org.commontk.dah.core/ctkSoapMessageProcessor.h
  24. 9 5
      Plugins/org.commontk.dah.core/ctkSoapMessageProcessorList.cpp
  25. 4 2
      Plugins/org.commontk.dah.core/ctkSoapMessageProcessorList.h
  26. 46 38
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp
  27. 8 8
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic_p.h
  28. 19 12
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppPlugin.cpp
  29. 5 5
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppPlugin_p.h
  30. 14 15
      Plugins/org.commontk.dah.examplehost/ctkExampleDicomHost.cpp
  31. 13 10
      Plugins/org.commontk.dah.examplehost/ctkExampleDicomHost.h
  32. 15 7
      Plugins/org.commontk.dah.examplehost/ctkExampleDicomHostPlugin.cpp
  33. 4 4
      Plugins/org.commontk.dah.examplehost/ctkExampleDicomHostPlugin_p.h
  34. 21 0
      Plugins/org.commontk.dah.examplehost/ctkHostedAppPlaceholderWidget.cpp
  35. 5 15
      Plugins/org.commontk.dah.examplehost/ctkHostedAppPlaceholderWidget.h
  36. 9 0
      Plugins/org.commontk.dah.host/ctkDicomAppService.cpp
  37. 7 7
      Plugins/org.commontk.dah.host/ctkDicomAppService.h
  38. 15 7
      Plugins/org.commontk.dah.host/ctkDicomHostPlugin.cpp
  39. 5 5
      Plugins/org.commontk.dah.host/ctkDicomHostPlugin_p.h
  40. 3 0
      Plugins/org.commontk.dah.host/ctkDicomHostServer.cpp
  41. 1 1
      Plugins/org.commontk.dah.host/ctkDicomHostServer.h
  42. 26 22
      Plugins/org.commontk.dah.host/ctkDicomHostServerPrivate.cpp
  43. 4 4
      Plugins/org.commontk.dah.host/ctkDicomHostServerPrivate.h
  44. 25 20
      Plugins/org.commontk.dah.host/ctkHostSoapMessageProcessor.cpp
  45. 2 2
      Plugins/org.commontk.dah.host/ctkHostSoapMessageProcessor_p.h

+ 33 - 27
Applications/ctkExampleHost/ctkExampleHostMain.cpp

@@ -19,18 +19,11 @@
 
 =============================================================================*/
 
-#include <ctkPluginFrameworkFactory.h>
-#include <ctkPluginFramework.h>
-#include <ctkPluginException.h>
-#include <ctkPluginContext.h>
-
-#include <ctkExampleDicomHost.h>
-#include <ctkHostAppExampleWidget.h>
-#include <ui_ctkExampleHostMainWindow.h>
-
+// Qt includes
 #include <QApplication>
 #include <QMainWindow>
 #include <QVBoxLayout>
+#include <QDebug>
 
 #include <QString>
 #include <QStringList>
@@ -38,6 +31,20 @@
 #include <QWidget>
 #include <QUrl>
 
+// CTKPluginFramework includes
+#include <ctkPluginFrameworkFactory.h>
+#include <ctkPluginFramework.h>
+#include <ctkPluginException.h>
+#include <ctkPluginContext.h>
+
+// CTK includes
+#include <ctkExampleDicomHost.h>
+#include <ctkHostAppExampleWidget.h>
+#include <ui_ctkExampleHostMainWindow.h>
+
+// STD includes
+#include <cstdlib>
+
 int main(int argv, char** argc)
 {
   QApplication app(argv, argc);
@@ -49,14 +56,15 @@ int main(int argv, char** argc)
   ctkPluginFrameworkFactory fwFactory;
   QSharedPointer<ctkPluginFramework> framework = fwFactory.getFramework();
 
-  try {
+  try
+    {
     framework->init();
-  }
+    }
   catch (const ctkPluginException& exc)
-  {
+    {
     qCritical() << "Failed to initialize the plug-in framework:" << exc;
-    exit(1);
-  }
+    return EXIT_FAILURE;
+    }
 
 #ifdef CMAKE_INTDIR
   QString pluginPath = qApp->applicationDirPath() + "/../plugins/" CMAKE_INTDIR "/";
@@ -76,41 +84,40 @@ int main(int argv, char** argc)
 
   QList<QSharedPointer<ctkPlugin> > installedPlugins;
   while(dirIter.hasNext())
-  {
-    try
     {
+    try
+      {
       QString fileLocation = dirIter.next();
       foreach(QString pluginToInstall, pluginsToInstall)
-      {
-        if (fileLocation.contains(pluginToInstall))
         {
+        if (fileLocation.contains(pluginToInstall))
+          {
           QSharedPointer<ctkPlugin> plugin = framework->getPluginContext()->installPlugin(QUrl::fromLocalFile(fileLocation));
           installedPlugins << plugin;
           break;
+          }
         }
       }
-    }
     catch (const ctkPluginException& e)
-    {
+      {
       qCritical() << e.what();
+      }
     }
-  }
 
   framework->start();
 
   foreach(QSharedPointer<ctkPlugin> plugin, installedPlugins)
-  {
+    {
     plugin->start();
-  }
-
+    }
 
   QMainWindow mainWindow;
   Ui::MainWindow ui;
   ui.setupUi(&mainWindow);
   if ( QApplication::argc() > 1 )
-  {
+    {
     ui.controlWidget->setAppFileName(QApplication::argv()[1]);
-  }
+    }
 
 //  mainWindow.addDockWidget(static_cast<Qt::DockWidgetArea>(4),new ctkHostAppExampleWidget());
 
@@ -122,5 +129,4 @@ int main(int argv, char** argc)
   mainWindow.show();
 
   return app.exec();
-
 }

+ 70 - 57
Applications/ctkExampleHost/ctkHostAppExampleWidget.cpp

@@ -19,16 +19,19 @@
 
 =============================================================================*/
 
+// Qt includes
+#include <QDebug>
+#include <QFileDialog>
+#include <QProcess>
+
+// CTK includes
 #include "ctkHostAppExampleWidget.h"
 #include "ui_ctkHostAppExampleWidget.h"
 #include "ctkExampleDicomHost.h"
 #include "ctkDicomAppService.h"
 #include <ctkDicomAppHostingTypesHelper.h>
 
-#include <QDebug>
-#include <QFileDialog>
-#include <QProcess>
-
+//----------------------------------------------------------------------------
 ctkHostAppExampleWidget::ctkHostAppExampleWidget(QWidget *parent) :
     QWidget(parent),
     ui(new Ui::ctkHostAppExampleWidget)
@@ -37,109 +40,121 @@ ctkHostAppExampleWidget::ctkHostAppExampleWidget(QWidget *parent) :
   ui->setupUi(this);
   ui->crashLabel->setVisible(false);
   ui->messageOutput->setVisible(false);
-  this->host = new ctkExampleDicomHost(ui->placeholderFrame);
+  this->Host = new ctkExampleDicomHost(ui->placeholderFrame);
 
-  connect(&this->host->getAppProcess(),SIGNAL(error(QProcess::ProcessError)),SLOT(appProcessError(QProcess::ProcessError)));
-  connect(&this->host->getAppProcess(),SIGNAL(stateChanged(QProcess::ProcessState)),SLOT(appProcessStateChanged(QProcess::ProcessState)));
+  connect(&this->Host->getAppProcess(),SIGNAL(error(QProcess::ProcessError)),SLOT(appProcessError(QProcess::ProcessError)));
+  connect(&this->Host->getAppProcess(),SIGNAL(stateChanged(QProcess::ProcessState)),SLOT(appProcessStateChanged(QProcess::ProcessState)));
   connect(ui->placeholderFrame,SIGNAL(resized()),SLOT(placeholderResized()));
-  connect(this->host,SIGNAL( stateChangedReceived(ctkDicomAppHosting::State)),SLOT(appStateChanged(ctkDicomAppHosting::State)));
+  connect(this->Host,SIGNAL( stateChangedReceived(ctkDicomAppHosting::State)),SLOT(appStateChanged(ctkDicomAppHosting::State)));
 
 }
 
+//----------------------------------------------------------------------------
 ctkHostAppExampleWidget::~ctkHostAppExampleWidget()
 {
-  delete host;
+  delete this->Host;
   delete ui;
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::startButtonClicked()
 {
   qDebug() << "start button clicked";
-  if (host)
-  {
-    host->StartApplication(appFileName);
+  if (this->Host)
+    {
+    this->Host->StartApplication(this->AppFileName);
     //forward output to textedit
-    connect(&this->host->getAppProcess(),SIGNAL(readyReadStandardOutput()),this,SLOT(outputMessage()));
-  }
+    connect(&this->Host->getAppProcess(),SIGNAL(readyReadStandardOutput()),this,SLOT(outputMessage()));
+    }
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::runButtonClicked()
 {
   qDebug() << "run button clicked";
-  if (host)
-  {
-    bool reply = host->getDicomAppService()->setState(ctkDicomAppHosting::INPROGRESS);
+  if (this->Host)
+    {
+    bool reply = this->Host->getDicomAppService()->setState(ctkDicomAppHosting::INPROGRESS);
     qDebug() << "  setState(INPROGRESS) returned: " << reply;
-  }
+    }
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::stopButtonClicked()
 {
   qDebug() << "stop button clicked";
-  host->getDicomAppService ()->setState (ctkDicomAppHosting::CANCELED);
+  this->Host->getDicomAppService ()->setState (ctkDicomAppHosting::CANCELED);
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::loadButtonClicked()
 {
   qDebug() << "load button clicked";
   this->setAppFileName(QFileDialog::getOpenFileName(this,"Choose hosted application",QApplication::applicationDirPath()));
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::setAppFileName(QString name)
 {
-  this->appFileName = name;
-  if (QFile(this->appFileName).permissions() & QFile::ExeUser )
-  {
-    this->ui->applicationPathLabel->setText(this->appFileName);
-  }
+  this->AppFileName = name;
+  if (QFile(this->AppFileName).permissions() & QFile::ExeUser )
+    {
+    this->ui->applicationPathLabel->setText(this->AppFileName);
+    }
   else
-  {
-    this->ui->applicationPathLabel->setText(QString("<font color='red'>Not executable:</font>").append(this->appFileName));
-  }
+    {
+    this->ui->applicationPathLabel->setText(
+        QString("<font color='red'>Not executable:</font>").append(this->AppFileName));
+    }
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::appProcessError(QProcess::ProcessError error)
 {
   if (error == QProcess::Crashed)
-  {
+    {
     qDebug() << "crash detected";
     ui->crashLabel->setVisible(true);
-  }
+    }
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::appProcessStateChanged(QProcess::ProcessState state)
 {
   QString labelText;
-  switch (state){
-  case QProcess::Running:
-    ui->processStateLabel->setText("Running");
-    break;
-  case QProcess::NotRunning:
-    if (host->getAppProcess().exitStatus() == QProcess::CrashExit )
-    {
-      labelText = "crashed";
-    }
-    else
+  switch (state)
     {
-      labelText = "Not Running, last exit code ";
-      labelText.append(QString::number(host->getAppProcess().exitCode()));
+    case QProcess::Running:
+      ui->processStateLabel->setText("Running");
+      break;
+    case QProcess::NotRunning:
+      if (this->Host->getAppProcess().exitStatus() == QProcess::CrashExit )
+      {
+        labelText = "crashed";
+      }
+      else
+      {
+        labelText = "Not Running, last exit code ";
+        labelText.append(QString::number(this->Host->getAppProcess().exitCode()));
+      }
+      ui->processStateLabel->setText(labelText);
+      break;
+    case QProcess::Starting:
+      ui->processStateLabel->setText("Starting");
+      break;
+    default:
+      ;
     }
-    ui->processStateLabel->setText(labelText);
-    break;
-  case QProcess::Starting:
-    ui->processStateLabel->setText("Starting");
-    break;
-  default:
-    ;
-  }
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::placeholderResized()
 {
   qDebug() << "resized";
   //ui->placeholderFrame->printPosition();
 }
 
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::appStateChanged(ctkDicomAppHosting::State state)
 {
   ui->statusLabel->setText(ctkDicomSoapState::toStringValue(state));
@@ -154,15 +169,13 @@ void ctkHostAppExampleWidget::appStateChanged(ctkDicomAppHosting::State state)
   switch (state)
   {
   case ctkDicomAppHosting::IDLE:
-    if (host->getApplicationState()!=ctkDicomAppHosting::IDLE)
+    if (this->Host->getApplicationState() != ctkDicomAppHosting::IDLE)
     {
       qDebug()<<"state was not IDLE before -> setState EXIT ";
-      host->getDicomAppService()->setState (ctkDicomAppHosting::EXIT);
-
+      this->Host->getDicomAppService()->setState(ctkDicomAppHosting::EXIT);
     }
     break;
   case ctkDicomAppHosting::INPROGRESS:
-
     patient.name = "John Doe";
     patient.id = "0000";
     patient.assigningAuthority = "authority";
@@ -184,7 +197,7 @@ void ctkHostAppExampleWidget::appStateChanged(ctkDicomAppHosting::State state)
     data.patients.append (patient);
 
     qDebug()<<"send dataDescriptors";
-    reply = host->getDicomAppService()->notifyDataAvailable (data,true);
+    reply = this->Host->getDicomAppService()->notifyDataAvailable (data,true);
     qDebug() << "  notifyDataAvailable(1111) returned: " << reply;
     break;
   case ctkDicomAppHosting::COMPLETED:
@@ -196,11 +209,11 @@ void ctkHostAppExampleWidget::appStateChanged(ctkDicomAppHosting::State state)
     //do nothing
     break;
   }
-  host->setApplicationState(state);
+  this->Host->setApplicationState(state);
 }
 
-
+//----------------------------------------------------------------------------
 void ctkHostAppExampleWidget::outputMessage ()
 {
-  ui->messageOutput->append (host->processReadAll ());
+  ui->messageOutput->append (this->Host->processReadAll ());
 }

+ 2 - 2
Applications/ctkExampleHost/ctkHostAppExampleWidget.h

@@ -58,8 +58,8 @@ public slots:
   void outputMessage();
 protected:
 
-  ctkExampleDicomHost* host;
-  QString appFileName;
+  ctkExampleDicomHost* Host;
+  QString AppFileName;
 
 private:
 

+ 15 - 11
Plugins/org.commontk.dah.app/ctkAppSoapMessageProcessor.cpp

@@ -23,11 +23,12 @@
 
 #include <ctkDicomAppHostingTypesHelper.h>
 
-
+//----------------------------------------------------------------------------
 ctkAppSoapMessageProcessor::ctkAppSoapMessageProcessor(ctkDicomAppInterface* inter)
-  : appInterface(inter)
+  : AppInterface(inter)
 {}
 
+//----------------------------------------------------------------------------
 bool ctkAppSoapMessageProcessor::process(
   const QtSoapMessage& message, QtSoapMessage* reply ) const
 {
@@ -41,24 +42,25 @@ bool ctkAppSoapMessageProcessor::process(
   bool foundMethod = false;
   
   if (methodName == "getState")
-  {
+    {
     processGetState(message, reply);
     foundMethod = true;
-  }
+    }
   else if (methodName == "setState")
-  {
+    {
     processSetState(message, reply);
     foundMethod = true;
-  }
+    }
   else if (methodName == "bringToFront")
-  {
+    {
     processBringToFront(message, reply);
     foundMethod = true;
-  }
+    }
   
   return foundMethod;
 }
 
+//----------------------------------------------------------------------------
 void ctkAppSoapMessageProcessor::processGetState(
   const QtSoapMessage &message, QtSoapMessage *reply) const
 {
@@ -66,26 +68,28 @@ void ctkAppSoapMessageProcessor::processGetState(
 
   // extract arguments from input message: nothing to be done
   // query interface
-  const ctkDicomAppHosting::State result = appInterface->getState();
+  const ctkDicomAppHosting::State result = this->AppInterface->getState();
   // set reply message
   reply->setMethod("getState");
   QtSoapSimpleType* resultType = new ctkDicomSoapState("getStateResponse",result);
   reply->addMethodArgument(resultType);
 }
 
+//----------------------------------------------------------------------------
 void ctkAppSoapMessageProcessor::processSetState(
   const QtSoapMessage &message, QtSoapMessage *reply) const
 {
   // extract arguments from input message
   const QtSoapType& inputType = message.method()["newState"];
   // query interface
-  bool result = appInterface->setState(ctkDicomSoapState::getState(inputType));
+  bool result = this->AppInterface->setState(ctkDicomSoapState::getState(inputType));
   // set reply message
   reply->setMethod("setState");
   QtSoapType* resultType = new ctkDicomSoapBool("setStateResponse",result);
   reply->addMethodArgument(resultType);
 }
 
+//----------------------------------------------------------------------------
 void ctkAppSoapMessageProcessor::processBringToFront(
   const QtSoapMessage &message, QtSoapMessage *reply) const
 {
@@ -93,7 +97,7 @@ void ctkAppSoapMessageProcessor::processBringToFront(
   const QtSoapType& inputType = message.method()["requestedScreenArea"];
   const QRect requestedScreenArea = ctkDicomSoapRectangle::getQRect(inputType);
   // query interface
-  bool result = appInterface->bringToFront(requestedScreenArea);
+  bool result = this->AppInterface->bringToFront(requestedScreenArea);
   // set reply message
   reply->setMethod("bringToFront");
   QtSoapType* resultType = new ctkDicomSoapBool("bringToFrontResponse",result);

+ 3 - 2
Plugins/org.commontk.dah.app/ctkAppSoapMessageProcessor.h

@@ -22,6 +22,7 @@
 #ifndef CTKAPPSOAPMESSAGEPROCESSOR_H
 #define CTKAPPSOAPMESSAGEPROCESSOR_H
 
+// CTK includes
 #include "ctkSoapMessageProcessor.h"
 #include "ctkDicomAppInterface.h"
 
@@ -32,7 +33,7 @@ public:
 
   ctkAppSoapMessageProcessor( ctkDicomAppInterface* inter );
 
-  bool process(
+  virtual bool process(
     const QtSoapMessage& message,
     QtSoapMessage* reply) const;
     
@@ -45,7 +46,7 @@ private:
   void processBringToFront(const QtSoapMessage& message,
                            QtSoapMessage* reply) const;
                
-  ctkDicomAppInterface* appInterface;
+  ctkDicomAppInterface* AppInterface;
 
 };
 

+ 28 - 23
Plugins/org.commontk.dah.app/ctkDicomAppPlugin.cpp

@@ -19,72 +19,77 @@
 
 =============================================================================*/
 
+// Qt includes
+#include <QtPlugin>
+#include <QStringList>
 
+// CTK includes
 #include "ctkDicomAppPlugin_p.h"
 #include "ctkDicomAppServer_p.h"
 #include "ctkDicomHostService_p.h"
 
-#include <QtPlugin>
-#include <QStringList>
-
+// STD includes
 #include <stdexcept>
 #include <iostream>
-ctkPluginContext* ctkDicomAppPlugin::context = 0;
 
+ctkPluginContext* ctkDicomAppPlugin::Context = 0;
+
+//----------------------------------------------------------------------------
 ctkDicomAppPlugin::ctkDicomAppPlugin()
-  : appServer(0), hostInterface(0)
+  : AppServer(0), HostInterface(0)
 {
 
 }
 
+//----------------------------------------------------------------------------
 ctkDicomAppPlugin::~ctkDicomAppPlugin()
 {
   std::cout<<"in the destructor of the plugin"<<std::endl;
-  delete appServer;
-  delete hostInterface;
-  this->context=0;
+  delete this->AppServer;
+  delete this->HostInterface;
+  ctkDicomAppPlugin::Context = 0;
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppPlugin::start(ctkPluginContext* context)
 {
-  this->context = context;
+  ctkDicomAppPlugin::Context = context;
 
 
   QUrl appURL(context->getProperty("dah.appURL").toString());
   if (!appURL.isValid())
-  {
+    {
     throw std::runtime_error("The plugin framework does not contain a valid \"dah.appURL\" property");
-  }
+    }
 
   QUrl hostURL(context->getProperty("dah.hostURL").toString());
   if (!hostURL.isValid())
-  {
+    {
     throw std::runtime_error("The plugin framework does not contain a valid \"dah.hostURL\" property");
-  }
+    }
 
   // start the application server
-  appServer = new ctkDicomAppServer(appURL.port());
+  this->AppServer = new ctkDicomAppServer(appURL.port());
 
   // register the host service, providing callbacks to the hosting application
-  hostInterface = new ctkDicomHostService(QUrl(hostURL).port(), "/HostInterface");
-  context->registerService<ctkDicomHostInterface>(hostInterface);
-
+  this->HostInterface = new ctkDicomHostService(QUrl(hostURL).port(), "/HostInterface");
+  context->registerService<ctkDicomHostInterface>(HostInterface);
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppPlugin::stop(ctkPluginContext* context)
 {
   Q_UNUSED(context)
 
-  delete appServer;
-  delete hostInterface;
-  this->context = 0;
+  delete this->AppServer;
+  delete this->HostInterface;
+  this->Context = 0;
 }
 
+//----------------------------------------------------------------------------
 ctkPluginContext* ctkDicomAppPlugin::getPluginContext()
 {
-  return context;
+  return ctkDicomAppPlugin::Context;
 }
 
 Q_EXPORT_PLUGIN2(org_commontk_dah_app, ctkDicomAppPlugin)
-
-

+ 6 - 5
Plugins/org.commontk.dah.app/ctkDicomAppPlugin_p.h

@@ -23,6 +23,7 @@
 #ifndef CTKDICOMAPPPLUGIN_P_H
 #define CTKDICOMAPPPLUGIN_P_H
 
+// CTK includes
 #include <ctkPluginActivator.h>
 
 class ctkDicomAppServer;
@@ -38,18 +39,18 @@ public:
   ctkDicomAppPlugin();
   virtual ~ctkDicomAppPlugin();
 
-  void start(ctkPluginContext* context);
-  void stop(ctkPluginContext* context);
+  virtual void start(ctkPluginContext* Context);
+  virtual void stop(ctkPluginContext* Context);
 
   static ctkPluginContext* getPluginContext();
 
 
 private:
 
-  static ctkPluginContext* context;
+  static ctkPluginContext* Context;
 
-  ctkDicomAppServer* appServer;
-  QObject* hostInterface;
+  ctkDicomAppServer* AppServer;
+  QObject* HostInterface;
 
 }; // ctkDicomAppPlugin
 

+ 40 - 32
Plugins/org.commontk.dah.app/ctkDicomAppServer.cpp

@@ -19,7 +19,10 @@
 
 =============================================================================*/
 
+// Qt includes
+#include <QHostAddress>
 
+// CTK includes
 #include "ctkDicomAppServer_p.h"
 #include "ctkDicomAppPlugin_p.h"
 #include "ctkAppSoapMessageProcessor.h"
@@ -30,88 +33,93 @@
 
 #include <ctkServiceReference.h>
 
-#include <QHostAddress>
-
+// STD includes
 #include <stdexcept>
 
-
+//----------------------------------------------------------------------------
 ctkDicomAppServer::ctkDicomAppServer(int port)
-  : appInterfaceRegistered(false), port(port),
-    appInterfaceTracker(ctkDicomAppPlugin::getPluginContext(), this)
+  : AppInterfaceRegistered(false), Port(port),
+    AppInterfaceTracker(ctkDicomAppPlugin::getPluginContext(), this)
 {
-  appInterfaceTracker.open();
+  this->AppInterfaceTracker.open();
 
-  connect(&server, SIGNAL(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)),
+  connect(&this->Server, SIGNAL(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)),
           this, SLOT(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)));
-  connect(&server, SIGNAL(incomingWSDLMessage(QString,QString*)),
+  connect(&this->Server, SIGNAL(incomingWSDLMessage(QString,QString*)),
           this, SLOT(incomingWSDLMessage(QString,QString*)));
 
-  if (!server.listen(QHostAddress::LocalHost, this->port))
-  {
+  if (!this->Server.listen(QHostAddress::LocalHost, this->Port))
+    {
     qCritical() << "Listening to 127.0.0.1:" << port << " failed.";
-  }
+    }
 }
+
+//----------------------------------------------------------------------------
 ctkDicomAppServer::~ctkDicomAppServer()
 {
-  server.close ();
+  this->Server.close ();
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppServer::incomingWSDLMessage(
   const QString& message, QString* reply)
 {
   if (message == "?wsdl")
-  {
+    {
     QFile wsdlfile(":/dah/ApplicationService.wsdl");
     wsdlfile.open(QFile::ReadOnly | QFile::Text);
     if(wsdlfile.isOpen())
-    {
+      {
       QTextStream textstream(&wsdlfile);
       *reply = textstream.readAll();
       QString actualURL="http://localhost:";
-      actualURL+=QString::number(port)+"/ApplicationInterface"; // FIXME: has to be replaced by url provided by host
+      actualURL+=QString::number(Port)+"/ApplicationInterface"; // FIXME: has to be replaced by url provided by host
       reply->replace("REPLACE_WITH_ACTUAL_URL",actualURL);
       reply->replace("ApplicationService_schema1.xsd",actualURL+"?xsd=1");
       //reply->replace("<soap:body use=\"literal\"/>","<soap:body use=\"literal\"></soap:body>");
+      }
     }
-  }
   else if (message == "?xsd=1")
-  {
+    {
     QFile wsdlfile(":/dah/HostService_schema1.xsd");
     wsdlfile.open(QFile::ReadOnly | QFile::Text);
     if(wsdlfile.isOpen())
-    {
+      {
       QTextStream textstream(&wsdlfile);
       *reply = textstream.readAll();
+      }
     }
-  }
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppServer::incomingSoapMessage(
   const QtSoapMessage& message,
   QtSoapMessage* reply)
 
 {
-  QMutexLocker lock(&mutex);
-  processors.process(message, reply);
+  QMutexLocker lock(&this->Mutex);
+  this->Processors.process(message, reply);
 }
 
+//----------------------------------------------------------------------------
 ctkDicomAppInterface* ctkDicomAppServer::addingService(const ctkServiceReference& reference)
 {
-  QMutexLocker lock(&mutex);
+  QMutexLocker lock(&this->Mutex);
 
-  if (appInterfaceRegistered)
-  {
+  if (this->AppInterfaceRegistered)
+    {
     //TODO maybe use ctkLogService
     qWarning() << "A ctkDicomAppInterface service has already been added";
     return 0;
-  }
-  appInterfaceRegistered = true;
+    }
+  this->AppInterfaceRegistered = true;
   ctkDicomAppInterface* appInterface = ctkDicomAppPlugin::getPluginContext()->getService<ctkDicomAppInterface>(reference);
-  processors.push_back(new ctkAppSoapMessageProcessor(appInterface));
-  processors.push_back(new ctkExchangeSoapMessageProcessor(appInterface));
+  this->Processors.push_back(new ctkAppSoapMessageProcessor(appInterface));
+  this->Processors.push_back(new ctkExchangeSoapMessageProcessor(appInterface));
   return appInterface;
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppServer::modifiedService(const ctkServiceReference& reference, ctkDicomAppInterface* service)
 {
   Q_UNUSED(reference)
@@ -119,13 +127,13 @@ void ctkDicomAppServer::modifiedService(const ctkServiceReference& reference, ct
   // do nothing
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppServer::removedService(const ctkServiceReference& reference, ctkDicomAppInterface* service)
 {
   Q_UNUSED(reference)
   Q_UNUSED(service)
 
-  QMutexLocker lock(&mutex);
-  appInterfaceRegistered = false;
-  processors.clear();
+  QMutexLocker lock(&this->Mutex);
+  this->AppInterfaceRegistered = false;
+  this->Processors.clear();
 }
-

+ 11 - 9
Plugins/org.commontk.dah.app/ctkDicomAppServer_p.h

@@ -23,9 +23,11 @@
 #ifndef CTKDICOMAPPPSERVER_P_H
 #define CTKDICOMAPPPSERVER_P_H
 
+// Qt includes
 #include <QObject>
 #include <QtSoapMessage>
 
+// CTK includes
 #include <ctkServiceTracker.h>
 
 #include <ctkDicomAppInterface.h>
@@ -53,20 +55,20 @@ public slots:
 
 protected:
 
-  ctkDicomAppInterface* addingService(const ctkServiceReference& reference);
-  void modifiedService(const ctkServiceReference& reference, ctkDicomAppInterface* service);
-  void removedService(const ctkServiceReference& reference, ctkDicomAppInterface* service);
+  virtual ctkDicomAppInterface* addingService(const ctkServiceReference& reference);
+  virtual void modifiedService(const ctkServiceReference& reference, ctkDicomAppInterface* service);
+  virtual void removedService(const ctkServiceReference& reference, ctkDicomAppInterface* service);
 
 private:
 
-  QMutex mutex;
-  bool appInterfaceRegistered;
+  QMutex Mutex;
+  bool AppInterfaceRegistered;
 
-  ctkSoapMessageProcessorList processors;
-  ctkSimpleSoapServer server;
-  int port;
+  ctkSoapMessageProcessorList Processors;
+  ctkSimpleSoapServer Server;
+  int Port;
 
-  ctkServiceTracker<ctkDicomAppInterface*> appInterfaceTracker;
+  ctkServiceTracker<ctkDicomAppInterface*> AppInterfaceTracker;
 };
 
 #endif // CTKDICOMAPPPSERVER_P_H

+ 11 - 0
Plugins/org.commontk.dah.app/ctkDicomHostService.cpp

@@ -23,15 +23,18 @@
 
 #include <ctkDicomAppHostingTypesHelper.h>
 
+//----------------------------------------------------------------------------
 ctkDicomHostService::ctkDicomHostService(ushort port, QString path)
   : ctkDicomExchangeService(port, path)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkDicomHostService::~ctkDicomHostService()
 {
 }
 
+//----------------------------------------------------------------------------
 QString ctkDicomHostService::generateUID()
 {
   const QtSoapType& result = submitSoapRequest("generateUID", NULL);
@@ -39,6 +42,7 @@ QString ctkDicomHostService::generateUID()
   return resultUID;
 }
 
+//----------------------------------------------------------------------------
 QString ctkDicomHostService::getOutputLocation(const QStringList& preferredProtocols)
 {
   QtSoapStruct* input = dynamic_cast<QtSoapStruct*>(
@@ -48,6 +52,7 @@ QString ctkDicomHostService::getOutputLocation(const QStringList& preferredProto
   return resultString;
 }
 
+//----------------------------------------------------------------------------
 QRect ctkDicomHostService::getAvailableScreen(const QRect& preferredScreen)
 {
   QtSoapStruct* input = new ctkDicomSoapRectangle("preferredScreen", preferredScreen);
@@ -57,12 +62,14 @@ QRect ctkDicomHostService::getAvailableScreen(const QRect& preferredScreen)
   return resultRect;
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomHostService::notifyStateChanged(ctkDicomAppHosting::State state)
 {
   QtSoapType* input = new ctkDicomSoapState("newState", state); // spec would be "state", java has "newState" FIX JAVA/STANDARD
   submitSoapRequest("notifyStateChanged", input);
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomHostService::notifyStatus(const ctkDicomAppHosting::Status& status)
 {
   //Q_D(ctkDicomService);
@@ -70,13 +77,16 @@ void ctkDicomHostService::notifyStatus(const ctkDicomAppHosting::Status& status)
   submitSoapRequest("notifyStatus", input);
 }
 
+//----------------------------------------------------------------------------
 // Exchange methods
 
+//----------------------------------------------------------------------------
 bool ctkDicomHostService::notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData)
 {
   return ctkDicomExchangeService::notifyDataAvailable(data, lastData);
 }
 
+//----------------------------------------------------------------------------
 QList<ctkDicomAppHosting::ObjectLocator> ctkDicomHostService::getData(
   QList<QUuid> objectUUIDs, 
   QList<QString> acceptableTransferSyntaxUIDs, 
@@ -85,6 +95,7 @@ QList<ctkDicomAppHosting::ObjectLocator> ctkDicomHostService::getData(
   return ctkDicomExchangeService::getData(objectUUIDs, acceptableTransferSyntaxUIDs, includeBulkData);
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomHostService::releaseData(QList<QUuid> objectUUIDs)
 {
   ctkDicomExchangeService::releaseData(objectUUIDs);

+ 9 - 8
Plugins/org.commontk.dah.app/ctkDicomHostService_p.h

@@ -23,6 +23,7 @@
 #ifndef CTKDICOMHOSTSERVICE_P_H
 #define CTKDICOMHOSTSERVICE_P_H
 
+// CTK includes
 #include <ctkDicomHostInterface.h>
 #include <ctkDicomExchangeService.h>
 
@@ -35,21 +36,21 @@ public:
   ctkDicomHostService(ushort port, QString path);
   virtual ~ctkDicomHostService();
 
-  QString generateUID();
-  QRect getAvailableScreen(const QRect& preferredScreen);
-  QString getOutputLocation(const QStringList& preferredProtocols);
-  void notifyStateChanged(ctkDicomAppHosting::State state);
-  void notifyStatus(const ctkDicomAppHosting::Status& status);
+  virtual QString generateUID();
+  virtual QRect getAvailableScreen(const QRect& preferredScreen);
+  virtual QString getOutputLocation(const QStringList& preferredProtocols);
+  virtual void notifyStateChanged(ctkDicomAppHosting::State state);
+  virtual void notifyStatus(const ctkDicomAppHosting::Status& status);
 
   // Exchange methods implemented in ctkDicomExchangeService
-  bool notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData);
+  virtual bool notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData);
 
-  QList<ctkDicomAppHosting::ObjectLocator> getData(
+  virtual QList<ctkDicomAppHosting::ObjectLocator> getData(
     QList<QUuid> objectUUIDs, 
     QList<QString> acceptableTransferSyntaxUIDs, 
     bool includeBulkData);
 
-  void releaseData(QList<QUuid> objectUUIDs);
+  virtual void releaseData(QList<QUuid> objectUUIDs);
 
 };
 

+ 6 - 2
Plugins/org.commontk.dah.core/ctkDicomAppHostingCorePlugin.cpp

@@ -25,37 +25,41 @@
 
 ctkDicomAppHostingCorePlugin* ctkDicomAppHostingCorePlugin::instance = 0;
 
+//----------------------------------------------------------------------------
 ctkDicomAppHostingCorePlugin::ctkDicomAppHostingCorePlugin()
   : context(0)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkDicomAppHostingCorePlugin::~ctkDicomAppHostingCorePlugin()
 {
   
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppHostingCorePlugin::start(ctkPluginContext* context)
 {
   instance = this;
   this->context = context;
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppHostingCorePlugin::stop(ctkPluginContext* context)
 {
   Q_UNUSED(context)
 }
 
+//----------------------------------------------------------------------------
 ctkDicomAppHostingCorePlugin* ctkDicomAppHostingCorePlugin::getInstance()
 {
   return instance;
 }
 
+//----------------------------------------------------------------------------
 ctkPluginContext* ctkDicomAppHostingCorePlugin::getPluginContext() const
 {
   return context;
 }
 
 Q_EXPORT_PLUGIN2(org_commontk_dah_core, ctkDicomAppHostingCorePlugin)
-
-

+ 2 - 2
Plugins/org.commontk.dah.core/ctkDicomAppHostingCorePlugin_p.h

@@ -36,8 +36,8 @@ public:
   ctkDicomAppHostingCorePlugin();
   virtual ~ctkDicomAppHostingCorePlugin();
 
-  void start(ctkPluginContext* context);
-  void stop(ctkPluginContext* context);
+  virtual void start(ctkPluginContext* context);
+  virtual void stop(ctkPluginContext* context);
 
   static ctkDicomAppHostingCorePlugin* getInstance();
 

+ 19 - 3
Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.h

@@ -23,13 +23,17 @@
 #ifndef CTKDICOMAPPHOSTINGTYPESHELPER_H
 #define CTKDICOMAPPHOSTINGTYPESHELPER_H
 
+// Qt includes
 #include <QtSoapStruct>
 #include <QtSoapQName>
 #include <QRect>
+
+// CTK includes
 #include <ctkDicomAppHostingTypes.h>
 
 #include <org_commontk_dah_core_Export.h>
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapRectangle : public QtSoapStruct
 {
   ctkDicomSoapRectangle(const QString& name,const QRect& rect);
@@ -37,6 +41,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapRectangle : public QtSoapStruct
   static QRect getQRect(const QtSoapType& type);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapState : public QtSoapSimpleType
 {
   ctkDicomSoapState(const QString& name, ctkDicomAppHosting::State s);
@@ -46,7 +51,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapState : public QtSoapSimpleType
   static QString toStringValue(ctkDicomAppHosting::State state);
 };
 
-
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapStatus : public QtSoapStruct
 {
   ctkDicomSoapStatus(const QString& name,
@@ -55,6 +60,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapStatus : public QtSoapStruct
   static ctkDicomAppHosting::Status getStatus(const QtSoapType& type);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapUID : public QtSoapSimpleType
 {
   ctkDicomSoapUID(const QString& name, const QString& uid);
@@ -62,6 +68,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapUID : public QtSoapSimpleType
   static QString getUID(const QtSoapType& type);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapBool : public QtSoapSimpleType
 {
   ctkDicomSoapBool(const QString& name, bool boolean);
@@ -70,6 +77,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapBool : public QtSoapSimpleType
 };
 
 //Not easy to template, will see later for other types
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapArrayOfStringType : public QtSoapStruct
 {
   ctkDicomSoapArrayOfStringType(const QString& typeName,
@@ -78,6 +86,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapArrayOfStringType : public QtSoa
   static QStringList getArray(const QtSoapType& array);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapUUID : public QtSoapStruct
 {
   ctkDicomSoapUUID(const QString& name, const QUuid& uuid);
@@ -85,6 +94,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapUUID : public QtSoapStruct
   static QUuid getUuid(const QtSoapType& array);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapArrayOfUUIDS : public QtSoapStruct
 {
   ctkDicomSoapArrayOfUUIDS(const QString& name, const QList<QUuid>& array);
@@ -92,6 +102,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapArrayOfUUIDS : public QtSoapStru
   static QList<QUuid> getArray(const QtSoapType& array);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapObjectDescriptor : public QtSoapStruct
 {
   ctkDicomSoapObjectDescriptor(const QString& name,
@@ -100,6 +111,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapObjectDescriptor : public QtSoap
   static ctkDicomAppHosting::ObjectDescriptor getObjectDescriptor(const QtSoapType& type);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapArrayOfObjectDescriptors : public QtSoapStruct
 {
   ctkDicomSoapArrayOfObjectDescriptors(const QString& name,
@@ -108,6 +120,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapArrayOfObjectDescriptors : publi
   static ctkDicomAppHosting::ArrayOfObjectDescriptors getArrayOfObjectDescriptors(const QtSoapType& type);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapSeries : public QtSoapStruct
 {
   ctkDicomSoapSeries (const QString& name,
@@ -116,6 +129,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapSeries : public QtSoapStruct
   static ctkDicomAppHosting::Series getSeries(const QtSoapType& type);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapStudy : public QtSoapStruct
 {
   ctkDicomSoapStudy(const QString& name,
@@ -124,6 +138,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapStudy : public QtSoapStruct
   static ctkDicomAppHosting::Study getStudy(const QtSoapType& type);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapPatient : public QtSoapStruct
 {
   ctkDicomSoapPatient(const QString& name,
@@ -132,7 +147,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapPatient : public QtSoapStruct
   static ctkDicomAppHosting::Patient getPatient(const QtSoapType& type);
 };
 
-
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapAvailableData : public QtSoapStruct
 {
   ctkDicomSoapAvailableData(const QString& name,
@@ -141,6 +156,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapAvailableData : public QtSoapStr
   static ctkDicomAppHosting::AvailableData getAvailableData (const QtSoapType& type);
 };
 
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapObjectLocator : public QtSoapStruct
 {
   ctkDicomSoapObjectLocator(const QString& name,
@@ -149,7 +165,7 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapObjectLocator : public QtSoapStr
   static ctkDicomAppHosting::ObjectLocator getObjectLocator(const QtSoapType& type);
 };
 
-
+//----------------------------------------------------------------------------
 struct org_commontk_dah_core_EXPORT ctkDicomSoapArrayOfObjectLocators : public QtSoapArray
 {
   ctkDicomSoapArrayOfObjectLocators(const QString& name, const QList<ctkDicomAppHosting::ObjectLocator>& array);

+ 5 - 2
Plugins/org.commontk.dah.core/ctkDicomExchangeService.cpp

@@ -25,17 +25,20 @@
 
 #include "ctkDicomAppHostingTypesHelper.h"
 
+//----------------------------------------------------------------------------
 ctkDicomExchangeService::ctkDicomExchangeService(ushort port, QString path)
   : ctkSimpleSoapClient(port, path)
 {
 
 }
 
+//----------------------------------------------------------------------------
 ctkDicomExchangeService::~ctkDicomExchangeService()
 {
 
 }
 
+//----------------------------------------------------------------------------
 bool ctkDicomExchangeService::notifyDataAvailable(
     ctkDicomAppHosting::AvailableData data, bool lastData)
 {
@@ -46,6 +49,7 @@ bool ctkDicomExchangeService::notifyDataAvailable(
   return ctkDicomSoapBool::getBool(result);
 }
 
+//----------------------------------------------------------------------------
 QList<ctkDicomAppHosting::ObjectLocator> ctkDicomExchangeService::getData(
     QList<QUuid> objectUUIDs,
     QList<QString> acceptableTransferSyntaxUIDs, bool includeBulkData)
@@ -70,6 +74,7 @@ DumpAll(result); //xxx
   return ctkDicomSoapArrayOfObjectLocators::getArray(result);
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomExchangeService::releaseData(QList<QUuid> objectUUIDs)
 {
   QList<QtSoapType*> list;
@@ -78,5 +83,3 @@ void ctkDicomExchangeService::releaseData(QList<QUuid> objectUUIDs)
    submitSoapRequest("releaseData",list);
   return;
 }
-
-

+ 14 - 8
Plugins/org.commontk.dah.core/ctkExchangeSoapMessageProcessor.cpp

@@ -24,10 +24,12 @@
 
 #include <ctkDicomAppHostingTypesHelper.h>
 
+//----------------------------------------------------------------------------
 ctkExchangeSoapMessageProcessor::ctkExchangeSoapMessageProcessor(ctkDicomExchangeInterface* inter)
 : exchangeInterface(inter)
 {}
 
+//----------------------------------------------------------------------------
 bool ctkExchangeSoapMessageProcessor::process(
   const QtSoapMessage& message, QtSoapMessage* reply ) const
 {
@@ -41,32 +43,34 @@ bool ctkExchangeSoapMessageProcessor::process(
   bool foundMethod = false;
 
   if (methodName == "notifyDataAvailable")
-  {
+    {
     processNotifyDataAvailable(message, reply);
     foundMethod = true;
-  }
+    }
   else if (methodName == "getData")
-  {
+    {
     processGetData(message, reply);
     foundMethod = true;
-  }
+    }
   else if (methodName == "releaseData")
-  {
+    {
     processReleaseData(message, reply);
     foundMethod = true;
-  }
+    }
 
   return foundMethod;
 }
+
+//----------------------------------------------------------------------------
 void ctkExchangeSoapMessageProcessor::processNotifyDataAvailable(
   const QtSoapMessage &message, QtSoapMessage *reply) const
 {
   // extract arguments from input message
   const QtSoapType& inputType = message.method()[0];//"availableData"];
   if(inputType.isValid()==false)
-  {
+    {
     qCritical() << "  NotifyDataAvailable: availableData not valid. " << inputType.errorString();
-  }
+    }
   CTK_SOAP_LOG( << inputType.toString());
   const ctkDicomAppHosting::AvailableData data = ctkDicomSoapAvailableData::getAvailableData(inputType);
   const QtSoapType& inputType2 = message.method()["lastData"];
@@ -81,6 +85,7 @@ void ctkExchangeSoapMessageProcessor::processNotifyDataAvailable(
   reply->addMethodArgument(resultType);
 }
 
+//----------------------------------------------------------------------------
 void ctkExchangeSoapMessageProcessor::processGetData(
     const QtSoapMessage &message, QtSoapMessage *reply) const
 {
@@ -102,6 +107,7 @@ void ctkExchangeSoapMessageProcessor::processGetData(
   reply->addMethodArgument(resultType);
 }
 
+//----------------------------------------------------------------------------
 void ctkExchangeSoapMessageProcessor::processReleaseData(
     const QtSoapMessage &message, QtSoapMessage * /*reply*/) const
 {

+ 1 - 1
Plugins/org.commontk.dah.core/ctkExchangeSoapMessageProcessor.h

@@ -33,7 +33,7 @@ public:
 
   ctkExchangeSoapMessageProcessor( ctkDicomExchangeInterface* inter );
 
-  bool process(
+  virtual bool process(
     const QtSoapMessage& message,
     QtSoapMessage* reply) const;
     

+ 25 - 19
Plugins/org.commontk.dah.core/ctkSimpleSoapClient.cpp

@@ -28,41 +28,46 @@
 #include <QNetworkReply>
 #include <QtSoapHttpTransport>
 
+//----------------------------------------------------------------------------
 class ctkSimpleSoapClientPrivate
 {
 public:
 
-  QEventLoop blockingLoop;
-  QtSoapHttpTransport http;
+  QEventLoop BlockingLoop;
+  QtSoapHttpTransport Http;
 
-  int port;
-  QString path;
+  int Port;
+  QString Path;
 };
 
+//----------------------------------------------------------------------------
 ctkSimpleSoapClient::ctkSimpleSoapClient(int port, QString path)
   : d_ptr(new ctkSimpleSoapClientPrivate())
 {
   Q_D(ctkSimpleSoapClient);
 
-  d->port = port;
-  d->path = path;
+  d->Port = port;
+  d->Path = path;
 
-  connect(&d->http, SIGNAL(responseReady()), this, SLOT(responseReady()));
+  connect(&d->Http, SIGNAL(responseReady()), this, SLOT(responseReady()));
 
-  d->http.setHost("127.0.0.1", false, port);
+  d->Http.setHost("127.0.0.1", false, port);
 }
 
+//----------------------------------------------------------------------------
 ctkSimpleSoapClient::~ctkSimpleSoapClient()
 {
 
 }
 
+//----------------------------------------------------------------------------
 void ctkSimpleSoapClient::responseReady()
 {
   Q_D(ctkSimpleSoapClient);
-  d->blockingLoop.exit();
+  d->BlockingLoop.exit();
 }
 
+//----------------------------------------------------------------------------
 const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodName,
                                                    QtSoapType* soapType )
 {
@@ -71,6 +76,7 @@ const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodN
   return submitSoapRequest(methodName,list);
 }
 
+//----------------------------------------------------------------------------
 const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodName,
                                                    const QList<QtSoapType*>& soapTypes )
 {
@@ -79,50 +85,50 @@ const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodN
   QString action="\"";
   //action.append(methodName);
   action.append("\"");
-  d->http.setAction(action);
+  d->Http.setAction(action);
 
   CTK_SOAP_LOG( << "Submitting action " << action
                 << " method " << methodName
-                << " to path " << d->path );
+                << " to path " << d->Path );
 
   QtSoapMessage request;
   request.setMethod(QtSoapQName(methodName,"http://wg23.dicom.nema.org/"));
   if(!soapTypes.isEmpty())
-  {
+    {
     for (QList<QtSoapType*>::ConstIterator it = soapTypes.begin();
          it < soapTypes.constEnd(); it++)
-    {
+      {
       request.addMethodArgument(*it);
       CTK_SOAP_LOG( << "  Argument type added " << (*it)->typeName() << ". "
                     << " Argument name is " << (*it)->name().name() );
+      }
     }
-  }
   CTK_SOAP_LOG_LOWLEVEL( << request.toXmlString());
 
-  d->http.submitRequest(request, d->path);;
+  d->Http.submitRequest(request, d->Path);;
 
   CTK_SOAP_LOG_LOWLEVEL( << "Submitted request " << methodName);
 
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 
-  d->blockingLoop.exec(QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents);
+  d->BlockingLoop.exec(QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents);
 
   QApplication::restoreOverrideCursor();
 
   //qDebug() << "Reply error: " << reply->errorString();
   //qDebug() << reply->readAll();
-  const QtSoapMessage& response = d->http.getResponse();
+  const QtSoapMessage& response = d->Http.getResponse();
 
   CTK_SOAP_LOG( << "Got Response." );
 
   if (response.isFault())
-  {
+    {
     qCritical() << "ctkSimpleSoapClient: server error (response.IsFault())";
     CTK_SOAP_LOG_LOWLEVEL( << response.faultString().toString().toLatin1().constData() << endl );
     CTK_SOAP_LOG_LOWLEVEL( << response.toXmlString() );
     return response.returnValue();
     //    throw std::runtime_error("ctkSimpleSoapClient: server error (response.IsFault())");
-  }
+    }
 
   CTK_SOAP_LOG_LOWLEVEL( << "Response: " << response.toXmlString() );
 

+ 2 - 0
Plugins/org.commontk.dah.core/ctkSimpleSoapServer.cpp

@@ -24,12 +24,14 @@
 
 #include "ctkSoapConnectionRunnable_p.h"
 
+//----------------------------------------------------------------------------
 ctkSimpleSoapServer::ctkSimpleSoapServer(QObject *parent) :
     QTcpServer(parent)
 {
   qRegisterMetaType<QtSoapMessage>("QtSoapMessage");
 }
 
+//----------------------------------------------------------------------------
 void ctkSimpleSoapServer::incomingConnection(int socketDescriptor)
 {
   qDebug() << "New incoming connection";

+ 4 - 1
Plugins/org.commontk.dah.core/ctkSimpleSoapServer.h

@@ -23,10 +23,13 @@
 #ifndef CTKSIMPLESOAPSERVER_H
 #define CTKSIMPLESOAPSERVER_H
 
+// Qt includes
 #include <QTcpServer>
 
+// QtSoap includes
 #include <qtsoap.h>
 
+// CTK includes
 #include <org_commontk_dah_core_Export.h>
 #include <ctkDicomAppHostingTypes.h>
 
@@ -47,7 +50,7 @@ public slots:
 
 protected:
 
-  void incomingConnection(int socketDescriptor);
+  virtual void incomingConnection(int socketDescriptor);
 
 };
 

+ 33 - 29
Plugins/org.commontk.dah.core/ctkSoapConnectionRunnable.cpp

@@ -19,42 +19,46 @@
 
 =============================================================================*/
 
+// Qt includes
+#include <QTcpSocket>
 
+// CTK includes
 #include "ctkSoapConnectionRunnable_p.h"
 #include "ctkSoapLog.h"
 
-#include <QTcpSocket>
-
+//----------------------------------------------------------------------------
 ctkSoapConnectionRunnable::ctkSoapConnectionRunnable(int socketDescriptor)
   : socketDescriptor(socketDescriptor)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkSoapConnectionRunnable::~ctkSoapConnectionRunnable()
 {
 
 }
 
+//----------------------------------------------------------------------------
 void ctkSoapConnectionRunnable::run()
 {
   QTcpSocket tcpSocket;
   if (!tcpSocket.setSocketDescriptor(socketDescriptor))
-  {
+    {
     // error handling
     return;
-  }
-
+    }
 
   while (tcpSocket.state() == QTcpSocket::ConnectedState)
-  {
+    {
     //const int timeout = 5 * 1000;
 
     tcpSocket.waitForReadyRead(-1);
 
     readClient(tcpSocket);
-  }
+    }
 }
 
+//----------------------------------------------------------------------------
 void ctkSoapConnectionRunnable::readClient(QTcpSocket& socket)
 {
   QString requestType;
@@ -64,71 +68,71 @@ void ctkSoapConnectionRunnable::readClient(QTcpSocket& socket)
     QString line = socket.readLine();
     CTK_SOAP_LOG_LOWLEVEL( << line );
     if(line.contains("?wsdl HTTP"))
-    {
+      {
       requestType = "?wsdl";
-    }
+      }
     if(line.contains("?xsd=1"))
-    {
+      {
       requestType = "?xsd=1";
-    }
+      }
     if(line.contains("SoapAction"))
-    {
+      {
       requestType = line;
-    }
+      }
     if(line.contains("Content-Length: "))
-    {
+      {
       contentLength = line.section(':',1).trimmed().toInt();
-    }
+      }
     if (line.trimmed().isEmpty())
-    {
+      {
       QString content;
       if(requestType.startsWith("?"))
-      {
+        {
         QByteArray body = socket.readAll();
         emit incomingWSDLMessage(requestType, &content);
-      }
+        }
       else
-      {
+        {
         // Read the http body, which contains the soap message
         int bytesRead = 0;
         QByteArray body;
         while(body.size() < contentLength)
-        {
+          {
           QByteArray bodyPart = socket.read(contentLength);
           CTK_SOAP_LOG_LOWLEVEL( << bodyPart );
           bytesRead += bodyPart.size();
           body.append(bodyPart);
           CTK_SOAP_LOG_LOWLEVEL( << " Expected content-length: " << contentLength << ". Bytes read so far: " << body.size() );
           if (body.size()<contentLength)
-          {
+            {
             qCritical() << " Message body too small. Trying to read more.";
             socket.waitForReadyRead(-1);
+            }
           }
-        }
         if(body.trimmed().isEmpty()==false)
-        {
+          {
           QtSoapMessage msg;
           if (!msg.setContent(body))
-          {
+            {
             qCritical() << "QtSoap import failed:" << msg.errorString();
             return;
-          }
+            }
 
           QtSoapMessage reply;
           CTK_SOAP_LOG(<< "###################" << msg.toXmlString());
           emit incomingSoapMessage(msg, &reply);
 
           if (reply.isFault())
-          {
+            {
             qCritical() << "QtSoap reply faulty";
             return;
-          }
+            }
 
           CTK_SOAP_LOG_LOWLEVEL( << "SOAP reply:" );
 
           content = reply.toXmlString();
+          }
         }
-      }
 
       QByteArray block;
       block.append("HTTP/1.1 200 OK\n");
@@ -144,6 +148,6 @@ void ctkSoapConnectionRunnable::readClient(QTcpSocket& socket)
 
       requestType = "";
       contentLength = -1;
+      }
     }
-  }
 }

+ 5 - 2
Plugins/org.commontk.dah.core/ctkSoapMessageProcessor.cpp

@@ -21,11 +21,13 @@
 
 #include "ctkSoapMessageProcessor.h"
 
+//----------------------------------------------------------------------------
 ctkSoapMessageProcessor::~ctkSoapMessageProcessor()
 {
 
 }
 
+//----------------------------------------------------------------------------
 bool ctkSoapMessageProcessor::process(
   const QtSoapMessage& message, QtSoapMessage* reply) const
 {
@@ -35,11 +37,12 @@ bool ctkSoapMessageProcessor::process(
   return false;
 }
 
+//----------------------------------------------------------------------------
 bool ctkSoapMessageProcessor::operator==(const ctkSoapMessageProcessor& rhs)
 {
   if( this == &rhs )
-  {
+    {
     return true;
-  }
+    }
   return false;
 }

+ 2 - 0
Plugins/org.commontk.dah.core/ctkSoapMessageProcessor.h

@@ -22,8 +22,10 @@
 #ifndef CTKSOAPMESSAGEPROCESSOR_H
 #define CTKSOAPMESSAGEPROCESSOR_H
 
+// QtSoap includes
 #include <qtsoap.h>
 
+// CTK includes
 #include <org_commontk_dah_core_Export.h>
 
 class org_commontk_dah_core_EXPORT ctkSoapMessageProcessor

+ 9 - 5
Plugins/org.commontk.dah.core/ctkSoapMessageProcessorList.cpp

@@ -21,22 +21,26 @@
 
 #include "ctkSoapMessageProcessorList.h"
 
+//----------------------------------------------------------------------------
 ctkSoapMessageProcessorList::~ctkSoapMessageProcessorList()
 {
-  qDeleteAll(processors);
+  qDeleteAll(this->Processors);
 }
 
+//----------------------------------------------------------------------------
 void ctkSoapMessageProcessorList::push_back( ctkSoapMessageProcessor* processor )
 {
-  processors.push_back( processor );
+  this->Processors.push_back( processor );
 }
 
+//----------------------------------------------------------------------------
 void ctkSoapMessageProcessorList::clear()
 {
-  qDeleteAll(processors);
-  processors.clear();
+  qDeleteAll(this->Processors);
+  this->Processors.clear();
 }
 
+//----------------------------------------------------------------------------
 bool ctkSoapMessageProcessorList::process(
     const QtSoapMessage& message,
     QtSoapMessage* reply ) const
@@ -44,7 +48,7 @@ bool ctkSoapMessageProcessorList::process(
   //extern void DumpAll(const QtSoapType& type, int indent=0);
   //DumpAll(message.method());
 
-  foreach(ctkSoapMessageProcessor* processor, processors)
+  foreach(ctkSoapMessageProcessor* processor, this->Processors)
   {
     if( processor->process( message, reply ) )
     {

+ 4 - 2
Plugins/org.commontk.dah.core/ctkSoapMessageProcessorList.h

@@ -22,8 +22,10 @@
 #ifndef CTKSOAPMESSAGEPROCESSORLIST_H
 #define CTKSOAPMESSAGEPROCESSORLIST_H
 
+// Qt includes
 #include <QList>
 
+// CTK includes
 #include "ctkSoapMessageProcessor.h"
 
 #include <org_commontk_dah_core_Export.h>
@@ -39,12 +41,12 @@ public:
 
   void clear();
 
-  bool process(const QtSoapMessage& message,
+  virtual bool process(const QtSoapMessage& message,
                QtSoapMessage* reply) const;
 
 private:
 
-  QList<ctkSoapMessageProcessor*> processors;
+  QList<ctkSoapMessageProcessor*> Processors;
 
 };
 

+ 46 - 38
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

@@ -19,10 +19,6 @@
 
 =============================================================================*/
 
-
-#include "ctkExampleDicomAppLogic_p.h"
-#include "ctkExampleDicomAppPlugin_p.h"
-
 // Qt includes
 #include <QtPlugin>
 #include <QRect>
@@ -37,15 +33,21 @@
 // DCMTK includes
 #include <dcmimage.h>
 
+// CTK includes
+#include "ctkExampleDicomAppLogic_p.h"
+#include "ctkExampleDicomAppPlugin_p.h"
+
+//----------------------------------------------------------------------------
 ctkExampleDicomAppLogic::ctkExampleDicomAppLogic()
-  : hostTracker(ctkExampleDicomAppPlugin::getPluginContext()), button(NULL)
+  : HostTracker(ctkExampleDicomAppPlugin::getPluginContext()), Button(0)
 {
-  hostTracker.open();
+  this->HostTracker.open();
 
   connect(this, SIGNAL(stateChanged(int)), this, SLOT(changeState(int)), Qt::QueuedConnection);
   emit stateChanged(ctkDicomAppHosting::IDLE);
 }
 
+//----------------------------------------------------------------------------
 ctkExampleDicomAppLogic::~ctkExampleDicomAppLogic()
 {
   ctkPluginContext* context = ctkExampleDicomAppPlugin::getPluginContext();
@@ -56,11 +58,13 @@ ctkExampleDicomAppLogic::~ctkExampleDicomAppLogic()
   }
 }
 
+//----------------------------------------------------------------------------
 ctkDicomAppHosting::State ctkExampleDicomAppLogic::getState()
 {
   return ctkDicomAppHosting::IDLE;
 }
 
+//----------------------------------------------------------------------------
 bool ctkExampleDicomAppLogic::setState(ctkDicomAppHosting::State newState)
 {
   qDebug() << "setState called";
@@ -68,87 +72,90 @@ bool ctkExampleDicomAppLogic::setState(ctkDicomAppHosting::State newState)
   return true;
 }
 
+//----------------------------------------------------------------------------
 bool ctkExampleDicomAppLogic::bringToFront(const QRect& /*requestedScreenArea*/)
 {
   return false;
 }
 
+//----------------------------------------------------------------------------
 void ctkExampleDicomAppLogic::do_something()
 {
-  button = new QPushButton("Button from App");
-  connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
+  this->Button = new QPushButton("Button from App");
+  connect(this->Button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
   try
-  {
-
+    {
     QRect preferred(50,50,100,100);
     qDebug() << "  Asking:getAvailableScreen";
     QRect rect = getHostInterface()->getAvailableScreen(preferred);
     qDebug() << "  got sth:" << rect.top();
-    button->move(rect.topLeft());
-    button->resize(rect.size());
-  }
+    this->Button->move(rect.topLeft());
+    this->Button->resize(rect.size());
+    }
   catch (const std::runtime_error& e)
-  {
+    {
     qCritical() << e.what();
     return;
-  }
-  button->show();
+    }
+  this->Button->show();
 }
 
+//----------------------------------------------------------------------------
 void ctkExampleDicomAppLogic::changeState(int anewstate)
 {
   ctkDicomAppHosting::State newstate = static_cast<ctkDicomAppHosting::State>(anewstate);
 
   if (newstate == ctkDicomAppHosting::INPROGRESS)
-  {
+    {
     do_something();
-  }
+    }
 
   try
-  {
+    {
     getHostInterface()->notifyStateChanged(newstate);
-  }
+    }
   catch (const std::runtime_error& e)
-  {
+    {
     qCritical() << e.what();
     return;
-  }
+    }
 
   if (newstate == ctkDicomAppHosting::CANCELED)
-  {
+    {
     qDebug() << "  Received changeState(CANCELED) ... now releasing all resources and afterwards changing to state IDLE.";
     qDebug() << "  Changing to state IDLE.";
     try
-    {
+      {
       getHostInterface()->notifyStateChanged(ctkDicomAppHosting::IDLE);
-    }
+      }
     catch (const std::runtime_error& e)
-    {
+      {
       qCritical() << e.what();
       return;
+      }
     }
-  }
 
   if (newstate == ctkDicomAppHosting::EXIT)
-  {
+    {
     qDebug() << "  Received changeState(EXIT) ... exiting.";
-    getHostInterface()->notifyStateChanged(ctkDicomAppHosting::EXIT);
+    this->getHostInterface()->notifyStateChanged(ctkDicomAppHosting::EXIT);
     qApp->exit(0);
-  }
+    }
 }
 
+//----------------------------------------------------------------------------
 bool ctkExampleDicomAppLogic::notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData)
 {
   Q_UNUSED(lastData)
   QString s;
-  if(button==NULL)
-  {
+  if(this->Button == 0)
+    {
     qCritical() << "Button is null!";
     return false;
-  }
+    }
   s = "Received notifyDataAvailable with patients.count()= " + QString().setNum(data.patients.count());
   if(data.patients.count()>0)
-  {
+    {
     s=s+" name:"+data.patients.begin()->name+" studies.count(): "+QString().setNum(data.patients.begin()->studies.count());
     if(data.patients.begin()->studies.count()>0)
     {
@@ -162,10 +169,11 @@ bool ctkExampleDicomAppLogic::notifyDataAvailable(ctkDicomAppHosting::AvailableD
       }
     }
   }
-  button->setText(s);
+  this->Button->setText(s);
   return false;
 }
 
+//----------------------------------------------------------------------------
 QList<ctkDicomAppHosting::ObjectLocator> ctkExampleDicomAppLogic::getData(
   QList<QUuid> objectUUIDs,
   QList<QString> acceptableTransferSyntaxUIDs,
@@ -177,6 +185,7 @@ QList<ctkDicomAppHosting::ObjectLocator> ctkExampleDicomAppLogic::getData(
   return QList<ctkDicomAppHosting::ObjectLocator>();
 }
 
+//----------------------------------------------------------------------------
 void ctkExampleDicomAppLogic::releaseData(QList<QUuid> objectUUIDs)
 {
   Q_UNUSED(objectUUIDs)
@@ -184,7 +193,7 @@ void ctkExampleDicomAppLogic::releaseData(QList<QUuid> objectUUIDs)
 
 ctkDicomHostInterface* ctkExampleDicomAppLogic::getHostInterface() const
 {
-  ctkDicomHostInterface* host = hostTracker.getService();
+  ctkDicomHostInterface* host = this->HostTracker.getService();
   if (!host) throw std::runtime_error("DICOM Host Interface not available");
   return host;
 }
@@ -217,6 +226,5 @@ void ctkExampleDicomAppLogic::buttonClicked()
     qtImage->setPixmap(ctkImage.getPixmap(0));
     qtImage->show();
   }
-  button->setText(s);
-
+  this->Button->setText(s);
 }

+ 8 - 8
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic_p.h

@@ -43,19 +43,19 @@ public:
   virtual ~ctkExampleDicomAppLogic();
 
   // ctkDicomAppInterface
-  ctkDicomAppHosting::State getState();
-  bool setState(ctkDicomAppHosting::State newState);
-  bool bringToFront(const QRect& requestedScreenArea);
+  virtual ctkDicomAppHosting::State getState();
+  virtual bool setState(ctkDicomAppHosting::State newState);
+  virtual bool bringToFront(const QRect& requestedScreenArea);
 
   // ctkDicomExchangeInterface
-  bool notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData);
+  virtual bool notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData);
 
-  QList<ctkDicomAppHosting::ObjectLocator> getData(
+  virtual QList<ctkDicomAppHosting::ObjectLocator> getData(
     QList<QUuid> objectUUIDs, 
     QList<QString> acceptableTransferSyntaxUIDs, 
     bool includeBulkData);
 
-  void releaseData(QList<QUuid> objectUUIDs);
+  virtual void releaseData(QList<QUuid> objectUUIDs);
 
   // some logic
   void do_something();
@@ -74,9 +74,9 @@ private:
 
   ctkDicomHostInterface* getHostInterface() const;
 
-  ctkServiceTracker<ctkDicomHostInterface*> hostTracker;
+  ctkServiceTracker<ctkDicomHostInterface*> HostTracker;
 
-  QPushButton *button;
+  QPushButton * Button;
 
   QUuid uuid;
 

+ 19 - 12
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppPlugin.cpp

@@ -19,44 +19,51 @@
 
 =============================================================================*/
 
-
-#include "ctkExampleDicomAppPlugin_p.h"
-#include "ctkExampleDicomAppLogic_p.h"
+// Qt includes
 #include <QtPlugin>
 #include <QStringList>
 #include <QString>
 
-ctkPluginContext* ctkExampleDicomAppPlugin::context = 0;
+// CTK includes
+#include "ctkExampleDicomAppPlugin_p.h"
+#include "ctkExampleDicomAppLogic_p.h"
+
+ctkPluginContext* ctkExampleDicomAppPlugin::Context = 0;
 
+//----------------------------------------------------------------------------
 ctkExampleDicomAppPlugin::ctkExampleDicomAppPlugin()
-  : appLogic(0)
+  : AppLogic(0)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkExampleDicomAppPlugin::~ctkExampleDicomAppPlugin()
 {
   qDebug()<< "delete applogic";
-  delete appLogic;
+  delete this->AppLogic;
 }
 
+//----------------------------------------------------------------------------
 void ctkExampleDicomAppPlugin::start(ctkPluginContext* context)
 {
-  this->context = context;
+  ctkExampleDicomAppPlugin::Context = context;
 
-  delete appLogic;
-  appLogic = new ctkExampleDicomAppLogic();
-  context->registerService<ctkDicomAppInterface>(appLogic);
+  delete this->AppLogic;
+  this->AppLogic = new ctkExampleDicomAppLogic();
+  context->registerService<ctkDicomAppInterface>(this->AppLogic);
 }
 
+//----------------------------------------------------------------------------
 void ctkExampleDicomAppPlugin::stop(ctkPluginContext* context)
 {
   Q_UNUSED(context)
-  this->context = 0;
+  ctkExampleDicomAppPlugin::Context = 0;
 }
 
+//----------------------------------------------------------------------------
 ctkPluginContext* ctkExampleDicomAppPlugin::getPluginContext()
 {
-  return context;
+  return ctkExampleDicomAppPlugin::Context;
 }
 
 Q_EXPORT_PLUGIN2(org_commontk_example_dicomapp, ctkExampleDicomAppPlugin)

+ 5 - 5
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppPlugin_p.h

@@ -36,18 +36,18 @@ class ctkExampleDicomAppPlugin :
 public:
 
   ctkExampleDicomAppPlugin();
-  ~ctkExampleDicomAppPlugin();
+  virtual ~ctkExampleDicomAppPlugin();
 
-  void start(ctkPluginContext* context);
-  void stop(ctkPluginContext* context);
+  virtual void start(ctkPluginContext* context);
+  virtual void stop(ctkPluginContext* context);
 
   static ctkPluginContext* getPluginContext();
 
 private:
 
-  static ctkPluginContext* context;
+  static ctkPluginContext* Context;
 
-  QObject* appLogic;
+  QObject* AppLogic;
 
 }; // ctkExampleDicomAppPlugin
 

+ 14 - 15
Plugins/org.commontk.dah.examplehost/ctkExampleDicomHost.cpp

@@ -34,10 +34,10 @@
 //----------------------------------------------------------------------------
 ctkExampleDicomHost::ctkExampleDicomHost(ctkHostedAppPlaceholderWidget* placeholderWidget, int hostPort, int appPort) :
     ctkDicomAbstractHost(hostPort, appPort),
-    placeholderWidget(placeholderWidget),
-    applicationState(ctkDicomAppHosting::IDLE)
+    PlaceholderWidget(placeholderWidget),
+    ApplicationState(ctkDicomAppHosting::IDLE)
 {
-  //connect(&this->appProcess,SIGNAL(readyReadStandardOutput()),SLOT(forwardConsoleOutput()));
+  //connect(&this->AppProcess,SIGNAL(readyReadStandardOutput()),SLOT(forwardConsoleOutput()));
 }
 
 //----------------------------------------------------------------------------
@@ -56,8 +56,8 @@ void ctkExampleDicomHost::StartApplication(QString AppPath)
   //}
   //qDebug() << "starting application: " << AppPath << " " << arguments;
   qDebug() << "starting application: " << AppPath << " " << arguments;
-  this->appProcess.setProcessChannelMode(QProcess::MergedChannels);
-  this->appProcess.start(AppPath, arguments);
+  this->AppProcess.setProcessChannelMode(QProcess::MergedChannels);
+  this->AppProcess.start(AppPath, arguments);
 }
 
 //----------------------------------------------------------------------------
@@ -65,7 +65,7 @@ QRect ctkExampleDicomHost::getAvailableScreen(const QRect& preferredScreen)
 {
   qDebug()<< "Application asked for this area:"<< preferredScreen;
 
-  QRect rect (this->placeholderWidget->getAbsolutePosition());
+  QRect rect (this->PlaceholderWidget->getAbsolutePosition());
 
   emit giveAvailableScreen(rect);
   return rect;
@@ -91,17 +91,17 @@ void ctkExampleDicomHost::notifyStatus(const ctkDicomAppHosting::Status& status)
 ctkExampleDicomHost::~ctkExampleDicomHost()
 {
   qDebug() << "Exiting host: trying to terminate app";
-  this->appProcess.terminate();
+  this->AppProcess.terminate();
   qDebug() << "Exiting host: trying to kill app";
-  this->appProcess.kill();
+  this->AppProcess.kill();
 }
 
 //----------------------------------------------------------------------------
 void ctkExampleDicomHost::forwardConsoleOutput()
 {
-  while( this->appProcess.bytesAvailable() )
+  while( this->AppProcess.bytesAvailable() )
   {
-    QString line( this->appProcess.readLine() );
+    QString line( this->AppProcess.readLine() );
     line.prepend(">>>> ");
     std::cout << line.toStdString();
   }
@@ -129,10 +129,10 @@ QList<ctkDicomAppHosting::ObjectLocator> ctkExampleDicomHost::getData(
   QUuid uuid;
   QUuid testUuid("{11111111-1111-1111-1111-111111111111}");
   foreach(uuid, objectUUIDs)
-  {
+    {
     //stupid test: only works with one uuid
     if (uuid == testUuid)
-    {
+      {
       ctkDicomAppHosting::ObjectLocator objectLocator;
       objectLocator.locator = QUuid();
       objectLocator.source = QUuid();
@@ -142,10 +142,9 @@ QList<ctkDicomAppHosting::ObjectLocator> ctkExampleDicomHost::getData(
       objectLocator.offset = 0;
       objectLocator.URI = "testFile.txt";
       locators.append (objectLocator);
-    }
-
+      }
     return locators;
-  }
+    }
 
   return QList<ctkDicomAppHosting::ObjectLocator>();
 }

+ 13 - 10
Plugins/org.commontk.dah.examplehost/ctkExampleDicomHost.h

@@ -22,14 +22,16 @@
 #ifndef CTKEXAMPLEDICOMHOST_H
 #define CTKEXAMPLEDICOMHOST_H
 
+// Qt includes
+#include <QUrl>
+#include <QProcess>
+
+// CTK includes
 #include <ctkDicomAbstractHost.h>
 #include <ctkHostedAppPlaceholderWidget.h>
 
 #include <org_commontk_dah_examplehost_Export.h>
 
-#include <QUrl>
-#include <QProcess>
-
 class org_commontk_dah_examplehost_EXPORT ctkExampleDicomHost : public QObject, public ctkDicomAbstractHost
 {
   Q_OBJECT
@@ -37,6 +39,7 @@ class org_commontk_dah_examplehost_EXPORT ctkExampleDicomHost : public QObject,
 public:
 
   ctkExampleDicomHost(ctkHostedAppPlaceholderWidget* placeholderWidget, int hostPort = 8080, int appPort = 8081);
+  virtual ~ctkExampleDicomHost();
 
   virtual void StartApplication(QString AppPath);
   virtual QString generateUID() { return ""; }
@@ -52,11 +55,11 @@ public:
       bool includeBulkData);
   virtual void releaseData(QList<QUuid> objectUUIDs);
 
-  const QProcess& getAppProcess() const { return appProcess; }
-  const ctkDicomAppHosting::State getApplicationState()const {return applicationState;}
-  void setApplicationState(ctkDicomAppHosting::State state){applicationState = state;}
+  const QProcess& getAppProcess() const { return this->AppProcess; }
+  ctkDicomAppHosting::State getApplicationState()const {return this->ApplicationState;}
+  void setApplicationState(ctkDicomAppHosting::State state){this->ApplicationState = state;}
 
-  QByteArray processReadAll(){return appProcess.readAllStandardOutput ();}
+  QByteArray processReadAll(){return this->AppProcess.readAllStandardOutput ();}
 
 signals:
 
@@ -66,9 +69,9 @@ signals:
 
 protected:
 
-  QProcess appProcess;
-  ctkHostedAppPlaceholderWidget* placeholderWidget;
-  ctkDicomAppHosting::State applicationState;
+  QProcess AppProcess;
+  ctkHostedAppPlaceholderWidget* PlaceholderWidget;
+  ctkDicomAppHosting::State ApplicationState;
 
 protected slots:
 

+ 15 - 7
Plugins/org.commontk.dah.examplehost/ctkExampleDicomHostPlugin.cpp

@@ -19,41 +19,49 @@
 
 =============================================================================*/
 
+// Qt includes
+#include <QtPlugin>
 
+// CTK includes
 #include "ctkExampleDicomHostPlugin_p.h"
-#include <QtPlugin>
 
-ctkExampleDicomHostPlugin* ctkExampleDicomHostPlugin::instance = 0;
+ctkExampleDicomHostPlugin* ctkExampleDicomHostPlugin::Instance = 0;
 
+//----------------------------------------------------------------------------
 ctkExampleDicomHostPlugin::ctkExampleDicomHostPlugin()
-  : context(0)
+  : Context(0)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkExampleDicomHostPlugin::~ctkExampleDicomHostPlugin()
 {
   
 }
 
+//----------------------------------------------------------------------------
 void ctkExampleDicomHostPlugin::start(ctkPluginContext* context)
 {
-  instance = this;
-  this->context = context;
+  ctkExampleDicomHostPlugin::Instance = this;
+  this->Context = context;
 }
 
+//----------------------------------------------------------------------------
 void ctkExampleDicomHostPlugin::stop(ctkPluginContext* context)
 {
   Q_UNUSED(context)
 }
 
+//----------------------------------------------------------------------------
 ctkExampleDicomHostPlugin* ctkExampleDicomHostPlugin::getInstance()
 {
-  return instance;
+  return ctkExampleDicomHostPlugin::Instance;
 }
 
+//----------------------------------------------------------------------------
 ctkPluginContext* ctkExampleDicomHostPlugin::getPluginContext() const
 {
-  return context;
+  return this->Context;
 }
 
 Q_EXPORT_PLUGIN2(org_commontk_dah_examplehost, ctkExampleDicomHostPlugin)

+ 4 - 4
Plugins/org.commontk.dah.examplehost/ctkExampleDicomHostPlugin_p.h

@@ -36,8 +36,8 @@ public:
   ctkExampleDicomHostPlugin();
   virtual ~ctkExampleDicomHostPlugin();
 
-  void start(ctkPluginContext* context);
-  void stop(ctkPluginContext* context);
+  virtual void start(ctkPluginContext* context);
+  virtual void stop(ctkPluginContext* context);
 
   static ctkExampleDicomHostPlugin* getInstance();
 
@@ -46,8 +46,8 @@ public:
 
 private:
 
-  static ctkExampleDicomHostPlugin* instance;
-  ctkPluginContext* context;
+  static ctkExampleDicomHostPlugin* Instance;
+  ctkPluginContext* Context;
 
 
 }; // ctkExampleDicomHostPlugin

+ 21 - 0
Plugins/org.commontk.dah.examplehost/ctkHostedAppPlaceholderWidget.cpp

@@ -19,9 +19,30 @@
 
 =============================================================================*/
 
+// Qt includes
+#include <QDebug>
+
+// CTK includes
 #include "ctkHostedAppPlaceholderWidget.h"
 
+//----------------------------------------------------------------------------
 ctkHostedAppPlaceholderWidget::ctkHostedAppPlaceholderWidget(QWidget *parent) :
     QFrame(parent)
 {
 }
+
+//----------------------------------------------------------------------------
+QRect ctkHostedAppPlaceholderWidget::getAbsolutePosition()
+{
+  QWidget* current = this;
+  int x = 0;
+  int y = 0;
+  do
+    {
+    x = x + current->x();
+    y = y + current->y();
+    current = dynamic_cast<QWidget*>(current->parent());
+    }
+  while (current);
+  return QRect(x,y,width(),height());
+}

+ 5 - 15
Plugins/org.commontk.dah.examplehost/ctkHostedAppPlaceholderWidget.h

@@ -22,8 +22,10 @@
 #ifndef CTKHOSTEDAPPPLACEHOLDERWIDGET_H
 #define CTKHOSTEDAPPPLACEHOLDERWIDGET_H
 
+// Qt includes
 #include <QFrame>
-#include <QDebug>
+
+// CTK includes
 #include <org_commontk_dah_examplehost_Export.h>
 
 class org_commontk_dah_examplehost_EXPORT ctkHostedAppPlaceholderWidget : public QFrame
@@ -33,19 +35,7 @@ class org_commontk_dah_examplehost_EXPORT ctkHostedAppPlaceholderWidget : public
 public:
 
   explicit ctkHostedAppPlaceholderWidget(QWidget *parent = 0);
-  QRect getAbsolutePosition()
-  {
-    QWidget* current = this;
-    int x = 0;
-    int y = 0;
-    do
-    {
-      x = x + current->x();
-      y = y + current->y();
-      current = dynamic_cast<QWidget*>(current->parent());
-    } while (current);
-    return QRect(x,y,width(),height());
-  }
+  QRect getAbsolutePosition();
 
 signals:
 
@@ -53,7 +43,7 @@ signals:
 
 protected:
 
-  void resizeEvent(QResizeEvent* /* event */) { emit resized(); }
+  virtual void resizeEvent(QResizeEvent* /* event */) { emit resized(); }
 };
 
 #endif // CTKHOSTEDAPPPLACEHOLDERWIDGET_H

+ 9 - 0
Plugins/org.commontk.dah.host/ctkDicomAppService.cpp

@@ -25,21 +25,25 @@
 
 #include "ctkDicomAppHostingTypesHelper.h"
 
+//----------------------------------------------------------------------------
 ctkDicomAppService::ctkDicomAppService(ushort port, QString path)
   : ctkDicomExchangeService(port, path)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkDicomAppService::~ctkDicomAppService()
 {
 }
 
+//----------------------------------------------------------------------------
 ctkDicomAppHosting::State ctkDicomAppService::getState()
 {
   const QtSoapType & result = submitSoapRequest("getState", NULL);
   return ctkDicomSoapState::getState(result);
 }
 
+//----------------------------------------------------------------------------
 bool ctkDicomAppService::setState(ctkDicomAppHosting::State newState)
 {
   QtSoapType* input = new ctkDicomSoapState("newState", newState);
@@ -47,6 +51,7 @@ bool ctkDicomAppService::setState(ctkDicomAppHosting::State newState)
   return ctkDicomSoapBool::getBool(result);
 }
 
+//----------------------------------------------------------------------------
 bool ctkDicomAppService::bringToFront(const QRect& requestedScreenArea)
 {
   QtSoapType* input = new ctkDicomSoapRectangle("requestedScreenArea", requestedScreenArea);
@@ -54,13 +59,16 @@ bool ctkDicomAppService::bringToFront(const QRect& requestedScreenArea)
   return ctkDicomSoapBool::getBool(result);
 }
 
+//----------------------------------------------------------------------------
 // Exchange methods
 
+//----------------------------------------------------------------------------
 bool ctkDicomAppService::notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData)
 {
   return ctkDicomExchangeService::notifyDataAvailable(data, lastData);
 }
 
+//----------------------------------------------------------------------------
 QList<ctkDicomAppHosting::ObjectLocator> ctkDicomAppService::getData(
   QList<QUuid> objectUUIDs, 
   QList<QString> acceptableTransferSyntaxUIDs, 
@@ -69,6 +77,7 @@ QList<ctkDicomAppHosting::ObjectLocator> ctkDicomAppService::getData(
   return ctkDicomExchangeService::getData(objectUUIDs, acceptableTransferSyntaxUIDs, includeBulkData);
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomAppService::releaseData(QList<QUuid> objectUUIDs)
 {
   ctkDicomExchangeService::releaseData(objectUUIDs);

+ 7 - 7
Plugins/org.commontk.dah.host/ctkDicomAppService.h

@@ -31,21 +31,21 @@ class ctkDicomAppService : public ctkDicomExchangeService, public ctkDicomAppInt
 
 public:
   ctkDicomAppService(ushort port, QString path);
-  ~ctkDicomAppService();
+  virtual ~ctkDicomAppService();
 
-  ctkDicomAppHosting::State getState();
-  bool setState(ctkDicomAppHosting::State newState);
-  bool bringToFront(const QRect& requestedScreenArea);
+  virtual ctkDicomAppHosting::State getState();
+  virtual bool setState(ctkDicomAppHosting::State newState);
+  virtual bool bringToFront(const QRect& requestedScreenArea);
 
   // Exchange methods implemented in ctkDicomExchangeService
-  bool notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData);
+  virtual bool notifyDataAvailable(ctkDicomAppHosting::AvailableData data, bool lastData);
 
-  QList<ctkDicomAppHosting::ObjectLocator> getData(
+  virtual QList<ctkDicomAppHosting::ObjectLocator> getData(
     QList<QUuid> objectUUIDs, 
     QList<QString> acceptableTransferSyntaxUIDs, 
     bool includeBulkData);
 
-  void releaseData(QList<QUuid> objectUUIDs);
+  virtual void releaseData(QList<QUuid> objectUUIDs);
 
 };
 

+ 15 - 7
Plugins/org.commontk.dah.host/ctkDicomHostPlugin.cpp

@@ -19,41 +19,49 @@
 
 =============================================================================*/
 
+// Qt includes
+#include <QtPlugin>
 
+// CTK includes
 #include "ctkDicomHostPlugin_p.h"
-#include <QtPlugin>
 
-ctkDicomHostPlugin* ctkDicomHostPlugin::instance = 0;
+ctkDicomHostPlugin* ctkDicomHostPlugin::Instance = 0;
 
+//----------------------------------------------------------------------------
 ctkDicomHostPlugin::ctkDicomHostPlugin()
-  : context(0)
+  : Context(0)
 {
 }
 
+//----------------------------------------------------------------------------
 ctkDicomHostPlugin::~ctkDicomHostPlugin()
 {
   
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomHostPlugin::start(ctkPluginContext* context)
 {
-  instance = this;
-  this->context = context;
+  ctkDicomHostPlugin::Instance = this;
+  this->Context = context;
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomHostPlugin::stop(ctkPluginContext* context)
 {
   Q_UNUSED(context)
 }
 
+//----------------------------------------------------------------------------
 ctkDicomHostPlugin* ctkDicomHostPlugin::getInstance()
 {
-  return instance;
+  return ctkDicomHostPlugin::Instance;
 }
 
+//----------------------------------------------------------------------------
 ctkPluginContext* ctkDicomHostPlugin::getPluginContext() const
 {
-  return context;
+  return this->Context;
 }
 
 Q_EXPORT_PLUGIN2(org_commontk_dah_host, ctkDicomHostPlugin)

+ 5 - 5
Plugins/org.commontk.dah.host/ctkDicomHostPlugin_p.h

@@ -34,10 +34,10 @@ class ctkDicomHostPlugin :
 public:
 
   ctkDicomHostPlugin();
-  ~ctkDicomHostPlugin();
+  virtual ~ctkDicomHostPlugin();
 
-  void start(ctkPluginContext* context);
-  void stop(ctkPluginContext* context);
+  virtual void start(ctkPluginContext* context);
+  virtual void stop(ctkPluginContext* context);
 
   static ctkDicomHostPlugin* getInstance();
 
@@ -46,8 +46,8 @@ public:
 
 private:
 
-  static ctkDicomHostPlugin* instance;
-  ctkPluginContext* context;
+  static ctkDicomHostPlugin* Instance;
+  ctkPluginContext* Context;
 
 
 }; // ctkDicomHostPlugin

+ 3 - 0
Plugins/org.commontk.dah.host/ctkDicomHostServer.cpp

@@ -23,11 +23,14 @@
 
 #include "ctkDicomHostServerPrivate.h"
 
+//----------------------------------------------------------------------------
 ctkDicomHostServer::ctkDicomHostServer(ctkDicomHostInterface* hostInterface, int port)
   : d_ptr(new ctkDicomHostServerPrivate(hostInterface, port))
 {
 
 }
+
+//----------------------------------------------------------------------------
 ctkDicomHostServer::~ctkDicomHostServer()
 {
 }

+ 1 - 1
Plugins/org.commontk.dah.host/ctkDicomHostServer.h

@@ -36,7 +36,7 @@ class org_commontk_dah_host_EXPORT ctkDicomHostServer
 public:
 
   ctkDicomHostServer(ctkDicomHostInterface* hostInterface, int port);
-  ~ctkDicomHostServer();
+  virtual ~ctkDicomHostServer();
 
 private:
 

+ 26 - 22
Plugins/org.commontk.dah.host/ctkDicomHostServerPrivate.cpp

@@ -19,70 +19,74 @@
 
 =============================================================================*/
 
-#include "ctkDicomHostServerPrivate.h"
-
-#include <ctkDicomHostInterface.h>
-
+// Qt includes
 #include <QHostAddress>
 
-#include <stdexcept>
+// CTK includes
+#include "ctkDicomHostServerPrivate.h"
+#include <ctkDicomHostInterface.h>
 #include <ctkDicomAppHostingTypesHelper.h>
 
 #include <ctkExchangeSoapMessageProcessor.h>
 #include "ctkHostSoapMessageProcessor_p.h"
 
+// STD includes
+#include <stdexcept>
 
+//----------------------------------------------------------------------------
 ctkDicomHostServerPrivate::ctkDicomHostServerPrivate(ctkDicomHostInterface* hostInterface, int port) :
-    port(port), hostInterface(hostInterface)
+    Port(port), HostInterface(hostInterface)
 {
-  connect(&server, SIGNAL(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)),
+  connect(&this->Server, SIGNAL(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)),
           this, SLOT(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)));
-  connect(&server, SIGNAL(incomingWSDLMessage(QString,QString*)),
+  connect(&this->Server, SIGNAL(incomingWSDLMessage(QString,QString*)),
           this, SLOT(incomingWSDLMessage(QString,QString*)));
 
-  if (!server.listen(QHostAddress::LocalHost, this->port))
-  {
-    qCritical() << "Listening to 127.0.0.1:" << port << " failed.";
-  }
+  if (!this->Server.listen(QHostAddress::LocalHost, this->Port))
+    {
+    qCritical() << "Listening to 127.0.0.1:" << this->Port << " failed.";
+    }
 
   ctkHostSoapMessageProcessor* hostProcessor = new ctkHostSoapMessageProcessor( hostInterface );
-  processors.push_back(hostProcessor);
+  this->Processors.push_back(hostProcessor);
   ctkExchangeSoapMessageProcessor* exchangeProcessor = new ctkExchangeSoapMessageProcessor( hostInterface );
-  processors.push_back(exchangeProcessor);
+  this->Processors.push_back(exchangeProcessor);
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomHostServerPrivate::incomingWSDLMessage(
   const QString& message, QString* reply)
 {
   if (message == "?wsdl")
-  {
+    {
     QFile wsdlfile(":/dah/HostService.wsdl");
     wsdlfile.open(QFile::ReadOnly | QFile::Text);
     if(wsdlfile.isOpen())
-    {
+      {
       QTextStream textstream(&wsdlfile);
       *reply = textstream.readAll();
       QString actualURL="http://localhost:";
-      actualURL+=QString::number(port)+"/HostInterface"; // FIXME: has to be replaced by url provided by host
+      actualURL+=QString::number(this->Port)+"/HostInterface"; // FIXME: has to be replaced by url provided by host
       reply->replace("REPLACE_WITH_ACTUAL_URL",actualURL);
       reply->replace("HostService_schema1.xsd",actualURL+"?xsd=1");
       //reply->replace("<soap:body use=\"literal\"/>","<soap:body use=\"literal\"></soap:body>");
+      }
     }
-  }
   else if (message == "?xsd=1")
-  {
+    {
     QFile wsdlfile(":/dah/HostService_schema1.xsd");
     wsdlfile.open(QFile::ReadOnly | QFile::Text);
     if(wsdlfile.isOpen())
-    {
+      {
       QTextStream textstream(&wsdlfile);
       *reply = textstream.readAll();
+      }
     }
-  }
 }
 
+//----------------------------------------------------------------------------
 void ctkDicomHostServerPrivate::incomingSoapMessage(
   const QtSoapMessage& message, QtSoapMessage* reply)
 {
-  processors.process(message, reply);
+  this->Processors.process(message, reply);
 }

+ 4 - 4
Plugins/org.commontk.dah.host/ctkDicomHostServerPrivate.h

@@ -37,8 +37,8 @@ class ctkDicomHostServerPrivate : public QObject
 public:
   ctkDicomHostServerPrivate(ctkDicomHostInterface* hostInterface, int port);
 
-  ctkSimpleSoapServer server;
-  int port;
+  ctkSimpleSoapServer Server;
+  int Port;
 
 public slots:
 
@@ -48,8 +48,8 @@ public slots:
 
 private:
 
-  ctkSoapMessageProcessorList processors;
-  ctkDicomHostInterface* hostInterface;
+  ctkSoapMessageProcessorList Processors;
+  ctkDicomHostInterface* HostInterface;
 
 };
 

+ 25 - 20
Plugins/org.commontk.dah.host/ctkHostSoapMessageProcessor.cpp

@@ -23,14 +23,14 @@
 
 #include <ctkDicomAppHostingTypesHelper.h>
 
-
+//----------------------------------------------------------------------------
 ctkHostSoapMessageProcessor::ctkHostSoapMessageProcessor( ctkDicomHostInterface* inter )
-: hostInterface(inter)
+: HostInterface(inter)
 {}
 
+//----------------------------------------------------------------------------
 bool ctkHostSoapMessageProcessor::process(
-	const QtSoapMessage& message,
-	QtSoapMessage* reply ) const
+  const QtSoapMessage& message, QtSoapMessage* reply ) const
 {
   // TODO check for NULL hostInterface?
   
@@ -42,34 +42,35 @@ bool ctkHostSoapMessageProcessor::process(
   bool foundMethod = false;
   
   if (methodName == "getAvailableScreen")
-  {
+    {
     processGetAvailableScreen(message, reply);
     foundMethod = true;
-  }
+    }
   else if (methodName == "notifyStateChanged")
-  {
+    {
     processNotifyStateChanged(message, reply);
     foundMethod = true;
-  }
+    }
   else if (methodName == "notifyStatus")
-  {
+    {
     processNotifyStatus(message, reply);
     foundMethod = true;
-  }
+    }
   else if (methodName == "generateUID")
-  {
+    {
     processGenerateUID(message, reply);
     foundMethod = true;
-  }
+    }
   else if (methodName == "getOutputLocation")
-  {
+    {
     processGetOutputLocation(message, reply);
     foundMethod = true;
-  }
+    }
   
   return foundMethod;
 }
-		
+
+//----------------------------------------------------------------------------
 void ctkHostSoapMessageProcessor::processGetAvailableScreen(
     const QtSoapMessage &message, QtSoapMessage *reply) const
 {
@@ -77,46 +78,50 @@ void ctkHostSoapMessageProcessor::processGetAvailableScreen(
   const QtSoapType& inputType = message.method()["preferredScreen"];
   const QRect preferredScreen = ctkDicomSoapRectangle::getQRect(inputType);
   // query interface
-  const QRect result = hostInterface->getAvailableScreen(preferredScreen);
+  const QRect result = this->HostInterface->getAvailableScreen(preferredScreen);
   // set reply message
   reply->setMethod("getAvailableScreenResponse");
   QtSoapStruct* returnType = new ctkDicomSoapRectangle("availableScreen",result);
   reply->addMethodArgument(returnType);
 }
 
+//----------------------------------------------------------------------------
 void ctkHostSoapMessageProcessor::processNotifyStateChanged(
     const QtSoapMessage &message, QtSoapMessage * /* reply */) const
 {
   // extract arguments from input message
   const QtSoapType& inputType = message.method()[0];//["state"]; java sends ["newState"]; FIX JAVA/STANDARD
   // query interface
-  hostInterface->notifyStateChanged(ctkDicomSoapState::getState(inputType));
+  this->HostInterface->notifyStateChanged(ctkDicomSoapState::getState(inputType));
   // set reply message: nothing to be done
 }
 
+//----------------------------------------------------------------------------
 void ctkHostSoapMessageProcessor::processNotifyStatus(
     const QtSoapMessage &message, QtSoapMessage * /* reply */) const
 {
   // extract arguments from input message
   const QtSoapType& inputType = message.method()["status"];
   // query interface
-  hostInterface->notifyStatus(ctkDicomSoapStatus::getStatus(inputType));
+  this->HostInterface->notifyStatus(ctkDicomSoapStatus::getStatus(inputType));
   // set reply message: nothing to be done
 }
 
+//----------------------------------------------------------------------------
 void ctkHostSoapMessageProcessor::processGenerateUID(
   const QtSoapMessage& message, QtSoapMessage* reply) const
 {
   Q_UNUSED(message)
   // extract arguments from input message: nothing to be done
   // query interface
-  const QString uid = hostInterface->generateUID();
+  const QString uid = this->HostInterface->generateUID();
   // set reply message
   reply->setMethod("generateUID");
   QtSoapType* resultType = new ctkDicomSoapUID("uid",uid);
   reply->addMethodArgument(resultType);
 }
 
+//----------------------------------------------------------------------------
 void ctkHostSoapMessageProcessor::processGetOutputLocation(
   const QtSoapMessage& message, QtSoapMessage* reply) const
 {
@@ -125,7 +130,7 @@ void ctkHostSoapMessageProcessor::processGetOutputLocation(
   const QStringList preferredProtocols = ctkDicomSoapArrayOfStringType::getArray(
     dynamic_cast<const QtSoapArray&>(inputType));
   // query interface
-  const QString result = hostInterface->getOutputLocation(preferredProtocols);
+  const QString result = this->HostInterface->getOutputLocation(preferredProtocols);
   // set reply message
   reply->setMethod("getOutputLocation");
   QtSoapType* resultType = new QtSoapSimpleType( QtSoapQName("preferredProtocols"), result );

+ 2 - 2
Plugins/org.commontk.dah.host/ctkHostSoapMessageProcessor_p.h

@@ -32,7 +32,7 @@ public:
 
   ctkHostSoapMessageProcessor( ctkDicomHostInterface* inter );
 
-  bool process(
+  virtual bool process(
     const QtSoapMessage& message,
     QtSoapMessage* reply) const;
     
@@ -49,7 +49,7 @@ private:
   void processGetOutputLocation(const QtSoapMessage& message,
                                  QtSoapMessage* reply) const;
                
-  ctkDicomHostInterface* hostInterface;
+  ctkDicomHostInterface* HostInterface;
 
 };