Commit fb2e0a22 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

BUG #13773. Fixed auto-apply issues with plot-selection-over-time.

pqSelectionInputWidget was setting up the default value for the selection input
using a timer. That was happening after the auto-apply timer timed out. Thus,
the apply would happen before the value was set, resulting in the default for
the representation being setup incorrectly. That meant no data would be shown
even the selection-input was setup immediately after when the timer expired.
This fixes that issue by ensure that pqProxyPropertyWidget explicitly does the
initialization and removing the timer logic from pqSelectionInputWidget.

Also added a test to test this.

Change-Id: I6b51801e362b0cbc9aec4a7a370db0b6f32adcb2
parent ce203cb7
......@@ -114,8 +114,9 @@ SET (TESTS_WITH_BASELINES
${CMAKE_CURRENT_SOURCE_DIR}/NiftiReaderWriterPlugin.xml
${CMAKE_CURRENT_SOURCE_DIR}/OpenSaveData.xml
${CMAKE_CURRENT_SOURCE_DIR}/Plot3DReader.xml
${CMAKE_CURRENT_SOURCE_DIR}/PlotEdges.xml
${CMAKE_CURRENT_SOURCE_DIR}/PlotEdges2.xml
${CMAKE_CURRENT_SOURCE_DIR}/PlotEdges.xml
${CMAKE_CURRENT_SOURCE_DIR}/PlotOverTimeAutoApply.xml
${CMAKE_CURRENT_SOURCE_DIR}/PolygonCellSelection.xml
${CMAKE_CURRENT_SOURCE_DIR}/PolygonPointSelection.xml
${CMAKE_CURRENT_SOURCE_DIR}/ProbePicking.xml
......@@ -376,6 +377,7 @@ set (SLACTools_THRESHOLD 70)
# Plot image leeway.
set (SpreadSheet2_THRESHOLD 50)
set (PlotOverTimeAutoApply_THRESHOLD 50)
# DisconnectAndSaveAnimation is only support in Client-Server mode.
set (DisconnectAndSaveAnimation_DISABLE_C TRUE)
......
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/MainControlsToolbar/actionAutoApply" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/MainControlsToolbar/actionOpenData" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/FileOpenDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/Data/can.ex2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ArrayStatus/SelectionWidget/1QHeaderView0" command="mousePress" arguments="1,1,0,0,0,0" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ArrayStatus/SelectionWidget/1QHeaderView0" command="mouseRelease" arguments="1,0,0,0,0,0" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ArrayStatus/SelectionWidget" command="setCurrent" arguments="0.0" />
<pqevent object="pqClientMainWindow/cameraToolbar/actionPositiveY" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuTools" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/actionSelectionMode" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport" command="mousePress" arguments="(0.393333,0.426667,1,1,0)" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport" command="mouseMove" arguments="(0.393333,0.43,1,0,0)" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport" command="mouseRelease" arguments="(0.393333,0.43,1,0,0)" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuFilters" />
<pqevent object="pqClientMainWindow/menubar/menuFilters/DataAnalysis" command="activate" arguments="ExtractSelectionOverTime" />
<pqevent object="pqClientMainWindow/MainControlsToolbar/actionAutoApply" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
</pqevents>
......@@ -57,12 +57,14 @@ pqProxyPropertyWidget::pqProxyPropertyWidget(vtkSMProperty *smProperty,
pqSelectionInputWidget* siw = new pqSelectionInputWidget(this);
siw->setObjectName(smProxy->GetPropertyName(smProperty));
vbox->addWidget(siw);
this->SelectionInputWidget = siw;
this->addPropertyLink(siw, "selection",
SIGNAL(selectionChanged(pqSMProxy)), smProperty);
// call this after the above property link is setup so that we don't
// override the default value.
siw->initializeDefaultValueIfNeeded();
this->connect(siw, SIGNAL(selectionChanged(pqSMProxy)),
this, SIGNAL(changeAvailable()));
this->connect(siw, SIGNAL(selectionChanged(pqSMProxy)),
......
......@@ -49,7 +49,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqProxy.h"
#include "pqSelectionManager.h"
#include "pqSMAdaptor.h"
#include "pqTimer.h"
#include <string>
......@@ -74,8 +73,6 @@ pqSelectionInputWidget::pqSelectionInputWidget(QWidget* _parent)
QObject::connect(selMan, SIGNAL(selectionChanged(pqOutputPort*)),
this, SLOT(onActiveSelectionChanged()));
}
pqTimer::singleShot(10, this, SLOT(initializeWidget()));
}
//-----------------------------------------------------------------------------
......@@ -243,7 +240,7 @@ void pqSelectionInputWidget::updateLabels()
}
//-----------------------------------------------------------------------------
void pqSelectionInputWidget::initializeWidget()
void pqSelectionInputWidget::initializeDefaultValueIfNeeded()
{
if (!this->SelectionSource)
{
......
......@@ -57,6 +57,12 @@ public:
public slots:
virtual void setSelection(pqSMProxy selection);
// If a selection hasn't already been set, we call
// copyActiveSelection(). This ensures that the active selection is copied
// only when the panel is created for a clean source (not the one loaded from
// state or undo-redo).
void initializeDefaultValueIfNeeded();
/// This must be connected to the panel-accept signal to ensure that the new
/// selection source object gets registered for undo-redo/state to work. This
/// method also gets rid of any obsolete selection_sources.
......@@ -71,13 +77,6 @@ protected slots:
// Copy active selection.
void copyActiveSelection();
// Called by the constructor on idle.
// Here, if a selection hasn't already been set, we call
// copyActiveSelection(). This ensures that the active selection is copied
// only when the panel is created for a clean source (not the one loaded from
// state or undo-redo).
void initializeWidget();
void onActiveSelectionChanged();
void updateLabels();
......
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