comparison Samples/WebAssembly/BasicMPR.cpp @ 1299:c38c89684d83 broker

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 17:21:24 +0100
parents 2d8ab34c8c91
children
comparison
equal deleted inserted replaced
1297:6ab03e429f06 1299:c38c89684d83
36 { 36 {
37 class VolumeSlicerWidget : public IObserver 37 class VolumeSlicerWidget : public IObserver
38 { 38 {
39 private: 39 private:
40 OrthancStone::WebAssemblyViewport viewport_; 40 OrthancStone::WebAssemblyViewport viewport_;
41 std::auto_ptr<VolumeSceneLayerSource> source_; 41 std::unique_ptr<VolumeSceneLayerSource> source_;
42 VolumeProjection projection_; 42 VolumeProjection projection_;
43 std::vector<CoordinateSystem3D> planes_; 43 std::vector<CoordinateSystem3D> planes_;
44 size_t currentPlane_; 44 size_t currentPlane_;
45 45
46 void Handle(const DicomVolumeImage::GeometryReadyMessage& message) 46 void Handle(const DicomVolumeImage::GeometryReadyMessage& message)
153 153
154 boost::shared_ptr<OrthancStone::DicomVolumeImage> ct_(new OrthancStone::DicomVolumeImage); 154 boost::shared_ptr<OrthancStone::DicomVolumeImage> ct_(new OrthancStone::DicomVolumeImage);
155 155
156 boost::shared_ptr<OrthancStone::OrthancSeriesVolumeProgressiveLoader> loader_; 156 boost::shared_ptr<OrthancStone::OrthancSeriesVolumeProgressiveLoader> loader_;
157 157
158 std::auto_ptr<OrthancStone::VolumeSlicerWidget> widget1_; 158 std::unique_ptr<OrthancStone::VolumeSlicerWidget> widget1_;
159 std::auto_ptr<OrthancStone::VolumeSlicerWidget> widget2_; 159 std::unique_ptr<OrthancStone::VolumeSlicerWidget> widget2_;
160 std::auto_ptr<OrthancStone::VolumeSlicerWidget> widget3_; 160 std::unique_ptr<OrthancStone::VolumeSlicerWidget> widget3_;
161 161
162 OrthancStone::MessageBroker broker_; 162 OrthancStone::MessageBroker broker_;
163 OrthancStone::WebAssemblyOracle oracle_(broker_); 163 OrthancStone::WebAssemblyOracle oracle_(broker_);
164 164
165 165
369 369
370 loader_.reset(new OrthancStone::OrthancSeriesVolumeProgressiveLoader(ct_, oracle_, oracle_)); 370 loader_.reset(new OrthancStone::OrthancSeriesVolumeProgressiveLoader(ct_, oracle_, oracle_));
371 371
372 widget1_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas1", OrthancStone::VolumeProjection_Axial)); 372 widget1_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas1", OrthancStone::VolumeProjection_Axial));
373 { 373 {
374 std::auto_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); 374 std::unique_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator);
375 style->SetLinearInterpolation(true); 375 style->SetLinearInterpolation(true);
376 style->SetWindowing(OrthancStone::ImageWindowing_Bone); 376 style->SetWindowing(OrthancStone::ImageWindowing_Bone);
377 widget1_->SetSlicer(0, loader_, *loader_, style.release()); 377 widget1_->SetSlicer(0, loader_, *loader_, style.release());
378 } 378 }
379 widget1_->UpdateSize(); 379 widget1_->UpdateSize();
380 380
381 widget2_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas2", OrthancStone::VolumeProjection_Coronal)); 381 widget2_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas2", OrthancStone::VolumeProjection_Coronal));
382 { 382 {
383 std::auto_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); 383 std::unique_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator);
384 style->SetLinearInterpolation(true); 384 style->SetLinearInterpolation(true);
385 style->SetWindowing(OrthancStone::ImageWindowing_Bone); 385 style->SetWindowing(OrthancStone::ImageWindowing_Bone);
386 widget2_->SetSlicer(0, loader_, *loader_, style.release()); 386 widget2_->SetSlicer(0, loader_, *loader_, style.release());
387 } 387 }
388 widget2_->UpdateSize(); 388 widget2_->UpdateSize();
389 389
390 widget3_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas3", OrthancStone::VolumeProjection_Sagittal)); 390 widget3_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas3", OrthancStone::VolumeProjection_Sagittal));
391 { 391 {
392 std::auto_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); 392 std::unique_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator);
393 style->SetLinearInterpolation(true); 393 style->SetLinearInterpolation(true);
394 style->SetWindowing(OrthancStone::ImageWindowing_Bone); 394 style->SetWindowing(OrthancStone::ImageWindowing_Bone);
395 widget3_->SetSlicer(0, loader_, *loader_, style.release()); 395 widget3_->SetSlicer(0, loader_, *loader_, style.release());
396 } 396 }
397 widget3_->UpdateSize(); 397 widget3_->UpdateSize();