Commit db1698b0 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic '20133-state-information'

5c03655c

 avoid making non-updated representations as updated
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Merge-request: !5202
parents 560b5e80 5c03655c
Pipeline #247091 failed with stages
in 172 minutes and 36 seconds
......@@ -7,6 +7,10 @@ if (NOT TARGET ParaView::RemotingMisc)
return()
endif ()
vtk_module_test_data(
"${paraview_test_data_directory_input}/Data/StateWithHiddenRepresentations.pvsm")
# Add python script names here.
set(PY_TESTS
Animation.py
......@@ -47,6 +51,7 @@ set(PY_TESTS
SaveAnimation.py
SaveScreenshot.py,NO_VALID
ScalarBarActorBackwardsCompatibility.py,NO_VALID
StateWithHiddenRepresentations.py,NO_VALID
TestFetchData.py,NO_VALID
TestSAVGReader.py
TestVTKSeriesWithMeta.py
......
# Tests BUG #20133
from paraview.simple import *
from paraview import smtesting
smtesting.ProcessCommandLineArguments()
LoadState(smtesting.DataDir + "/Testing/Data/StateWithHiddenRepresentations.pvsm")
wavelet = FindSource("Wavelet1")
contour = FindSource("Contour1")
view = GetRenderView()
# Render view with everything hidden.
view.StillRender()
# All data informations should be empty
assert wavelet.GetDataInformation().GetNumberOfPoints() == 0
assert contour.GetDataInformation().GetNumberOfPoints() == 0
# Show contour
display = GetRepresentation(contour, view)
display.Visibility = 1
# Render
view.StillRender()
# Now, all data information should be non-empty
assert wavelet.GetDataInformation().GetNumberOfPoints() > 0
assert contour.GetDataInformation().GetNumberOfPoints() > 0
......@@ -1256,6 +1256,12 @@ void vtkSMProxy::PostUpdateData(bool using_cache)
this->GetProducerProxy(i)->PostUpdateData(using_cache);
}
}
this->PostUpdateDataSelfOnly(using_cache);
}
//----------------------------------------------------------------------------
void vtkSMProxy::PostUpdateDataSelfOnly(bool using_cache)
{
if (this->NeedsUpdate)
{
vtkLogF(TRACE, "PostUpdateData (%s)", this->GetLogNameOrDefault());
......
......@@ -682,23 +682,23 @@ protected:
friend class vtkSMCameraLink;
friend class vtkSMCompoundProxy;
friend class vtkSMCompoundSourceProxy;
friend class vtkSMDeserializerProtobuf;
friend class vtkSMInputProperty;
friend class vtkSMMultiServerSourceProxy;
friend class vtkSMNamedPropertyIterator;
friend class vtkSMOrderedPropertyIterator;
friend class vtkSMPart;
friend class vtkSMProperty;
friend class vtkSMPropertyIterator;
friend class vtkSMNamedPropertyIterator;
friend class vtkSMSessionProxyManager;
friend class vtkSMProxyObserver;
friend class vtkSMProxyProperty;
friend class vtkSMProxyRegisterUndoElement;
friend class vtkSMProxyUnRegisterUndoElement;
friend class vtkSMSessionProxyManager;
friend class vtkSMSourceProxy;
friend class vtkSMUndoRedoStateLoader;
friend class vtkSMDeserializerProtobuf;
friend class vtkSMStateLocator;
friend class vtkSMMultiServerSourceProxy;
friend class vtkSMStateLoader;
friend class vtkSMStateLocator;
friend class vtkSMUndoRedoStateLoader;
friend class vtkSMViewProxy;
//@}
//@{
......@@ -854,6 +854,12 @@ protected:
*/
virtual void PostUpdateData(bool using_cache);
/**
* This is called by `PostUpdateData` to only update state for this proxy
* without iterative over producers.
*/
void PostUpdateDataSelfOnly(bool using_cache);
/**
* If a proxy is deprecated, prints a warning.
*/
......
......@@ -295,11 +295,17 @@ void vtkSMRepresentationProxy::ViewUpdated(vtkSMProxy* view)
this->MarkInputsAsDirty();
}
const bool repr_updated = this->VTKRepresentationUpdated;
const bool using_cache = this->VTKRepresentationUpdateSkipped;
this->VTKRepresentationUpdateSkipped = false;
this->VTKRepresentationUpdated = false;
this->VTKRepresentationUpdateTimeChanged = false;
this->PostUpdateData(using_cache);
if (repr_updated || using_cache)
{
// Don't call PostUpdateData, unless representation was updated or cache
// was used. This is necessary to avoid #20133.
this->PostUpdateData(using_cache);
}
}
// If this class has sub-representations, we need to tell those that the view
......
......@@ -470,11 +470,13 @@ void vtkSMViewProxy::Update()
}
else
{
// this->GetProducerProxy(i)->PostUpdateData();
this->GetProducerProxy(i)->PostUpdateData(false);
}
}
this->PostUpdateData(false);
// We don't need to call PostUpdateData on all producers again since we just
// did that explicitly (and selectively) in the loop above.
this->PostUpdateDataSelfOnly(false);
}
}
......
2388232d642214ef2ef016a7c623387c9a0dcb953081d3484c11cf00f1d9511ab323fe709ce0a98db4bb5e664fa07774a973892e72b91218a77c4a41ec7818a6
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