comparison Samples/Sdl/Loader.cpp @ 767:dce5b067d040

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 23 May 2019 16:57:33 +0200
parents d6cd7c5ca6ea
children 55411e7da2f7
comparison
equal deleted inserted replaced
766:d6cd7c5ca6ea 767:dce5b067d040
30 // From Stone 30 // From Stone
31 #include "../../Framework/Loaders/BasicFetchingItemsSorter.h" 31 #include "../../Framework/Loaders/BasicFetchingItemsSorter.h"
32 #include "../../Framework/Loaders/BasicFetchingStrategy.h" 32 #include "../../Framework/Loaders/BasicFetchingStrategy.h"
33 #include "../../Framework/Scene2D/CairoCompositor.h" 33 #include "../../Framework/Scene2D/CairoCompositor.h"
34 #include "../../Framework/Scene2D/Scene2D.h" 34 #include "../../Framework/Scene2D/Scene2D.h"
35 #include "../../Framework/Scene2D/PolylineSceneLayer.h"
35 #include "../../Framework/StoneInitialization.h" 36 #include "../../Framework/StoneInitialization.h"
36 #include "../../Framework/Toolbox/GeometryToolbox.h" 37 #include "../../Framework/Toolbox/GeometryToolbox.h"
37 #include "../../Framework/Toolbox/SlicesSorter.h" 38 #include "../../Framework/Toolbox/SlicesSorter.h"
38 #include "../../Framework/Volumes/ImageBuffer3D.h" 39 #include "../../Framework/Volumes/ImageBuffer3D.h"
39 #include "../../Framework/Volumes/VolumeImageGeometry.h" 40 #include "../../Framework/Volumes/VolumeImageGeometry.h"
192 } 193 }
193 194
194 Vector tmp = geometry_.GetVoxelDimensions(projection_); 195 Vector tmp = geometry_.GetVoxelDimensions(projection_);
195 texture->SetPixelSpacing(tmp[0], tmp[1]); 196 texture->SetPixelSpacing(tmp[0], tmp[1]);
196 197
198 return texture.release();
199
200 #if 0
201 double w = texture->GetTexture().GetWidth() * tmp[0];
202 double h = texture->GetTexture().GetHeight() * tmp[1];
197 printf("%.1f %.1f %.1f => %.1f %.1f => %.1f %.1f\n", 203 printf("%.1f %.1f %.1f => %.1f %.1f => %.1f %.1f\n",
198 system.GetOrigin() [0], 204 system.GetOrigin() [0],
199 system.GetOrigin() [1], 205 system.GetOrigin() [1],
200 system.GetOrigin() [2], 206 system.GetOrigin() [2],
201 x0, y0, 207 x0, y0, x0 + w, y0 + h);
202 x0 + texture->GetTexture().GetWidth() * tmp[0], 208
203 y0 + texture->GetTexture().GetHeight() * tmp[1]); 209 std::auto_ptr<PolylineSceneLayer> toto(new PolylineSceneLayer);
204 210
205 return texture.release(); 211 PolylineSceneLayer::Chain c;
212 c.push_back(ScenePoint2D(x0, y0));
213 c.push_back(ScenePoint2D(x0 + w, y0));
214 c.push_back(ScenePoint2D(x0 + w, y0 + h));
215 c.push_back(ScenePoint2D(x0, y0 + h));
216
217 toto->AddChain(c, true);
218
219 return toto.release();
220 #endif
206 } 221 }
207 }; 222 };
208 223
209 224
210 // This class combines a 3D image buffer, a 3D volume geometry and 225 // This class combines a 3D image buffer, a 3D volume geometry and
1559 } 1574 }
1560 1575
1561 void SetVolume1(int depth, 1576 void SetVolume1(int depth,
1562 OrthancStone::IVolumeSlicer* volume) 1577 OrthancStone::IVolumeSlicer* volume)
1563 { 1578 {
1564 source1_.reset(new OrthancStone::VolumeSceneLayerSource(0, volume)); 1579 source1_.reset(new OrthancStone::VolumeSceneLayerSource(depth, volume));
1565 } 1580 }
1566 1581
1567 void SetVolume2(int depth, 1582 void SetVolume2(int depth,
1568 OrthancStone::IVolumeSlicer* volume) 1583 OrthancStone::IVolumeSlicer* volume)
1569 { 1584 {
1570 source2_.reset(new OrthancStone::VolumeSceneLayerSource(0, volume)); 1585 source2_.reset(new OrthancStone::VolumeSceneLayerSource(depth, volume));
1571 } 1586 }
1572 }; 1587 };
1573 1588
1574 1589
1575 void Run(OrthancStone::NativeApplicationContext& context, 1590 void Run(OrthancStone::NativeApplicationContext& context,
1713 try 1728 try
1714 { 1729 {
1715 OrthancStone::NativeApplicationContext context; 1730 OrthancStone::NativeApplicationContext context;
1716 1731
1717 OrthancStone::ThreadedOracle oracle(context); 1732 OrthancStone::ThreadedOracle oracle(context);
1718 oracle.SetThreadsCount(1); 1733 //oracle.SetThreadsCount(1);
1719 1734
1720 { 1735 {
1721 Orthanc::WebServiceParameters p; 1736 Orthanc::WebServiceParameters p;
1722 //p.SetUrl("http://localhost:8043/"); 1737 //p.SetUrl("http://localhost:8043/");
1723 p.SetCredentials("orthanc", "orthanc"); 1738 p.SetCredentials("orthanc", "orthanc");