Merge pull request #8882 from OPM/append_curves

Summary Multiplot: Source Stepping append curves with performance fixes
This commit is contained in:
jonjenssen 2022-05-04 13:11:04 +02:00 committed by GitHub
parent bb6ca0848d
commit 296ddbde42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 349 additions and 73 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 16 16"
style="enable-background:new 0 0 16 16;"
xml:space="preserve"
sodipodi:docname="AppendNextCurve.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
inkscape:export-filename="D:\Repos\OPM\ResInsight\ApplicationExeCode\Resources\AppendNextCurve.png"
inkscape:export-xdpi="279.2092"
inkscape:export-ydpi="279.2092"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs9"><symbol
id="FirstAid"><title
id="title4273">First Aid</title><path
d="m 44,13 0,15 15,0 0,16 -15,0 0,15 -16,0 0,-15 -15,0 0,-16 15,0 0,-15 z"
style="stroke:none"
id="path4275" /></symbol></defs><sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="36.543278"
inkscape:cx="6.0613062"
inkscape:cy="6.2254951"
inkscape:window-width="2560"
inkscape:window-height="1351"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="g7616" />
<style
type="text/css"
id="style2">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#75BEFF;}
</style>
<g
id="g7616"
inkscape:groupmode="layer"><path
class="st0"
d="M 13.9,2.8 H 2.1 L 8,13.2 Z"
id="path4" /><use
xlink:href="#FirstAid"
style="opacity:0.69;fill:#008000;stroke:#000000"
id="use6694"
x="0"
y="0"
width="100%"
height="100%"
transform="matrix(0.16145491,0,0,0.15825119,5.9080974,4.7174215)" /><path
style="fill:#0000ff;stroke:#f60000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:0.58;fill-opacity:0.01360544"
d="m 8.255911,1.5354659 c -0.050314,-0.00137 -0.341591,0.020031 -0.3783032,0.044506 -0.013801,0.0092 -0.00845,0.035306 -0.022253,0.044506 -0.03847,0.025646 -0.1316305,0.013577 -0.1780251,0.044506 -0.026185,0.017457 -0.039435,0.051146 -0.066759,0.066759 -0.038224,0.021842 -0.1151897,0.024215 -0.1557719,0.044506 -0.027662,0.013831 -0.064992,0.093251 -0.089012,0.1112657 -0.061949,0.046462 -0.1019246,0.1329691 -0.1557719,0.2002782 -0.010362,0.012952 -0.032778,0.010525 -0.044506,0.022253 -0.02414,0.02414 -0.071509,0.2145277 -0.089012,0.2670375 -0.04076,0.1222813 0.02235,0.3787897 0.044506,0.4895689 0.032115,0.1605772 0.012547,0.7513386 -0.066759,0.8901252 C 7.0245729,3.8127014 7.0035169,3.870607 6.9652319,3.9165493 6.9177425,3.9735352 6.8426451,4.000789 6.7872045,4.0500695 6.5822709,4.2322327 6.352386,4.3356351 6.0973574,4.4283727 5.9510757,4.4815661 5.8277908,4.5912886 5.6968011,4.6731572 5.561177,4.7579223 5.3684383,4.8015862 5.3184979,4.984701 c -0.05025,0.1842491 -0.063418,0.4117199 -0.044506,0.6008345 0.011312,0.1131173 0.079962,0.2071973 0.1112656,0.3115438 0.065527,0.2184234 0.1079559,0.5515384 0.089012,0.7788595 -0.013522,0.1622592 -0.07994,0.2950421 -0.1335188,0.4450626 -0.018163,0.050856 -0.019094,0.1081233 -0.044506,0.1557719 -0.034907,0.06545 -0.094205,0.115123 -0.1335188,0.178025 C 5.0568186,7.6242502 4.984193,7.822737 4.8734353,7.9888734 4.7177218,8.2224437 4.7710018,8.0686681 4.6063978,8.2781641 4.4559992,8.4695804 4.3489131,8.6723149 4.2726008,8.9012517 c -0.063911,0.191733 -0.022253,0.4455852 -0.022253,0.6453408 0,0.2236424 -0.035808,0.5417555 0,0.7566065 0.00771,0.04628 0.036114,0.08736 0.044506,0.133519 0.019395,0.10667 -0.026942,0.238234 -0.066759,0.333797 -0.072185,0.173243 -0.2096795,0.266095 -0.333797,0.400556 -0.3616343,0.39177 0.1225081,-0.110655 -0.2892906,0.35605 -0.1179896,0.133721 -0.2522022,0.252202 -0.3783032,0.378303 -0.1532224,0.153223 -0.3594091,0.29377 -0.4895689,0.467316 -0.029856,0.03981 -0.040045,0.09154 -0.066759,0.133519 -0.069929,0.109887 -0.1641021,0.194567 -0.178025,0.333797 -0.013019,0.130194 0.020516,0.13873 -0.022253,0.267037 -0.015735,0.04721 -0.054691,0.08524 -0.066759,0.133519 -0.049909,0.199637 -0.043947,0.420291 -0.089013,0.623088 -0.027497,0.123735 -0.1335188,0.08658 -0.1335188,0.178025"
id="path7358" /><path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:0.65819209"
d="m 9.8581363,1.5354659 c -0.1305326,-0.032308 -0.1205116,0.05067 -0.178025,0.089013 -0.012344,0.00823 -0.036277,-0.012344 -0.044506,0 -0.012344,0.018516 0.00995,0.046856 0,0.066759 -0.011961,0.023921 -0.051924,0.022253 -0.066759,0.044506 -0.016963,0.025444 -0.084497,0.1554492 -0.089012,0.178025 -0.00999,0.049927 0.00999,0.105845 0,0.1557719 -0.040371,0.2018541 0.00363,0.4159845 -0.022253,0.6230877 -0.010923,0.087381 -0.063341,0.1232621 -0.089013,0.2002781 -0.00967,0.029015 -0.00529,0.063565 -0.022253,0.089012 -0.035395,0.053093 -0.1106517,0.066146 -0.1557719,0.1112657 -0.06717,0.06717 -0.1108548,0.1553611 -0.178025,0.2225313 -0.033585,0.033585 -0.079492,0.053709 -0.1112657,0.089012 -0.035783,0.039759 -0.05323,0.09376 -0.089012,0.1335188 -0.031773,0.035304 -0.077681,0.055427 -0.1112656,0.089012 C 8.5434839,3.7847497 8.3351863,4.1279594 8.255911,4.3393602 8.1378191,4.6542719 8.2925667,5.0305058 8.1891516,5.340751 8.1663474,5.4091638 8.1529688,5.3815771 8.1001391,5.4520167 8.0482363,5.5212204 8.0244888,5.6102496 7.9666203,5.674548 7.7631844,5.9005879 7.4396456,6.0831566 7.2990264,6.364395 c -0.02098,0.041961 -0.023526,0.091558 -0.044506,0.1335188 -0.016586,0.033173 -0.051696,0.055121 -0.066759,0.089012 -0.087215,0.1962321 -0.033252,0.4220389 -0.06676,0.6230881 C 7.0872221,7.4126895 7.0150699,7.6114866 6.9652295,7.8108484 6.9371388,7.923211 6.9376471,8.0591616 6.8984701,8.1668985 6.8628398,8.2648817 6.7476162,8.4512711 6.6759388,8.5229485 6.6381158,8.5607716 6.5819993,8.5759799 6.54242,8.6119611 6.4342293,8.7103163 6.4141677,8.8082636 6.3421419,8.9235049 6.3001967,8.9906172 6.2121237,9.068775 6.18637,9.1460362 6.138152,9.2906916 6.16813,9.4466361 6.141864,9.5910987 c -0.00593,0.032638 -0.03731,0.056629 -0.044506,0.089013 -0.034355,0.154599 0,0.3547133 0,0.5118213 0,0.116921 0.022993,0.263337 0,0.378303 -0.01013,0.05065 -0.1562658,0.222779 -0.2002781,0.244785 -0.013269,0.0066 -0.032638,-0.0089 -0.044506,0 -0.054332,0.01207 -0.032157,0.08531 -0.066759,0.111266 -0.01681,0.01261 -0.092225,0.02229 -0.1112656,0.04451 -0.2778755,0.324188 -0.333797,0.510928 -0.333797,0.912378 0,0.355322 -0.099795,0.698198 -0.2892906,1.001391 -0.08713,0.139408 -0.049755,0.0345 -0.1112657,0.178025 -0.08333,0.194437 -0.006,0.506987 -0.089012,0.645341 -0.059223,0.0987 -0.1037008,0.185148 -0.1557719,0.28929 -0.026909,0.05382 -0.1012629,0.05676 -0.1112657,0.06676 -0.01049,0.01049 0.00663,0.03124 0,0.04451 -0.028926,0.05785 -0.063556,0.09637 -0.089012,0.155772 -0.025467,0.05942 -0.021522,0.222166 -0.022253,0.222531 -0.013269,0.0066 -0.034016,-0.01049 -0.044506,0 -0.041545,0.04155 0.028017,0.04451 -0.044506,0.04451"
id="path7426" /></g></svg>

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 16 16"
style="enable-background:new 0 0 16 16;"
xml:space="preserve"
sodipodi:docname="AppendPrevCurve.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
inkscape:export-filename="D:\Repos\OPM\ResInsight\ApplicationExeCode\Resources\AppendPrevCurve.png"
inkscape:export-xdpi="314.46732"
inkscape:export-ydpi="314.46732"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs9"><symbol
id="FirstAid"><title
id="title1005">First Aid</title><path
d="m 44,13 0,15 15,0 0,16 -15,0 0,15 -16,0 0,-15 -15,0 0,-16 15,0 0,-15 z"
style="stroke:none"
id="path1007" /></symbol></defs><sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="44.9375"
inkscape:cx="6.9763561"
inkscape:cy="6.2197497"
inkscape:window-width="2560"
inkscape:window-height="1351"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<style
type="text/css"
id="style2">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#75BEFF;}
</style>
<g
id="g4186"><path
class="st0"
d="M 2.1,13.2 H 13.9 L 8,2.8 Z"
id="path4" /><use
xlink:href="#FirstAid"
style="opacity:0.78;fill:#008000;stroke:#000000"
id="use3426"
x="0"
y="0"
width="100%"
height="100%"
transform="matrix(0.15988928,0,0,0.15002721,6.0894814,-0.96147989)" /></g><path
style="opacity:0.58;fill:#0000ff;fill-opacity:0.0136055;stroke:#f60000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 7.8833419,14.663316 c -0.05031,0.0014 -0.341591,-0.02003 -0.378303,-0.04451 -0.0138,-0.0092 -0.0084,-0.03531 -0.02225,-0.04451 -0.03847,-0.02565 -0.131631,-0.01358 -0.178025,-0.04451 -0.02619,-0.01746 -0.03944,-0.05115 -0.06676,-0.06676 -0.03822,-0.02184 -0.11519,-0.02421 -0.155772,-0.04451 -0.02766,-0.01383 -0.06499,-0.09325 -0.08901,-0.111265 -0.06195,-0.04646 -0.101925,-0.13297 -0.155772,-0.200279 -0.01036,-0.01295 -0.03278,-0.01053 -0.04451,-0.02225 -0.02414,-0.02414 -0.07151,-0.214527 -0.08901,-0.267037 -0.04076,-0.122281 0.02235,-0.37879 0.04451,-0.489569 0.03212,-0.160577 0.01255,-0.751339 -0.06676,-0.890125 -0.02967,-0.05192 -0.05073,-0.10983 -0.08901,-0.155772 -0.04749,-0.05699 -0.122587,-0.08424 -0.178028,-0.13352 -0.204933,-0.182164 -0.434818,-0.285566 -0.689847,-0.378304 -0.146281,-0.05319 -0.269566,-0.162915 -0.400556,-0.244784 -0.135624,-0.08477 -0.328363,-0.128429 -0.378303,-0.311544 -0.05025,-0.184249 -0.06342,-0.41172 -0.04451,-0.600834 0.01131,-0.113118 0.07996,-0.207198 0.111265,-0.311544 0.06553,-0.218424 0.107956,-0.5515388 0.08901,-0.7788599 -0.01352,-0.1622592 -0.07994,-0.2950421 -0.133518,-0.4450626 -0.01816,-0.050856 -0.01909,-0.1081233 -0.04451,-0.1557719 -0.03491,-0.06545 -0.09421,-0.115123 -0.133519,-0.178025 C 4.6842469,8.5745317 4.6116209,8.3760449 4.5008629,8.2099085 4.3451499,7.9763382 4.3984299,8.1301135 4.2338259,7.9206178 4.0834269,7.7292015 3.9763409,7.526467 3.9000289,7.2975302 c -0.06391,-0.191733 -0.02225,-0.4455852 -0.02225,-0.6453408 0,-0.2236424 -0.03581,-0.5417555 0,-0.7566069 0.0077,-0.04628 0.03611,-0.08736 0.04451,-0.133519 0.01939,-0.10667 -0.02694,-0.238234 -0.06676,-0.333797 -0.07218,-0.173243 -0.20968,-0.266095 -0.333797,-0.400556 -0.361635,-0.39177 0.122508,0.110655 -0.289291,-0.35605 -0.117989,-0.133721 -0.252202,-0.252202 -0.378303,-0.378303 -0.153222,-0.153223 -0.359409,-0.29377 -0.489569,-0.467316 -0.02986,-0.03981 -0.04005,-0.09154 -0.06676,-0.133519 -0.06993,-0.109887 -0.164102,-0.194567 -0.178025,-0.333797 -0.01302,-0.130194 0.02052,-0.13873 -0.02225,-0.267037 -0.01573,-0.04721 -0.05469,-0.08524 -0.06676,-0.133519 -0.04991,-0.199637 -0.04395,-0.420291 -0.08901,-0.623088 -0.0275,-0.123735 -0.133519,-0.08658 -0.133519,-0.178025"
id="path7358" /><path
style="opacity:0.658192;fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 9.4855669,14.663316 c -0.130532,0.03231 -0.120511,-0.05067 -0.178025,-0.08901 -0.01234,-0.0082 -0.03628,0.01234 -0.04451,0 -0.01234,-0.01852 0.0099,-0.04686 0,-0.06676 -0.01196,-0.02392 -0.05192,-0.02225 -0.06676,-0.04451 -0.01696,-0.02544 -0.0845,-0.155449 -0.08901,-0.178025 -0.01,-0.04993 0.01,-0.105845 0,-0.155772 -0.04037,-0.201854 0.0036,-0.415984 -0.02225,-0.623087 -0.01092,-0.08738 -0.06334,-0.123262 -0.08901,-0.200278 -0.0097,-0.02901 -0.0053,-0.06357 -0.02225,-0.08901 -0.0354,-0.05309 -0.110651,-0.06615 -0.155772,-0.111266 -0.06717,-0.06717 -0.110854,-0.155361 -0.178025,-0.222531 -0.03358,-0.03358 -0.07949,-0.05371 -0.111265,-0.08901 -0.03578,-0.03976 -0.05323,-0.09376 -0.08901,-0.133519 -0.03177,-0.0353 -0.07768,-0.05543 -0.111266,-0.08901 -0.157491,-0.157492 -0.365789,-0.500701 -0.445064,-0.712102 -0.118092,-0.314912 0.03666,-0.691146 -0.06676,-1.001391 -0.0228,-0.06841 -0.03618,-0.04083 -0.08901,-0.111266 -0.0519,-0.0692 -0.07565,-0.158232 -0.133519,-0.222531 -0.203436,-0.22604 -0.526974,-0.408609 -0.667594,-0.6898471 -0.02098,-0.041961 -0.02353,-0.091558 -0.04451,-0.1335188 -0.01659,-0.033173 -0.0517,-0.055121 -0.06676,-0.089012 -0.08722,-0.1962321 -0.03325,-0.4220389 -0.06676,-0.6230881 -0.03378,-0.2026756 -0.105931,-0.4014727 -0.155771,-0.6008345 -0.02809,-0.1123626 -0.02758,-0.2483132 -0.06676,-0.3560501 -0.03563,-0.097983 -0.150854,-0.2843726 -0.222531,-0.35605 -0.03782,-0.037823 -0.09394,-0.053031 -0.133519,-0.089013 -0.108191,-0.098355 -0.128252,-0.1963025 -0.200278,-0.3115438 -0.04195,-0.067112 -0.130018,-0.1452701 -0.155772,-0.2225313 -0.04822,-0.1446554 -0.01824,-0.3005999 -0.04451,-0.4450625 -0.0059,-0.032638 -0.03731,-0.056629 -0.04451,-0.089013 -0.03435,-0.154599 0,-0.3547133 0,-0.5118213 0,-0.116921 0.02299,-0.263337 0,-0.378303 -0.01013,-0.05065 -0.156266,-0.222779 -0.200278,-0.244785 -0.01327,-0.0066 -0.03264,0.0089 -0.04451,0 -0.05433,-0.01207 -0.03216,-0.08531 -0.06676,-0.111266 -0.01681,-0.01261 -0.09222,-0.02229 -0.111266,-0.04451 -0.277875,-0.324188 -0.333797,-0.510928 -0.333797,-0.912378 0,-0.355322 -0.0998,-0.698198 -0.28929,-1.001391 -0.08713,-0.139408 -0.04976,-0.0345 -0.111266,-0.178025 -0.08333,-0.194437 -0.006,-0.506987 -0.08901,-0.645341 -0.05922,-0.0987 -0.103701,-0.185148 -0.155772,-0.28929 -0.02691,-0.05382 -0.101263,-0.05676 -0.111266,-0.06676 -0.01049,-0.01049 0.0066,-0.03124 0,-0.04451 -0.02893,-0.05785 -0.06356,-0.09637 -0.08901,-0.155772 -0.02547,-0.05942 -0.02152,-0.222166 -0.02225,-0.222531 -0.01327,-0.0066 -0.03402,0.01049 -0.04451,0 -0.04155,-0.04155 0.02802,-0.04451 -0.04451,-0.04451"
id="path7426" /></svg>

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -263,6 +263,10 @@
<file>AppendPrev.svg</file>
<file>AppendNext.png</file>
<file>AppendPrev.png</file>
<file>AppendNextCurve.svg</file>
<file>AppendPrevCurve.svg</file>
<file>AppendNextCurve.png</file>
<file>AppendPrevCurve.png</file>
</qresource>
<qresource prefix="/Shader">
<file>fs_CellFace.glsl</file>

View File

@ -41,9 +41,17 @@ RiaPlotWindowRedrawScheduler* RiaPlotWindowRedrawScheduler::instance()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::scheduleMultiPlotWindowUpdate( RiuMultiPlotBook* plotWindow )
void RiaPlotWindowRedrawScheduler::scheduleMultiPlotBookUpdate( RiuMultiPlotBook* plotBook,
RiaDefines::MultiPlotPageUpdateType updateType )
{
m_plotWindowsToUpdate.push_back( plotWindow );
if ( m_plotBooksToUpdate.count( plotBook ) == 0 )
{
m_plotBooksToUpdate[plotBook] = updateType;
}
else
{
m_plotBooksToUpdate[plotBook] = m_plotBooksToUpdate[plotBook] | updateType;
}
startTimer( 0 );
}
@ -90,7 +98,7 @@ void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
}
m_plotWidgetsToReplot.clear();
m_plotPagesToUpdate.clear();
m_plotWindowsToUpdate.clear();
m_plotBooksToUpdate.clear();
}
//--------------------------------------------------------------------------------------------------
@ -98,30 +106,28 @@ void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots()
{
std::vector<QPointer<RiuMultiPlotBook>> plotWindowsToUpdate;
std::map<QPointer<RiuMultiPlotBook>, RiaDefines::MultiPlotPageUpdateType> plotBooksToUpdate;
std::vector<QPointer<RiuPlotWidget>> plotWidgetsToReplot;
std::map<QPointer<RiuMultiPlotPage>, RiaDefines::MultiPlotPageUpdateType> pagesToUpdate;
pagesToUpdate.swap( m_plotPagesToUpdate );
plotWindowsToUpdate.swap( m_plotWindowsToUpdate );
plotBooksToUpdate.swap( m_plotBooksToUpdate );
plotWidgetsToReplot.swap( m_plotWidgetsToReplot );
std::set<QPointer<RiuPlotWidget>> updatedPlots;
std::set<QPointer<RiuMultiPlotBook>> updatedPlotWindows;
std::set<QPointer<RiuPlotWidget>> updatedPlots;
for ( QPointer<RiuMultiPlotBook> plotWindow : plotWindowsToUpdate )
for ( auto& [plotBook, updateType] : plotBooksToUpdate )
{
if ( !plotWindow.isNull() && !updatedPlotWindows.count( plotWindow ) )
if ( plotBook.isNull() ) continue;
if ( ( updateType & RiaDefines::MultiPlotPageUpdateType::PLOT ) == RiaDefines::MultiPlotPageUpdateType::PLOT )
{
for ( RiuMultiPlotPage* page : plotWindow->pages() )
for ( RiuMultiPlotPage* page : plotBook->pages() )
{
if ( pagesToUpdate.count( page ) > 0 ) pagesToUpdate.erase( page );
}
const bool regeneratePages = true;
plotWindow->performUpdate( regeneratePages );
updatedPlotWindows.insert( plotWindow );
}
plotBook->performUpdate( updateType );
}
for ( auto& [page, updateType] : pagesToUpdate )

View File

@ -40,7 +40,9 @@ class RiaPlotWindowRedrawScheduler : public QObject
public:
static RiaPlotWindowRedrawScheduler* instance();
void scheduleMultiPlotWindowUpdate( RiuMultiPlotBook* plotWindow );
void scheduleMultiPlotBookUpdate(
RiuMultiPlotBook* plotWindow,
RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL );
void scheduleMultiPlotPageUpdate(
RiuMultiPlotPage* plotWindow,
RiaDefines::MultiPlotPageUpdateType updateType = RiaDefines::MultiPlotPageUpdateType::ALL );
@ -59,9 +61,9 @@ private:
private:
std::map<QPointer<RiuMultiPlotPage>, RiaDefines::MultiPlotPageUpdateType> m_plotPagesToUpdate;
std::map<QPointer<RiuMultiPlotBook>, RiaDefines::MultiPlotPageUpdateType> m_plotBooksToUpdate;
std::vector<QPointer<RiuPlotWidget>> m_plotWidgetsToReplot;
std::vector<QPointer<RiuMultiPlotBook>> m_plotWindowsToUpdate;
std::vector<QPointer<RiuPlotWidget>> m_plotWidgetsToReplot;
QScopedPointer<QTimer> m_plotWindowUpdateTimer;
};

View File

@ -57,8 +57,6 @@ void RicAppendSummaryCurvesForObjectsFeature::onActionTriggered( bool isChecked
auto selectionType = sumAddressCollections.front()->contentType();
auto sourcePlots = summaryMultiPlot->summaryPlots();
auto plotsForOneInstance =
RicAppendSummaryPlotsForObjectsFeature::plotsForOneInstanceOfObjectType( sourcePlots, selectionType );
std::vector<caf::PdmObjectHandle*> pdmObjects;
for ( auto summaryAdrCollection : sumAddressCollections )
@ -70,8 +68,6 @@ void RicAppendSummaryCurvesForObjectsFeature::onActionTriggered( bool isChecked
{
plot->handleDroppedObjects( pdmObjects );
}
summaryMultiPlot->loadDataAndUpdate();
}
//--------------------------------------------------------------------------------------------------

View File

@ -29,7 +29,8 @@
//--------------------------------------------------------------------------------------------------
void RimDataSourceSteppingTools::modifyCurrentIndex( caf::PdmValueField* valueField,
const QList<caf::PdmOptionItemInfo>& options,
int indexOffset )
int indexOffset,
bool notifyChange )
{
if ( valueField && !options.isEmpty() )
{
@ -65,7 +66,7 @@ void RimDataSourceSteppingTools::modifyCurrentIndex( caf::PdmValueField*
{
QVariant newValue = options[nextIndex].value();
valueField->setFromQVariant( newValue );
valueField->uiCapability()->notifyFieldChanged( currentValue, newValue );
if ( notifyChange ) valueField->uiCapability()->notifyFieldChanged( currentValue, newValue );
}
}
}

View File

@ -31,7 +31,8 @@ class RimDataSourceSteppingTools
public:
static void modifyCurrentIndex( caf::PdmValueField* valueField,
const QList<caf::PdmOptionItemInfo>& options,
int indexOffset );
int indexOffset,
bool notifyChange = true );
static bool updateAddressIfMatching( const QVariant& oldValue,
const QVariant& newValue,

View File

@ -176,6 +176,7 @@ QString RimMultiPlot::multiPlotTitle() const
void RimMultiPlot::setMultiPlotTitle( const QString& title )
{
m_plotWindowTitle = title;
if ( !m_viewer.isNull() ) m_viewer->setPlotTitle( title );
}
//--------------------------------------------------------------------------------------------------

View File

@ -72,8 +72,9 @@ public:
virtual void removePlotNoUpdate( RimPlot* plot );
virtual void updateAfterPlotRemove();
void deleteAllPlots() override;
void updatePlots();
void deleteAllPlots() override;
void updatePlots();
virtual void updatePlotWindowTitle();
size_t plotCount() const override;
size_t plotIndex( const RimPlot* plot ) const;
@ -136,8 +137,7 @@ protected:
void updateZoom();
void recreatePlotWidgets();
virtual void updatePlotWindowTitle();
void onPlotAdditionOrRemoval();
void onPlotAdditionOrRemoval();
bool isMouseCursorInsidePlot();

View File

@ -131,6 +131,16 @@ RimSummaryMultiPlot::RimSummaryMultiPlot()
m_appendPrevPlot.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
m_appendPrevPlot.uiCapability()->setUiIconFromResourceString( ":/AppendPrev.png" );
CAF_PDM_InitField( &m_appendNextCurve, "AppendNextCurve", false, "", "", "Step Next and Add Curve to Plot" );
m_appendNextCurve.xmlCapability()->disableIO();
m_appendNextCurve.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
m_appendNextCurve.uiCapability()->setUiIconFromResourceString( ":/AppendNextCurve.png" );
CAF_PDM_InitField( &m_appendPrevCurve, "AppendPrevCurve", false, "", "", "Step Previous and Add Curve to Plot" );
m_appendPrevCurve.xmlCapability()->disableIO();
m_appendPrevCurve.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
m_appendPrevCurve.uiCapability()->setUiIconFromResourceString( ":/AppendPrevCurve.png" );
CAF_PDM_InitField( &m_linkSubPlotAxes, "LinkSubPlotAxes", true, "Link Sub Plot Axes" );
CAF_PDM_InitField( &m_autoAdjustAppearance, "AutoAdjustAppearance", false, "Auto Adjust Appearance" );
@ -408,6 +418,18 @@ void RimSummaryMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
int stepDirection = -1;
appendSubPlotByStepping( stepDirection );
}
else if ( changedField == &m_appendNextCurve )
{
m_appendNextCurve = false;
int stepDirection = 1;
appendCurveByStepping( stepDirection );
}
else if ( changedField == &m_appendPrevCurve )
{
m_appendPrevCurve = false;
int stepDirection = -1;
appendCurveByStepping( stepDirection );
}
else if ( changedField == &m_autoAdjustAppearance )
{
checkAndApplyAutoAppearance();
@ -526,6 +548,9 @@ std::vector<caf::PdmFieldHandle*> RimSummaryMultiPlot::fieldsToShowInToolbar()
toolBarFields.push_back( &m_appendPrevPlot );
toolBarFields.push_back( &m_appendNextPlot );
toolBarFields.push_back( &m_appendPrevCurve );
toolBarFields.push_back( &m_appendNextCurve );
auto multiFields = RimMultiPlot::fieldsToShowInToolbar();
toolBarFields.insert( std::end( toolBarFields ), std::begin( multiFields ), std::end( multiFields ) );
@ -1069,6 +1094,44 @@ void RimSummaryMultiPlot::appendSubPlotByStepping( int direction )
RiuPlotMainWindowTools::refreshToolbars();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryMultiPlot::appendCurveByStepping( int direction )
{
for ( auto plot : summaryPlots() )
{
std::vector<caf::PdmObjectHandle*> addresses;
for ( auto curve : plot->allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ) )
{
auto address = curve->summaryAddressY();
auto sumCase = curve->summaryCaseY();
address = m_sourceStepping->stepAddress( address, direction );
addresses.push_back( RimSummaryAddress::wrapFileReaderAddress( address, sumCase->caseId() ) );
}
for ( auto curveSet : plot->curveSets() )
{
auto address = curveSet->summaryAddress();
auto sumEns = curveSet->summaryCaseCollection();
address = m_sourceStepping->stepAddress( address, direction );
addresses.push_back( RimSummaryAddress::wrapFileReaderAddress( address, -1, sumEns->ensembleId() ) );
}
plot->handleDroppedObjects( addresses );
for ( auto adr : addresses )
{
delete adr;
}
}
m_sourceStepping->updateStepIndex( direction );
RiuPlotMainWindowTools::refreshToolbars();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -79,6 +79,7 @@ public:
void removePlotNoUpdate( RimPlot* plot ) override;
void updateAfterPlotRemove() override;
void updatePlotWindowTitle() override;
std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar() override;
@ -118,13 +119,13 @@ private:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void populateNameHelper( RimSummaryPlotNameHelper* nameHelper );
void updatePlotWindowTitle() override;
void computeAggregatedAxisRange();
void updateSourceStepper();
void duplicate();
void appendSubPlotByStepping( int direction );
void appendCurveByStepping( int direction );
void analyzePlotsAndAdjustAppearanceSettings();
@ -142,6 +143,9 @@ private:
caf::PdmField<bool> m_appendNextPlot;
caf::PdmField<bool> m_appendPrevPlot;
caf::PdmField<bool> m_appendNextCurve;
caf::PdmField<bool> m_appendPrevCurve;
caf::PdmField<caf::AppEnum<AxisRangeAggregation>> m_axisRangeAggregation;
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_sourceStepping;

View File

@ -2043,20 +2043,60 @@ std::pair<int, std::vector<RimSummaryCurve*>> RimSummaryPlot::handleSummaryAddre
if ( summaryAddr->isEnsemble() )
{
std::map<RifEclipseSummaryAddress, std::set<RimSummaryCaseCollection*>> dataVectorMap;
for ( auto& curve : curveSets() )
{
const auto curveAddress = curve->summaryAddress();
dataVectorMap[curveAddress].insert( curve->summaryCaseCollection() );
}
auto ensemble = RiaSummaryTools::ensembleById( summaryAddr->ensembleId() );
if ( ensemble )
{
addNewEnsembleCurveY( summaryAddr->address(), ensemble );
newCurves++;
RifEclipseSummaryAddress droppedAddress = summaryAddr->address();
bool skipAddress = false;
if ( dataVectorMap.count( droppedAddress ) > 0 )
{
skipAddress = ( dataVectorMap[droppedAddress].count( ensemble ) > 0 );
}
if ( !skipAddress )
{
addNewEnsembleCurveY( droppedAddress, ensemble );
newCurves++;
}
}
}
else
{
std::map<RifEclipseSummaryAddress, std::set<RimSummaryCase*>> dataVectorMap;
for ( auto& curve : summaryCurves() )
{
const auto curveAddress = curve->summaryAddressY();
dataVectorMap[curveAddress].insert( curve->summaryCaseY() );
}
auto summaryCase = RiaSummaryTools::summaryCaseById( summaryAddr->caseId() );
if ( summaryCase )
{
curves.push_back( addNewCurveY( summaryAddr->address(), summaryCase ) );
newCurves++;
RifEclipseSummaryAddress droppedAddress = summaryAddr->address();
bool skipAddress = false;
if ( dataVectorMap.count( droppedAddress ) > 0 )
{
skipAddress = ( dataVectorMap[droppedAddress].count( summaryCase ) > 0 );
}
if ( !skipAddress )
{
curves.push_back( addNewCurveY( droppedAddress, summaryCase ) );
newCurves++;
}
}
}
return { newCurves, curves };

View File

@ -516,6 +516,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
if ( summaryMultiPlot )
{
summaryMultiPlot->updatePlots();
summaryMultiPlot->updatePlotWindowTitle();
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateMultiPlotToolBar();
}
@ -883,11 +884,11 @@ bool RimSummaryPlotSourceStepping::isYAxisStepping() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotSourceStepping::modifyCurrentIndex( caf::PdmValueField* valueField, int indexOffset )
void RimSummaryPlotSourceStepping::modifyCurrentIndex( caf::PdmValueField* valueField, int indexOffset, bool notifyChange )
{
bool useOptionsOnly;
QList<caf::PdmOptionItemInfo> options = calculateValueOptions( valueField, &useOptionsOnly );
RimDataSourceSteppingTools::modifyCurrentIndex( valueField, options, indexOffset );
RimDataSourceSteppingTools::modifyCurrentIndex( valueField, options, indexOffset, notifyChange );
}
//--------------------------------------------------------------------------------------------------
@ -1285,3 +1286,15 @@ RimSummaryCaseCollection* RimSummaryPlotSourceStepping::stepEnsemble( int direct
return m_ensemble;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotSourceStepping::updateStepIndex( int direction )
{
caf::PdmValueField* valueField = fieldToModify();
if ( !valueField ) return;
bool notifyChange = false;
modifyCurrentIndex( valueField, direction, notifyChange );
}

View File

@ -75,6 +75,8 @@ public:
RimSummaryPlotSourceStepping::SourceSteppingDimension stepDimension() const;
void updateStepIndex( int direction );
private:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
@ -102,7 +104,7 @@ private:
bool isXAxisStepping() const;
bool isYAxisStepping() const;
void modifyCurrentIndex( caf::PdmValueField* valueField, int indexOffset );
void modifyCurrentIndex( caf::PdmValueField* valueField, int indexOffset, bool notifyChange = true );
std::vector<RimSummaryCase*> summaryCasesForSourceStepping();

View File

@ -218,19 +218,6 @@ void RiuMultiPlotBook::removeAllPlots()
void RiuMultiPlotBook::setPlotTitle( const QString& plotTitle )
{
m_plotTitle = plotTitle;
for ( int i = 0; i < m_pages.size(); ++i )
{
int pageIndex = i + 1;
int pageCount = (int)m_pages.size();
if ( pageCount > pageIndex )
{
m_pages[i]->setPlotTitle( QString( "%1 %2/%3" ).arg( m_plotTitle ).arg( i + 1 ).arg( m_pages.size() ) );
}
else
{
m_pages[i]->setPlotTitle( QString( "%1" ).arg( m_plotTitle ) );
}
}
}
//--------------------------------------------------------------------------------------------------
@ -266,6 +253,7 @@ void RiuMultiPlotBook::scheduleTitleUpdate()
{
page->scheduleUpdate( RiaDefines::MultiPlotPageUpdateType::TITLE );
}
scheduleUpdate( RiaDefines::MultiPlotPageUpdateType::TITLE );
}
//--------------------------------------------------------------------------------------------------
@ -333,9 +321,9 @@ void RiuMultiPlotBook::setPagePreviewModeEnabled( bool previewMode )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotBook::scheduleUpdate()
void RiuMultiPlotBook::scheduleUpdate( RiaDefines::MultiPlotPageUpdateType whatToUpdate )
{
RiaPlotWindowRedrawScheduler::instance()->scheduleMultiPlotWindowUpdate( this );
RiaPlotWindowRedrawScheduler::instance()->scheduleMultiPlotBookUpdate( this, whatToUpdate );
}
//--------------------------------------------------------------------------------------------------
@ -410,8 +398,8 @@ void RiuMultiPlotBook::showEvent( QShowEvent* event )
{
m_goToPageAfterUpdate = true;
QWidget::showEvent( event );
const bool regeneratePages = false;
performUpdate( regeneratePages );
performUpdate( RiaDefines::MultiPlotPageUpdateType::ALL );
if ( m_previewMode )
{
applyPagePreviewBookSize( width() );
@ -501,16 +489,22 @@ bool RiuMultiPlotBook::showYAxis( int row, int column ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotBook::performUpdate( bool regeneratePages )
void RiuMultiPlotBook::performUpdate( RiaDefines::MultiPlotPageUpdateType whatToUpdate )
{
if ( !m_plotDefinition || !m_plotDefinition->isValid() ) return;
applyLook();
if ( regeneratePages || m_pages.size() == 0 )
if ( ( ( whatToUpdate & RiaDefines::MultiPlotPageUpdateType::PLOT ) == RiaDefines::MultiPlotPageUpdateType::PLOT ) ||
m_pages.size() == 0 )
{
deleteAllPages();
createPages();
}
else if ( ( whatToUpdate & RiaDefines::MultiPlotPageUpdateType::TITLE ) == RiaDefines::MultiPlotPageUpdateType::TITLE )
{
updatePageTitles();
}
updateGeometry();
RimSummaryMultiPlot* multiPlot = dynamic_cast<RimSummaryMultiPlot*>( m_plotDefinition.p() );
@ -524,6 +518,27 @@ void RiuMultiPlotBook::performUpdate( bool regeneratePages )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotBook::updatePageTitles()
{
if ( m_pages.isEmpty() ) return;
if ( m_pages.size() > 1 )
{
for ( int i = 0; i < m_pages.size(); ++i )
{
int pageNumber = i + 1;
m_pages[i]->setPlotTitle( QString( "%1 %2/%3" ).arg( m_plotTitle ).arg( pageNumber ).arg( m_pages.size() ) );
}
}
else
{
m_pages[0]->setPlotTitle( QString( "%1" ).arg( m_plotTitle ) );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -603,14 +618,8 @@ void RiuMultiPlotBook::createPages()
}
// Set page numbers in title when there's more than one page
if ( m_pages.size() > 1 )
{
for ( int i = 0; i < m_pages.size(); ++i )
{
int pageNumber = i + 1;
m_pages[i]->setPlotTitle( QString( "%1 %2/%3" ).arg( m_plotTitle ).arg( pageNumber ).arg( m_pages.size() ) );
}
}
updatePageTitles();
adjustBookFrame();
}

View File

@ -80,7 +80,7 @@ public:
bool pagePreviewModeEnabled() const;
void setPagePreviewModeEnabled( bool previewMode );
void scheduleUpdate();
void scheduleUpdate( RiaDefines::MultiPlotPageUpdateType whatToUpdate = RiaDefines::MultiPlotPageUpdateType::ALL );
void scheduleReplotOfAllPlots();
void renderTo( QPaintDevice* painter );
@ -123,6 +123,8 @@ protected:
const QList<QPointer<RiuMultiPlotPage>>& pages() const;
void updatePageTitles();
private:
RiuMultiPlotPage* createPage();
void deleteAllPages();
@ -131,7 +133,7 @@ private:
void changeCurrentPage( int pageNumber );
private slots:
virtual void performUpdate( bool regeneratePages );
virtual void performUpdate( RiaDefines::MultiPlotPageUpdateType updateType );
protected:
friend class RiaPlotWindowRedrawScheduler;

View File

@ -84,14 +84,7 @@ void RiuSummaryMultiPlotBook::createPages()
}
// Set page numbers in title when there's more than one page
if ( m_pages.size() > 1 )
{
for ( int i = 0; i < m_pages.size(); ++i )
{
int pageNumber = i + 1;
m_pages[i]->setPlotTitle( QString( "%1 %2/%3" ).arg( m_plotTitle ).arg( pageNumber ).arg( m_pages.size() ) );
}
}
updatePageTitles();
adjustBookFrame();
}