Mercurial > hg > orthanc-stone
changeset 1897:144f8f82c15a
added ctrl key in RtViewerWasm
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 26 Jan 2022 17:28:47 +0100 |
parents | b3c08e607d9f |
children | a5e54bd87b25 |
files | Applications/Samples/WebAssembly/RtViewer/RtViewerWasm.cpp OrthancStone/Sources/Toolbox/DicomStructureSet.cpp |
diffstat | 2 files changed, 25 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/Samples/WebAssembly/RtViewer/RtViewerWasm.cpp Wed Jan 26 17:19:37 2022 +0100 +++ b/Applications/Samples/WebAssembly/RtViewer/RtViewerWasm.cpp Wed Jan 26 17:28:47 2022 +0100 @@ -80,9 +80,18 @@ int delta = 0; if (wheelEvent->deltaY < 0) + { delta = -1; - if (wheelEvent->deltaY > 0) + } + else if (wheelEvent->deltaY > 0) + { delta = 1; + } + + if (wheelEvent->mouse.ctrlKey) + { + delta *= 10; + } that->Scroll(delta);
--- a/OrthancStone/Sources/Toolbox/DicomStructureSet.cpp Wed Jan 26 17:19:37 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructureSet.cpp Wed Jan 26 17:28:47 2022 +0100 @@ -901,6 +901,21 @@ projected.push_back(CreateRectangle(x1, y1, x2, y2)); } } + + BoostMultiPolygon merged; + Union(merged, projected); + + chains.resize(merged.size()); + for (size_t i = 0; i < merged.size(); i++) + { + const std::vector<BoostPoint>& outer = merged[i].outer(); + + chains[i].resize(outer.size()); + for (size_t j = 0; j < outer.size(); j++) + { + chains[i][j] = ScenePoint2D(outer[j].x(), outer[j].y()); + } + } #else // this will contain the intersection of the polygon slab with // the cutting plane, projected on the cutting plane coord system @@ -926,9 +941,7 @@ static_cast<float>(y2)),curZ)); } } -#endif -#if USE_BOOST_UNION_FOR_POLYGONS != 1 // projected contains a set of rectangles specified by two opposite // corners (x1,y1,x2,y2) // we need to merge them @@ -986,22 +999,6 @@ chains[i][0] = segments[i].first; chains[i][1] = segments[i].second; } - -#else - BoostMultiPolygon merged; - Union(merged, projected); - - chains.resize(merged.size()); - for (size_t i = 0; i < merged.size(); i++) - { - const std::vector<BoostPoint>& outer = merged[i].outer(); - - chains[i].resize(outer.size()); - for (size_t j = 0; j < outer.size(); j++) - { - chains[i][j] = ScenePoint2D(outer[j].x(), outer[j].y()); - } - } #endif return true;