Просмотр исходного кода

Merge branch 'dah' of github.com:commontk/CTK into dah_up

Benoît Bleuzé лет назад: 14
Родитель
Сommit
13178ea5de

+ 33 - 0
Plugins/org.commontk.dicom.examplehost/CMakeLists.txt

@@ -0,0 +1,33 @@
+PROJECT(org_commontk_dicom_examplehost)
+
+SET(PLUGIN_export_directive "org_commontk_dicom_examplehost_EXPORT")
+
+SET(PLUGIN_SRCS
+  ctkDicomExampleHostPlugin.cpp
+)
+
+# Files which should be processed by Qts moc
+SET(PLUGIN_MOC_SRCS
+  ctkDicomExampleHostPlugin_p.h
+)
+
+# Qt Designer files which should be processed by Qts uic
+SET(PLUGIN_UI_FORMS
+)
+
+# QRC Files which should be compiled into the plugin
+SET(PLUGIN_resources
+)
+
+#Compute the plugin dependencies
+ctkMacroGetTargetLibraries(PLUGIN_target_libraries)
+
+ctkMacroBuildPlugin(
+  NAME ${PROJECT_NAME}
+  EXPORT_DIRECTIVE ${PLUGIN_export_directive}
+  SRCS ${PLUGIN_SRCS}
+  MOC_SRCS ${PLUGIN_MOC_SRCS}
+  UI_FORMS ${PLUGIN_UI_FORMS}
+  RESOURCES ${PLUGIN_resources}
+  TARGET_LIBRARIES ${PLUGIN_target_libraries}
+)

+ 61 - 0
Plugins/org.commontk.dicom.examplehost/ctkDicomExampleHostPlugin.cpp

@@ -0,0 +1,61 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+
+#include "ctkDicomExampleHostPlugin_p.h"
+#include <QtPlugin>
+
+ctkDicomExampleHostPlugin* ctkDicomExampleHostPlugin::instance = 0;
+
+ctkDicomExampleHostPlugin::ctkDicomExampleHostPlugin()
+  : context(0)
+{
+}
+
+ctkDicomExampleHostPlugin::~ctkDicomExampleHostPlugin()
+{
+  
+}
+
+void ctkDicomExampleHostPlugin::start(ctkPluginContext* context)
+{
+  instance = this;
+  this->context = context;
+}
+
+void ctkDicomExampleHostPlugin::stop(ctkPluginContext* context)
+{
+  Q_UNUSED(context)
+}
+
+ctkDicomExampleHostPlugin* ctkDicomExampleHostPlugin::getInstance()
+{
+  return instance;
+}
+
+ctkPluginContext* ctkDicomExampleHostPlugin::getPluginContext() const
+{
+  return context;
+}
+
+Q_EXPORT_PLUGIN2(org_commontk_dicom_examplehost, ctkDicomExampleHostPlugin)
+
+

+ 55 - 0
Plugins/org.commontk.dicom.examplehost/ctkDicomExampleHostPlugin_p.h

@@ -0,0 +1,55 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+
+#ifndef CTKDICOMEXAMPLEHOSTPLUGIN_P_H
+#define CTKDICOMEXAMPLEHOSTPLUGIN_P_H
+
+#include <ctkPluginActivator.h>
+
+class ctkDicomExampleHostPlugin :
+  public QObject, public ctkPluginActivator
+{
+  Q_OBJECT
+  Q_INTERFACES(ctkPluginActivator)
+
+public:
+
+  ctkDicomExampleHostPlugin();
+  ~ctkDicomExampleHostPlugin();
+
+  void start(ctkPluginContext* context);
+  void stop(ctkPluginContext* context);
+
+  static ctkDicomExampleHostPlugin* getInstance();
+
+  ctkPluginContext* getPluginContext() const;
+
+
+private:
+
+  static ctkDicomExampleHostPlugin* instance;
+  ctkPluginContext* context;
+
+
+}; // ctkDicomExampleHostPlugin
+
+#endif // CTKDICOMEXAMPLEHOSTPLUGIN_P_H

+ 9 - 0
Plugins/org.commontk.dicom.examplehost/target_libraries.cmake

@@ -0,0 +1,9 @@
+# See CMake/ctkMacroGetTargetLibraries.cmake
+#
+# This file should list the libraries required to build the current CTK plugin.
+# For specifying required plugins, see the manifest_headers.cmake file.
+#
+
+SET(target_libraries
+  CTKPluginFramework
+)