From 211b96045657eb9590d2d1f0586ebc5d545b9e1e Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Tue, 1 Dec 2020 08:46:40 +0100 Subject: [PATCH] Fix new layout and split view (broken since a change in Paraview API) --- src/MEDCalc/cmp/MEDPresentation.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/MEDCalc/cmp/MEDPresentation.cxx b/src/MEDCalc/cmp/MEDPresentation.cxx index ad2167020..1487a07ac 100644 --- a/src/MEDCalc/cmp/MEDPresentation.cxx +++ b/src/MEDCalc/cmp/MEDPresentation.cxx @@ -399,13 +399,23 @@ MEDPresentation::setOrCreateRenderView() oss2 << "pvs.Render();"; pushAndExecPyLine(oss2.str()); oss2.str(""); } else if (_viewMode == MEDCALC::VIEW_MODE_NEW_LAYOUT) { - oss2 << "__layout1 = pvs.servermanager.misc.ViewLayout(registrationGroup='layouts');"; + oss2 << "nbLayouts = len(pvs.GetLayouts());"; + pushAndExecPyLine(oss2.str()); oss2.str(""); + oss2 << "__layout1 = pvs.CreateLayout('Layout #\%i'%(nbLayouts+1));"; pushAndExecPyLine(oss2.str()); oss2.str(""); oss2 << view << " = pvs.CreateView('RenderView');"; pushAndExecPyLine(oss2.str()); oss2.str(""); + oss2 << "pvs.AssignViewToLayout(view=" << view << ", layout=__layout1, hint=0);"; + pushAndExecPyLine(oss2.str()); oss2.str(""); } else if (_viewMode == MEDCALC::VIEW_MODE_SPLIT_VIEW) { + oss2 << "__activeLayout = pvs.GetLayout();"; + pushAndExecPyLine(oss2.str()); oss2.str(""); + oss2 << "__activeLayout.SplitHorizontal(0, 0.5);"; + pushAndExecPyLine(oss2.str()); oss2.str(""); oss2 << view << " = pvs.CreateView('RenderView');"; pushAndExecPyLine(oss2.str()); oss2.str(""); + oss2 << "pvs.AssignViewToLayout(view=" << view << ", layout=__activeLayout, hint=2);"; + pushAndExecPyLine(oss2.str()); oss2.str(""); } } -- 2.39.2