comparison UnitTestsSources/UnitTestsMain.cpp @ 65:885932a893de wasm

OrthancFrameLayerSource
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 16 May 2017 22:12:41 +0200
parents 28956ed68280
children 298f375dcb68
comparison
equal deleted inserted replaced
64:394e63010e02 65:885932a893de
20 20
21 21
22 #include "gtest/gtest.h" 22 #include "gtest/gtest.h"
23 23
24 #include "../Resources/Orthanc/Core/Logging.h" 24 #include "../Resources/Orthanc/Core/Logging.h"
25 #include "../Framework/Toolbox/OrthancWebService.h"
26 #include "../Framework/Layers/OrthancFrameLayerSource.h"
27
28
29 namespace OrthancStone
30 {
31 class Tata : public ILayerSource::IObserver
32 {
33 public:
34 virtual void NotifySourceChange(ILayerSource& source)
35 {
36 printf("Source change\n");
37
38 OrthancStone::SliceGeometry slice;
39 double x1, y1, x2, y2;
40 printf(">> %d: ", source.GetExtent(x1, y1, x2, y2, slice));
41 printf("(%f,%f) (%f,%f)\n", x1, y1, x2, y2);
42 }
43
44 virtual void NotifySliceChange(ILayerSource& source,
45 const SliceGeometry& slice)
46 {
47 printf("Slice change\n");
48 }
49
50 virtual void NotifyLayerReady(ILayerRenderer* layer,
51 ILayerSource& source,
52 const SliceGeometry& viewportSlice)
53 {
54 std::auto_ptr<ILayerRenderer> tmp(layer);
55
56 }
57
58 virtual void NotifyLayerError(ILayerSource& source,
59 const SliceGeometry& viewportSlice)
60 {
61 }
62 };
63 }
64
65
66
67 TEST(Toto, Tutu)
68 {
69 Orthanc::WebServiceParameters web;
70 OrthancStone::OrthancWebService orthanc(web);
71 OrthancStone::OrthancFrameLayerSource source(orthanc, "befb52a6-b4b04954-b5a019c3-fdada9d7-dddc9430", 0);
72
73 OrthancStone::Tata tata;
74 source.SetObserver(tata);
75
76 OrthancStone::SliceGeometry slice;
77 source.ScheduleLayerCreation(slice);
78 }
79
80
25 81
26 int main(int argc, char **argv) 82 int main(int argc, char **argv)
27 { 83 {
28 Orthanc::Logging::Initialize(); 84 Orthanc::Logging::Initialize();
29 Orthanc::Logging::EnableInfoLevel(true); 85 Orthanc::Logging::EnableInfoLevel(true);