comparison Sources/Plugin.cpp @ 36:13698d34e059

preparing to include O3DV
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Apr 2024 07:42:06 +0200
parents ee3bc8f7df5b
children 970994058acd
comparison
equal deleted inserted replaced
35:ee3bc8f7df5b 36:13698d34e059
44 #include <SerializationToolbox.h> 44 #include <SerializationToolbox.h>
45 #include <SystemToolbox.h> 45 #include <SystemToolbox.h>
46 46
47 #include <vtkNew.h> 47 #include <vtkNew.h>
48 48
49 #include <boost/algorithm/string.hpp>
49 #include <boost/thread/shared_mutex.hpp> 50 #include <boost/thread/shared_mutex.hpp>
50 51
51 #define ORTHANC_PLUGIN_NAME "stl" 52 #define ORTHANC_PLUGIN_NAME "stl"
52 53
53 54
130 return; 131 return;
131 } 132 }
132 133
133 std::string file = request->groups[0]; 134 std::string file = request->groups[0];
134 135
135 if (file == "viewer.html") 136 if (file == "three.html")
136 { 137 {
137 std::string s; 138 std::string s;
138 Orthanc::EmbeddedResources::GetFileResource(s, Orthanc::EmbeddedResources::VIEWER_HTML); 139 Orthanc::EmbeddedResources::GetFileResource(s, Orthanc::EmbeddedResources::THREE_HTML);
139 OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), output, s.c_str(), s.size(), Orthanc::EnumerationToString(Orthanc::MimeType_Html)); 140 OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), output, s.c_str(), s.size(), Orthanc::EnumerationToString(Orthanc::MimeType_Html));
140 } 141 }
141 else if (file == "viewer.js") 142 else if (file == "three.js")
142 { 143 {
143 std::string s; 144 std::string s;
144 Orthanc::EmbeddedResources::GetFileResource(s, Orthanc::EmbeddedResources::VIEWER_JS); 145 Orthanc::EmbeddedResources::GetFileResource(s, Orthanc::EmbeddedResources::THREE_JS);
145 OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), output, s.c_str(), s.size(), Orthanc::EnumerationToString(Orthanc::MimeType_JavaScript)); 146 OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), output, s.c_str(), s.size(), Orthanc::EnumerationToString(Orthanc::MimeType_JavaScript));
146 } 147 }
147 else 148 else if (boost::starts_with(file, "libs/"))
148 { 149 {
149 cache_.Answer(output, file); 150 cache_.Answer(output, file.substr(5));
150 } 151 }
151 } 152 }
152 153
153 154
154 155