comparison Framework/Radiography/RadiographyDicomLayer.cpp @ 1272:a989c7d46b9a

options to avoid multiple LayerEditedMessage
author Alain Mazy <alain@mazy.be>
date Mon, 03 Feb 2020 14:56:56 +0100
parents ab958fd99b07
children 7ec8fea061b9 1c7ae79c426d
comparison
equal deleted inserted replaced
1259:69177b10e2b9 1272:a989c7d46b9a
110 ApplyConverter(); 110 ApplyConverter();
111 111
112 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); 112 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
113 } 113 }
114 114
115 void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY) // Takes ownership 115 void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY, bool emitLayerEditedEvent) // Takes ownership
116 { 116 {
117 std::auto_ptr<Orthanc::ImageAccessor> raii(image); 117 std::auto_ptr<Orthanc::ImageAccessor> raii(image);
118 118
119 if (image == NULL) 119 if (image == NULL)
120 { 120 {
121 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); 121 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
122 } 122 }
123 123
124 SetSize(image->GetWidth(), image->GetHeight()); 124 SetSize(image->GetWidth(), image->GetHeight(), false);
125 125
126 source_ = raii; 126 source_ = raii;
127 ApplyConverter(); 127 ApplyConverter();
128 128
129 SetPixelSpacing(newPixelSpacingX, newPixelSpacingY, false); 129 SetPixelSpacing(newPixelSpacingX, newPixelSpacingY, false);
130 130
131 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); 131 if (emitLayerEditedEvent)
132 {
133 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
134 }
132 } 135 }
133 136
134 137
135 void RadiographyDicomLayer::SetDicomFrameConverter(Deprecated::DicomFrameConverter* converter) 138 void RadiographyDicomLayer::SetDicomFrameConverter(Deprecated::DicomFrameConverter* converter)
136 { 139 {