diff Samples/Sdl/Loader.cpp @ 828:28f99af358fa

Merge + FusionMprSdl
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 29 May 2019 16:15:04 +0200
parents 2fd96a637a59 270c31978df1
children 47fc7919977d
line wrap: on
line diff
--- a/Samples/Sdl/Loader.cpp	Wed May 29 13:44:55 2019 +0200
+++ b/Samples/Sdl/Loader.cpp	Wed May 29 16:15:04 2019 +0200
@@ -166,9 +166,9 @@
   {
     printf("Geometry ready\n");
     
-    //plane_ = message.GetOrigin().GetGeometry().GetSagittalGeometry();
+    plane_ = message.GetOrigin().GetGeometry().GetSagittalGeometry();
     //plane_ = message.GetOrigin().GetGeometry().GetAxialGeometry();
-    plane_ = message.GetOrigin().GetGeometry().GetCoronalGeometry();
+    //plane_ = message.GetOrigin().GetGeometry().GetCoronalGeometry();
     plane_.SetOrigin(message.GetOrigin().GetGeometry().GetCoordinates(0.5f, 0.5f, 0.5f));
 
     Refresh();
@@ -302,6 +302,8 @@
 void Run(OrthancStone::NativeApplicationContext& context,
          OrthancStone::ThreadedOracle& oracle)
 {
+  // the oracle has been supplied with the context (as an IEmitter) upon
+  // creation
   boost::shared_ptr<OrthancStone::DicomVolumeImage>  ct(new OrthancStone::DicomVolumeImage);
   boost::shared_ptr<OrthancStone::DicomVolumeImage>  dose(new OrthancStone::DicomVolumeImage);
 
@@ -314,6 +316,11 @@
   {
     OrthancStone::NativeApplicationContext::WriterLock lock(context);
     toto.reset(new Toto(oracle, lock.GetOracleObservable()));
+
+    // the oracle is used to schedule commands
+    // the oracleObservable is used by the loaders to:
+    // - request the broker (lifetime mgmt)
+    // - register the loader callbacks (called indirectly by the oracle)
     ctLoader.reset(new OrthancStone::OrthancSeriesVolumeProgressiveLoader(ct, oracle, lock.GetOracleObservable()));
     doseLoader.reset(new OrthancStone::OrthancMultiframeVolumeLoader(dose, oracle, lock.GetOracleObservable()));
     rtstructLoader.reset(new OrthancStone::DicomStructureSetLoader(oracle, lock.GetOracleObservable()));