comparison Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp @ 1982:ba45e1b0812a

preparing interfaces for rectangle probe, ellipse probe and text annotations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 31 Oct 2022 08:55:14 +0100
parents 0aac8f552d89
children e8b9a2ba1df1
comparison
equal deleted inserted replaced
1981:c074c75cf416 1982:ba45e1b0812a
141 141
142 WebViewerAction_CreateAngle, 142 WebViewerAction_CreateAngle,
143 WebViewerAction_CreateCircle, 143 WebViewerAction_CreateCircle,
144 WebViewerAction_CreateSegment, 144 WebViewerAction_CreateSegment,
145 WebViewerAction_RemoveMeasure, 145 WebViewerAction_RemoveMeasure,
146 WebViewerAction_CreatePixelProbe 146 WebViewerAction_CreatePixelProbe, // New in 2.4
147 WebViewerAction_CreateEllipseProbe, // New in 2.4
148 WebViewerAction_CreateRectangleProbe, // New in 2.4
149 WebViewerAction_CreateTextAnnotation // New in 2.4
147 }; 150 };
148 151
149 152
150 153
151 static OrthancStone::MouseAction ConvertWebViewerAction(int action) 154 static OrthancStone::MouseAction ConvertWebViewerAction(int action)
169 case WebViewerAction_CreateAngle: 172 case WebViewerAction_CreateAngle:
170 case WebViewerAction_CreateCircle: 173 case WebViewerAction_CreateCircle:
171 case WebViewerAction_CreateSegment: 174 case WebViewerAction_CreateSegment:
172 case WebViewerAction_RemoveMeasure: 175 case WebViewerAction_RemoveMeasure:
173 case WebViewerAction_CreatePixelProbe: 176 case WebViewerAction_CreatePixelProbe:
177 case WebViewerAction_CreateEllipseProbe:
178 case WebViewerAction_CreateRectangleProbe:
179 case WebViewerAction_CreateTextAnnotation:
174 return OrthancStone::MouseAction_None; 180 return OrthancStone::MouseAction_None;
175 181
176 default: 182 default:
177 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 183 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
178 } 184 }
3223 3229
3224 case WebViewerAction_CreatePixelProbe: 3230 case WebViewerAction_CreatePixelProbe:
3225 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_PixelProbe); 3231 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_PixelProbe);
3226 break; 3232 break;
3227 3233
3234 case WebViewerAction_CreateEllipseProbe:
3235 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_EllipseProbe);
3236 break;
3237
3238 case WebViewerAction_CreateRectangleProbe:
3239 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_RectangleProbe);
3240 break;
3241
3242 case WebViewerAction_CreateTextAnnotation:
3243 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_TextAnnotation);
3244 break;
3245
3228 default: 3246 default:
3229 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Edit); 3247 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Edit);
3230 break; 3248 break;
3231 } 3249 }
3232 3250