Commit 6dc10e79 authored by Mathieu Westphal's avatar Mathieu Westphal Committed by Kitware Robot
Browse files

Merge topic 'override_fix'

3c78b13b dding a test
40952014 Adding an example
fff0762e Checking a fix for override
fe20abfb

 Fix a segfault on duplicated xml prop
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Timothee Chabat's avatarTimothee Chabat <timothee.chabat@kitware.com>
Acked-by: Nicolas Vuaille's avatarNicolas Vuaille <nicolas.vuaille@kitware.com>
Merge-request: !5224
parents 3766d3e3 3c78b13b
Pipeline #248284 failed with stages
in 230 minutes and 42 seconds
......@@ -52,6 +52,7 @@ ExternalData_Expand_Arguments(ParaViewData _
"DATA{${paraview_test_data_directory_input}/Data/MultiBlockWithPieces_1_0.vtp}"
"DATA{${paraview_test_data_directory_input}/Data/NE2_ps_bath.png}"
"DATA{${paraview_test_data_directory_input}/Data/OMETIFF/multi-channel-time-series.ome.tif}"
"DATA{${paraview_test_data_directory_input}/Data/OverridePropertyPlugin.xml}"
"DATA{${paraview_test_data_directory_input}/Data/PlotOverLineLegacy.pvsm}"
"DATA{${paraview_test_data_directory_input}/Data/PropertyLink.pvsm}"
"DATA{${paraview_test_data_directory_input}/Data/RectGrid2.vtk}"
......@@ -620,6 +621,7 @@ SET (TESTS_WITHOUT_BASELINES
ModifyGUIWindowTitle.xml
OpacityWidgetRange.xml
OpenHelp.xml
OverrideProperty.xml
PartialArrayInLineChart.xml
PlotOverLineLegacy.xml
PointCellDataConversion.xml
......
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuTools" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionManage_Plugins" />
<pqevent object="pqClientMainWindow/PluginManagerDialog/splitter/localGroup/loadLocal" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/PluginManagerDialog/pqFileDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/Testing/Data/OverridePropertyPlugin.xml" />
<pqevent object="pqClientMainWindow/PluginManagerDialog/buttonBox/1QPushButton0" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
<pqevent object="pqClientMainWindow/menubar/menuSources/Alphabetical" command="activate" arguments="RTAnalyticSource" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuFilters" />
<pqevent object="pqClientMainWindow/menubar/menuFilters/Alphabetical" command="activate" arguments="MySliceFilter" />
<pqcheck object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/CutFunction/ProxySelectionWidget/comboBox" property="currentText" arguments="Box" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar" command="set_tab_with_text" arguments="+" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar" command="set_tab_with_text" arguments="Layout #2" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget2/Container/Frame.0/CentralWidgetFrame/EmptyView/scrollArea/qt_scrollarea_viewport/widgetFoo/ConvertActionsFrame/MyXYChartView" command="activate" arguments="" />
<pqcheck object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/ViewFrame/ProxyPanel/ChartTitle/ChartTitle" property="text" arguments="My Very Own Title" />
</pqevents>
......@@ -32,5 +32,22 @@
</PropertyGroup>
</ContextViewProxy>
</ProxyGroup>
<ProxyGroup name="filters">
<SourceProxy name="MySliceFilter" label="MySlice"
class="vtkPVMetaSliceDataSet"
base_proxygroup="filters"
base_proxyname="Cut">
<ProxyProperty command="SetDataSetCutFunction"
label="Slice Type"
override="1"
name="CutFunction">
<ProxyListDomain name="proxy_list">
<Group name="slice_implicit_functions" default="Box" />
</ProxyListDomain>
<Documentation>This property sets the parameters of the slice
function.</Documentation>
</ProxyProperty>
</SourceProxy>
</ProxyGroup>
</ServerManagerConfiguration>
</ParaViewPlugin>
......@@ -55,6 +55,8 @@ class vtkSIProxyDefinitionManager::vtkInternals
public:
// Keep State Flag of the ProcessType
bool EnableXMLProxyDefinitionUpdate;
// To know if override need to be taken into account and replaced in the parent
bool ReplaceOverrideInParent;
// Keep track of ServerManager definition
StrToStrToXmlMap CoreDefinitions;
// Keep track of custom definition
......@@ -62,6 +64,7 @@ public:
//-------------------------------------------------------------------------
vtkInternals()
: EnableXMLProxyDefinitionUpdate(true)
, ReplaceOverrideInParent(true)
{
}
//-------------------------------------------------------------------------
......@@ -1001,7 +1004,7 @@ void vtkSIProxyDefinitionManager::MergeProxyDefinition(
<< "#####################################" << endl);
return;
}
else
else if (this->Internals->ReplaceOverrideInParent)
{
// Replace the overriden sub proxy definition by the new one
vtkPVXMLElement* subProxyDefToRemove = subProxyToFill[name].GetPointer();
......@@ -1022,18 +1025,20 @@ void vtkSIProxyDefinitionManager::MergeProxyDefinition(
std::string name = mapIter->first;
if (propertiesSrc.find(name) != propertiesSrc.end())
{
if (!propertiesSrc[name]->GetAttribute("override") &&
!propertiesSrc[name]
->GetParent()
->GetParent()
->FindNestedElementByName("Proxy")
->GetAttribute("override"))
if (!propertiesSrc[name]->GetAttribute("override"))
{
vtkWarningMacro(<< "Find conflict between 2 property name. (" << name.c_str() << ")");
return;
vtkPVXMLElement* parentProxyElem =
propertiesSrc[name]->GetParent()->GetParent()->FindNestedElementByName("Proxy");
if (!parentProxyElem || !parentProxyElem->GetAttribute("override"))
{
vtkWarningMacro(<< "Find conflict between 2 property name. (" << name.c_str() << ")");
return;
}
}
else
{ // Replace the overriden property by the new one
if (this->Internals->ReplaceOverrideInParent)
{
// Replace the overriden property by the new one
vtkPVXMLElement* subPropDefToRemove = propertiesToFill[name].GetPointer();
vtkPVXMLElement* overridingProp = propertiesSrc[name].GetPointer();
subPropDefToRemove->GetParent()->ReplaceNestedElement(subPropDefToRemove, overridingProp);
......@@ -1193,6 +1198,8 @@ void vtkSIProxyDefinitionManager::HandlePlugin(vtkPVPlugin* plugin)
// Make sure only the SERVER is processing the XML proxy definition
if (this->Internals->EnableXMLProxyDefinitionUpdate)
{
bool tmpReplaceOverrideInParent = this->Internals->ReplaceOverrideInParent;
this->Internals->ReplaceOverrideInParent = false;
for (size_t cc = 0; cc < xmls.size(); cc++)
{
this->LoadConfigurationXMLFromString(xmls[cc].c_str(),
......@@ -1203,6 +1210,7 @@ void vtkSIProxyDefinitionManager::HandlePlugin(vtkPVPlugin* plugin)
// Make sure we invalidate any cached flatten version of our proxy definition
this->InternalsFlatten->Clear();
this->Internals->ReplaceOverrideInParent = tmpReplaceOverrideInParent;
}
}
}
......
0ddd90aa663875a8a3e5d630d81f65070060cb60ee3e80494809a6b69a1f20511f429cbd2e28179784130fcddf5a5d36a7e86e10b3e34899ce6477d3799479b8
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment