Mercurial > hg > orthanc-stone
comparison Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp @ 1975:5a434f5889f8
starting pixel probe
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 29 Oct 2022 11:57:00 +0200 |
parents | 33d2ff1aeaae |
children | d71acf30970a |
comparison
equal
deleted
inserted
replaced
1974:446e0d3e9019 | 1975:5a434f5889f8 |
---|---|
140 WebViewerAction_Crosshair, | 140 WebViewerAction_Crosshair, |
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 }; | 147 }; |
147 | 148 |
148 | 149 |
149 | 150 |
150 static OrthancStone::MouseAction ConvertWebViewerAction(int action) | 151 static OrthancStone::MouseAction ConvertWebViewerAction(int action) |
2559 emscripten_set_wheel_callback(viewport_->GetCanvasCssSelector().c_str(), this, true, OnWheel); | 2560 emscripten_set_wheel_callback(viewport_->GetCanvasCssSelector().c_str(), this, true, OnWheel); |
2560 | 2561 |
2561 SetWindowingPreset(); | 2562 SetWindowingPreset(); |
2562 | 2563 |
2563 stoneAnnotations_.reset(new OrthancStone::AnnotationsSceneLayer(LAYER_ANNOTATIONS_STONE)); | 2564 stoneAnnotations_.reset(new OrthancStone::AnnotationsSceneLayer(LAYER_ANNOTATIONS_STONE)); |
2565 stoneAnnotations_->SetProbedLayer(LAYER_TEXTURE); | |
2564 } | 2566 } |
2565 | 2567 |
2566 | 2568 |
2567 void Handle(const OrthancStone::ViewportController::GrayscaleWindowingChanged& message) | 2569 void Handle(const OrthancStone::ViewportController::GrayscaleWindowingChanged& message) |
2568 { | 2570 { |
3209 case WebViewerAction_CreateCircle: | 3211 case WebViewerAction_CreateCircle: |
3210 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Circle); | 3212 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Circle); |
3211 break; | 3213 break; |
3212 | 3214 |
3213 case WebViewerAction_CreateSegment: | 3215 case WebViewerAction_CreateSegment: |
3214 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Segment); | 3216 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_PixelProbe); |
3215 break; | 3217 break; |
3216 | 3218 |
3217 case WebViewerAction_RemoveMeasure: | 3219 case WebViewerAction_RemoveMeasure: |
3218 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Remove); | 3220 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Remove); |
3221 break; | |
3222 | |
3223 case WebViewerAction_CreatePixelProbe: | |
3224 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_PixelProbe); | |
3219 break; | 3225 break; |
3220 | 3226 |
3221 default: | 3227 default: |
3222 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Edit); | 3228 viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Edit); |
3223 break; | 3229 break; |