Mercurial > hg > orthanc-stone
comparison Applications/BasicApplicationContext.cpp @ 102:fcec0ab44054 wasm
display volumes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 31 May 2017 17:01:18 +0200 |
parents | f244018a4e4b |
children | 71d574a3607f |
comparison
equal
deleted
inserted
replaced
101:af312ce4fe59 | 102:fcec0ab44054 |
---|---|
78 viewport_.SetCentralWidget(widget); | 78 viewport_.SetCentralWidget(widget); |
79 return *widget; | 79 return *widget; |
80 } | 80 } |
81 | 81 |
82 | 82 |
83 VolumeImage& BasicApplicationContext::AddSeriesVolume(const std::string& series, | 83 ISlicedVolume& BasicApplicationContext::AddVolume(ISlicedVolume* volume) |
84 bool isProgressiveDownload, | |
85 size_t downloadThreadCount) | |
86 { | 84 { |
87 /*std::auto_ptr<VolumeImage> volume | 85 if (volume == NULL) |
88 (new VolumeImage(new OrthancSeriesLoader(GetWebService().GetConnection(), series))); | |
89 | |
90 if (isProgressiveDownload) | |
91 { | 86 { |
92 volume->SetDownloadPolicy(new VolumeImageProgressivePolicy); | 87 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
93 } | |
94 else | |
95 { | |
96 volume->SetDownloadPolicy(new VolumeImageSimplePolicy); | |
97 } | 88 } |
98 | 89 |
99 volume->SetThreadCount(downloadThreadCount); | 90 volumes_.push_back(volume); |
100 | 91 return *volume; |
101 VolumeImage& result = *volume; | |
102 volumes_.push_back(volume.release()); | |
103 | |
104 return result;*/ | |
105 | |
106 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); | |
107 } | 92 } |
108 | |
109 | 93 |
110 DicomStructureSet& BasicApplicationContext::AddStructureSet(const std::string& instance) | 94 DicomStructureSet& BasicApplicationContext::AddStructureSet(const std::string& instance) |
111 { | 95 { |
112 /*std::auto_ptr<DicomStructureSet> structureSet | 96 /*std::auto_ptr<DicomStructureSet> structureSet |
113 (new DicomStructureSet(GetWebService().GetConnection(), instance)); | 97 (new DicomStructureSet(GetWebService().GetConnection(), instance)); |
123 | 107 |
124 IWorldSceneInteractor& BasicApplicationContext::AddInteractor(IWorldSceneInteractor* interactor) | 108 IWorldSceneInteractor& BasicApplicationContext::AddInteractor(IWorldSceneInteractor* interactor) |
125 { | 109 { |
126 if (interactor == NULL) | 110 if (interactor == NULL) |
127 { | 111 { |
128 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | 112 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
129 } | 113 } |
130 | 114 |
131 interactors_.push_back(interactor); | 115 interactors_.push_back(interactor); |
132 | 116 |
133 return *interactor; | 117 return *interactor; |
135 | 119 |
136 | 120 |
137 void BasicApplicationContext::Start() | 121 void BasicApplicationContext::Start() |
138 { | 122 { |
139 oracle_.Start(); | 123 oracle_.Start(); |
140 | |
141 // TODO REMOVE THIS | |
142 for (Volumes::iterator it = volumes_.begin(); it != volumes_.end(); ++it) | |
143 { | |
144 assert(*it != NULL); | |
145 (*it)->Start(); | |
146 } | |
147 | 124 |
148 if (viewport_.HasUpdateContent()) | 125 if (viewport_.HasUpdateContent()) |
149 { | 126 { |
150 stopped_ = false; | 127 stopped_ = false; |
151 updateThread_ = boost::thread(UpdateThread, this); | 128 updateThread_ = boost::thread(UpdateThread, this); |
160 if (updateThread_.joinable()) | 137 if (updateThread_.joinable()) |
161 { | 138 { |
162 updateThread_.join(); | 139 updateThread_.join(); |
163 } | 140 } |
164 | 141 |
165 // TODO REMOVE THIS | |
166 for (Volumes::iterator it = volumes_.begin(); it != volumes_.end(); ++it) | |
167 { | |
168 assert(*it != NULL); | |
169 (*it)->Stop(); | |
170 } | |
171 | |
172 oracle_.Stop(); | 142 oracle_.Stop(); |
173 } | 143 } |
174 } | 144 } |