comparison Framework/Radiography/RadiographyWidget.cpp @ 1279:7ec8fea061b9 broker

integration mainline->broker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Feb 2020 15:20:08 +0100
parents 0ca50d275b9a 2d8ab34c8c91
children
comparison
equal deleted inserted replaced
1271:0ca50d275b9a 1279:7ec8fea061b9
74 floatBuffer_->GetWidth() != width || 74 floatBuffer_->GetWidth() != width ||
75 floatBuffer_->GetHeight() != height) 75 floatBuffer_->GetHeight() != height)
76 { 76 {
77 floatBuffer_.reset(new Orthanc::Image( 77 floatBuffer_.reset(new Orthanc::Image(
78 Orthanc::PixelFormat_Float32, width, height, false)); 78 Orthanc::PixelFormat_Float32, width, height, false));
79
80 if (floatBuffer_.get() == NULL)
81 {
82 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotEnoughMemory, "RadiographyWidget::RenderInternal: unable to allocate float buffer");
83 }
79 } 84 }
80 85
81 if (cairoBuffer_.get() == NULL || 86 if (cairoBuffer_.get() == NULL ||
82 cairoBuffer_->GetWidth() != width || 87 cairoBuffer_->GetWidth() != width ||
83 cairoBuffer_->GetHeight() != height) 88 cairoBuffer_->GetHeight() != height)
84 { 89 {
85 cairoBuffer_.reset(new CairoSurface(width, height, false /* no alpha */)); 90 cairoBuffer_.reset(new CairoSurface(width, height, false /* no alpha */));
91
92 if (cairoBuffer_.get() == NULL)
93 {
94 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotEnoughMemory, "RadiographyWidget::RenderInternal: unable to allocate cairo buffer");
95 }
86 } 96 }
87 97
88 RenderBackground(*floatBuffer_, 0.0, 65535.0); 98 RenderBackground(*floatBuffer_, 0.0, 65535.0);
89 99
90 scene_->Render(*floatBuffer_, GetView().GetMatrix(), interpolation, true); 100 scene_->Render(*floatBuffer_, GetView().GetMatrix(), interpolation, true);
186 } 196 }
187 197
188 void RadiographyWidget::Unselect() 198 void RadiographyWidget::Unselect()
189 { 199 {
190 hasSelection_ = false; 200 hasSelection_ = false;
201
202 NotifyContentChanged();
191 BroadcastMessage(SelectionChangedMessage(*this)); 203 BroadcastMessage(SelectionChangedMessage(*this));
192 } 204 }
193 205
194 bool RadiographyWidget::LookupSelectedLayer(size_t& layer) const 206 bool RadiographyWidget::LookupSelectedLayer(size_t& layer) const
195 { 207 {