# HG changeset patch # User Sebastien Jodogne # Date 1667202914 -3600 # Node ID ba45e1b0812ac5093ac3356b238f084871c41660 # Parent c074c75cf4163efff9e4d59612706be4bad68d83 preparing interfaces for rectangle probe, ellipse probe and text annotations diff -r c074c75cf416 -r ba45e1b0812a Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp --- a/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Mon Oct 31 08:22:31 2022 +0100 +++ b/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Mon Oct 31 08:55:14 2022 +0100 @@ -80,9 +80,11 @@ << " a\tCreate angle annotations" << std::endl << " c\tCreate circle annotations" << std::endl << " d\tDelete mode for annotations" << std::endl - << " e\tEdit mode, don't create annotation (default)" << std::endl + << " e\tCreate ellipse probe" << std::endl << " l\tCreate line annotations" << std::endl + << " m\tModification/edit mode, don't create annotation (default)" << std::endl << " p\tCreate pixel probe" << std::endl + << " r\tCreate rectangle probe" << std::endl #else << " a\tEnable/disable the angle annotation tool" << std::endl << " l\tEnable/disable the line annotation tool" << std::endl @@ -302,7 +304,7 @@ #endif #if SAMPLE_USE_ANNOTATIONS_LAYER == 1 - case SDLK_e: + case SDLK_m: annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Edit); break; #endif @@ -388,6 +390,18 @@ break; #endif +#if SAMPLE_USE_ANNOTATIONS_LAYER == 1 + case SDLK_e: + annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_EllipseProbe); + break; +#endif + +#if SAMPLE_USE_ANNOTATIONS_LAYER == 1 + case SDLK_r: + annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_RectangleProbe); + break; +#endif + default: break; } diff -r c074c75cf416 -r ba45e1b0812a Applications/StoneWebViewer/WebApplication/app.js --- a/Applications/StoneWebViewer/WebApplication/app.js Mon Oct 31 08:22:31 2022 +0100 +++ b/Applications/StoneWebViewer/WebApplication/app.js Mon Oct 31 08:55:14 2022 +0100 @@ -46,7 +46,10 @@ var MOUSE_TOOL_CREATE_ANGLE = 6; var MOUSE_TOOL_CREATE_CIRCLE = 7; var MOUSE_TOOL_REMOVE_MEASURE = 8; -var MOUSE_TOOL_CREATE_PIXEL_PROBE = 9; +var MOUSE_TOOL_CREATE_PIXEL_PROBE = 9; // New in 2.4 +var MOUSE_TOOL_CREATE_ELLIPSE_PROBE = 10; // New in 2.4 +var MOUSE_TOOL_CREATE_RECTANGLE_PROBE = 11; // New in 2.4 +var MOUSE_TOOL_CREATE_TEXT_ANNOTATION = 12; // New in 2.4 function getParameterFromUrl(key) { diff -r c074c75cf416 -r ba45e1b0812a Applications/StoneWebViewer/WebApplication/index.html --- a/Applications/StoneWebViewer/WebApplication/index.html Mon Oct 31 08:22:31 2022 +0100 +++ b/Applications/StoneWebViewer/WebApplication/index.html Mon Oct 31 08:55:14 2022 +0100 @@ -504,7 +504,7 @@ v-bind:class="{ 'active' : mouseTool == MOUSE_TOOL_CREATE_SEGMENT }" v-on:click="SetLeftMouseButtonAction(MOUSE_TOOL_CREATE_SEGMENT, stone.WebViewerAction.CREATE_SEGMENT)" data-toggle="tooltip" data-title="Measure length"> - + @@ -513,7 +513,7 @@ v-bind:class="{ 'active' : mouseTool == MOUSE_TOOL_CREATE_ANGLE }" v-on:click="SetLeftMouseButtonAction(MOUSE_TOOL_CREATE_ANGLE, stone.WebViewerAction.CREATE_ANGLE)" data-toggle="tooltip" data-title="Measure angle"> - + @@ -531,7 +531,34 @@ v-bind:class="{ 'active' : mouseTool == MOUSE_TOOL_CREATE_PIXEL_PROBE }" v-on:click="SetLeftMouseButtonAction(MOUSE_TOOL_CREATE_PIXEL_PROBE, stone.WebViewerAction.CREATE_PIXEL_PROBE)" data-toggle="tooltip" data-title="Pixel probe"> - + + + + +
+ +
+ +
+ +
+ +
+
@@ -539,7 +566,7 @@ diff -r c074c75cf416 -r ba45e1b0812a Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp --- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp Mon Oct 31 08:22:31 2022 +0100 +++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp Mon Oct 31 08:55:14 2022 +0100 @@ -143,7 +143,10 @@ WebViewerAction_CreateCircle, WebViewerAction_CreateSegment, WebViewerAction_RemoveMeasure, - WebViewerAction_CreatePixelProbe + WebViewerAction_CreatePixelProbe, // New in 2.4 + WebViewerAction_CreateEllipseProbe, // New in 2.4 + WebViewerAction_CreateRectangleProbe, // New in 2.4 + WebViewerAction_CreateTextAnnotation // New in 2.4 }; @@ -171,6 +174,9 @@ case WebViewerAction_CreateSegment: case WebViewerAction_RemoveMeasure: case WebViewerAction_CreatePixelProbe: + case WebViewerAction_CreateEllipseProbe: + case WebViewerAction_CreateRectangleProbe: + case WebViewerAction_CreateTextAnnotation: return OrthancStone::MouseAction_None; default: @@ -3225,6 +3231,18 @@ viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_PixelProbe); break; + case WebViewerAction_CreateEllipseProbe: + viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_EllipseProbe); + break; + + case WebViewerAction_CreateRectangleProbe: + viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_RectangleProbe); + break; + + case WebViewerAction_CreateTextAnnotation: + viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_TextAnnotation); + break; + default: viewer_.stoneAnnotations_->SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Edit); break; diff -r c074c75cf416 -r ba45e1b0812a OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.h --- a/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.h Mon Oct 31 08:22:31 2022 +0100 +++ b/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.h Mon Oct 31 08:55:14 2022 +0100 @@ -42,7 +42,10 @@ Tool_Angle, Tool_Circle, Tool_Remove, - Tool_PixelProbe + Tool_PixelProbe, + Tool_RectangleProbe, + Tool_EllipseProbe, + Tool_TextAnnotation }; private: