comparison Applications/Samples/SampleApplicationContext.h @ 237:b4642964c355 am

SimpleViewer demo running both with SDL and Wasm
author am@osimis.io
date Wed, 20 Jun 2018 09:03:48 +0200
parents ce4405d98b92
children 092db46c6291
comparison
equal deleted inserted replaced
236:f73d722d98c8 237:b4642964c355
40 40
41 namespace OrthancStone 41 namespace OrthancStone
42 { 42 {
43 43
44 #if ORTHANC_ENABLE_SDL==1 44 #if ORTHANC_ENABLE_SDL==1
45 typedef BasicSdlApplicationContext BasicApplicationContext_; 45 class SampleApplicationContext : public BasicSdlApplicationContext
46 #else 46 #else
47 typedef BasicWasmApplicationContext BasicApplicationContext_; 47 class SampleApplicationContext : public BasicWasmApplicationContext
48 #endif 48 #endif
49
50 class SampleApplicationContext : public BasicApplicationContext_
51 { 49 {
52 private: 50 private:
53 typedef std::list<ISlicedVolume*> SlicedVolumes; // this is actually used by the samples and shall be moved to a SampleApplicationContext 51 typedef std::list<ISlicedVolume*> SlicedVolumes; // this is actually used by the samples and shall be moved to a SampleApplicationContext
54 typedef std::list<IVolumeLoader*> VolumeLoaders; 52 typedef std::list<IVolumeLoader*> VolumeLoaders;
55 typedef std::list<IWorldSceneInteractor*> Interactors; 53 typedef std::list<IWorldSceneInteractor*> Interactors;
58 VolumeLoaders volumeLoaders_; 56 VolumeLoaders volumeLoaders_;
59 Interactors interactors_; 57 Interactors interactors_;
60 58
61 public: 59 public:
62 60
63 SampleApplicationContext(Orthanc::WebServiceParameters& orthanc, WidgetViewport* centralViewport); 61 #if ORTHANC_ENABLE_SDL==1
62 SampleApplicationContext(Orthanc::WebServiceParameters& orthanc, WidgetViewport* centralViewport)
63 : BasicSdlApplicationContext(orthanc, centralViewport) {
64 }
65 #else
66 SampleApplicationContext(IWebService& webService)
67 : BasicWasmApplicationContext(webService) {
68 }
69 #endif
64 70
65 virtual ~SampleApplicationContext(); 71 virtual ~SampleApplicationContext();
66 72
67 ISlicedVolume& AddSlicedVolume(ISlicedVolume* volume); 73 ISlicedVolume& AddSlicedVolume(ISlicedVolume* volume);
68 74