comparison RenderingPlugin/Sources/Plugin.cpp @ 1877:a2955abe4c2e

skeleton for the RenderingPlugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Jan 2022 08:23:38 +0100
parents
children 4e80b8afd0da
comparison
equal deleted inserted replaced
1876:b1f510e601d2 1877:a2955abe4c2e
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 **/
21
22
23 #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
24
25 #include <EmbeddedResources.h>
26
27 #include <Logging.h>
28
29
30 extern "C"
31 {
32 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
33 {
34 OrthancPlugins::SetGlobalContext(context);
35
36 #if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 7, 2)
37 Orthanc::Logging::InitializePluginContext(context);
38 #else
39 Orthanc::Logging::Initialize(context);
40 #endif
41
42 /* Check the version of the Orthanc core */
43 if (OrthancPluginCheckVersion(context) == 0)
44 {
45 char info[1024];
46 sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin",
47 context->orthancVersion,
48 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
49 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
50 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
51 OrthancPluginLogError(context, info);
52 return -1;
53 }
54
55 try
56 {
57 }
58 catch (...)
59 {
60 OrthancPlugins::LogError("Exception while initializing the Stone Web viewer plugin");
61 return -1;
62 }
63
64 return 0;
65 }
66
67
68 ORTHANC_PLUGINS_API void OrthancPluginFinalize()
69 {
70 }
71
72
73 ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
74 {
75 return PLUGIN_NAME;
76 }
77
78
79 ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion()
80 {
81 return PLUGIN_VERSION;
82 }
83 }