Commit a629ae7b authored by Mathieu Westphal's avatar Mathieu Westphal Committed by Kitware Robot

Merge topic 'LagrangianParticleTrackerSMP'

52e8cab3 Updating VTK
064e6e92 Updating LagragianParticleTracker related plugin and example
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Nicolas Vuaille's avatarNicolas Vuaille <nicolas.vuaille@kitware.com>
Acked-by: Michael Migliore's avatarMichael Migliore <michael.migliore@kitware.com>
Acked-by: Max Zeyen's avatarMax Zeyen <max.zeyen@kitware.com>
Acked-by: Joachim Pouderoux's avatarJoachim Pouderoux <joachim.pouderoux@kitware.com>
Merge-request: !3207
parents 6e55a97c 52e8cab3
Pipeline #136920 running with stage
# Lagrangian Particle Tracker SMP implementation
The LagragianParticleTracker filter, provided in a Plugin in ParaView,
has been reimplemented with a multithreaded algorithm using VTK SMP backend
(remember to activate it when building ParaView)
Note that those changes imply some changes on any previously developer user-developed
Lagrangian Integration models as some method signatures have been modified.
Please refer to the related discourse
[post](https://discourse.paraview.org/t/new-multithreaded-lagrangianparticletracker/1838)
for more information.
......@@ -12,9 +12,10 @@
#include <cstring>
vtkObjectFactoryNewMacro(vtkLagrangianIntegrationModelExample)
vtkObjectFactoryNewMacro(vtkLagrangianIntegrationModelExample);
vtkLagrangianIntegrationModelExample::vtkLagrangianIntegrationModelExample()
//----------------------------------------------------------------------------
vtkLagrangianIntegrationModelExample::vtkLagrangianIntegrationModelExample()
{
// Fill the helper array
// Here one should set the seed and surface array name and components
......@@ -40,81 +41,73 @@ vtkObjectFactoryNewMacro(vtkLagrangianIntegrationModelExample)
this->NumFuncs = this->NumIndepVars - 1;
}
vtkLagrangianIntegrationModelExample::~vtkLagrangianIntegrationModelExample()
{
}
//----------------------------------------------------------------------------
void vtkLagrangianIntegrationModelExample::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
int vtkLagrangianIntegrationModelExample::FunctionValues(
//----------------------------------------------------------------------------
int vtkLagrangianIntegrationModelExample::FunctionValues(vtkLagrangianParticle* particle,
vtkDataSet* dataSet, vtkIdType cellId, double* weights, double* x, double* f)
{
// Initialize output
std::fill(f, f + this->NumFuncs, 0.0);
// Check for a particle
if (this->CurrentParticle == NULL)
if (!particle)
{
vtkErrorMacro(<< "No Particle to integrate");
vtkErrorMacro("No Particle to integrate");
return 0;
}
// Sanity Check
if (dataSet == NULL || cellId == -1)
if (!dataSet || cellId == -1)
{
vtkErrorMacro(<< "No cell or dataset to integrate the Particle on : Dataset: " << dataSet
<< " CellId:" << cellId);
vtkErrorMacro("No cell or dataset to integrate the Particle on : Dataset: "
<< dataSet << " CellId:" << cellId);
return 0;
}
// Recover Flow Properties
int nComponent;
double* tmp;
// Fetch each array at correct indexes, as defined in the xml.
// Fetch flowVelocity at index 3
if (!this->GetFlowOrSurfaceData(3, dataSet, cellId, weights, tmp, nComponent) || nComponent != 3)
double flowVelocity[3];
if (this->GetFlowOrSurfaceDataNumberOfComponents(3, dataSet) != 3 ||
!this->GetFlowOrSurfaceData(3, dataSet, cellId, weights, flowVelocity))
{
vtkErrorMacro("Flow velocity is not set in source flow dataset or "
"have incorrect number of components, cannot use Matida equations");
return 0;
}
// do not forget to copy the data
double flowVelocity[3];
std::memcpy(flowVelocity, tmp, sizeof(double) * nComponent);
// Fetch flowDensity at index 4
if (!this->GetFlowOrSurfaceData(4, dataSet, cellId, weights, tmp, nComponent) || nComponent != 1)
double flowDensity;
if (this->GetFlowOrSurfaceDataNumberOfComponents(4, dataSet) != 1 ||
!this->GetFlowOrSurfaceData(4, dataSet, cellId, weights, &flowDensity))
{
vtkErrorMacro("Flow density is not set in source flow dataset or "
"have incorrect number of components, cannot use Matida equations");
return 0;
}
double flowDensity = *tmp;
// Fetch flowDynamicViscosity at index 5
if (!this->GetFlowOrSurfaceData(5, dataSet, cellId, weights, tmp, nComponent) || nComponent != 1)
double flowDynamicViscosity;
if (this->GetFlowOrSurfaceDataNumberOfComponents(5, dataSet) != 1 ||
!this->GetFlowOrSurfaceData(5, dataSet, cellId, weights, &flowDynamicViscosity))
{
vtkErrorMacro("Flow dynamic viscosity is not set in source flow dataset or "
"have incorrect number of components, cannot use Matida equations");
return 0;
}
double flowDynamicViscosity = *tmp;
// Fetch Particle Properties
vtkIdType tupleIndex = this->CurrentParticle->GetSeedArrayTupleIndex();
vtkIdType tupleIndex = particle->GetSeedArrayTupleIndex();
// Fetch Particle Diameter as the first user variables
double particleDiameter = this->CurrentParticle->GetUserVariables()[0];
double particleDiameter = particle->GetUserVariables()[0];
// Fetch Particle Density at index 7
vtkDataArray* particleDensities =
vtkDataArray::SafeDownCast(this->GetSeedArray(7, this->CurrentParticle));
if (particleDensities == NULL)
vtkDataArray* particleDensities = vtkDataArray::SafeDownCast(this->GetSeedArray(7, particle));
if (!particleDensities)
{
vtkErrorMacro("Particle density is not set in particle data, "
"cannot use Matida equations");
......@@ -124,21 +117,22 @@ int vtkLagrangianIntegrationModelExample::FunctionValues(
// Recover Gravity constant, idx 8, FieldData, as defined in the xml.
// We read at a index 0 because these is the only tuple in the fieldData
if (!this->GetFlowOrSurfaceData(8, dataSet, 0, weights, tmp, nComponent) || nComponent != 1)
double gravityConstant;
if (this->GetFlowOrSurfaceDataNumberOfComponents(8, dataSet) != 1 ||
!this->GetFlowOrSurfaceData(8, dataSet, 0, weights, &gravityConstant))
{
vtkErrorMacro("GravityConstant is not set in source flow dataset or have"
"incorrect number of components, cannot use Matida Equations");
return 0;
}
double gravityConstant = *tmp;
// Compute function values
for (int i = 0; i < 3; i++)
{
// Matida Equation
f[i + 3] = (flowVelocity[i] - x[i + 3]) *
this->GetDragCoefficient(flowVelocity, this->CurrentParticle->GetVelocity(),
flowDynamicViscosity, particleDiameter, flowDensity) /
this->GetDragCoefficient(flowVelocity, particle->GetVelocity(), flowDynamicViscosity,
particleDiameter, flowDensity) /
(this->GetRelaxationTime(flowDynamicViscosity, particleDiameter, particleDensity));
f[i] = x[i + 3];
}
......@@ -195,7 +189,7 @@ void vtkLagrangianIntegrationModelExample::InitializeParticle(vtkLagrangianParti
// Recover Particle Diameter, idx 6, see xml file
vtkDoubleArray* particleDiameters = vtkDoubleArray::SafeDownCast(this->GetSeedArray(6, particle));
if (particleDiameters == NULL)
if (!particleDiameters)
{
vtkErrorMacro("ParticleDiameter is not set in particle data, variable not set");
}
......
......@@ -25,7 +25,7 @@
* and uses this diameter to make choice during interaction and free flight
* Please consult vtkLagrangianBasicIntegrationModel and vtkLagrangianMatidaIntegrationModel
* for more explanation on how this example works.
*/
*/
#ifndef vtkLagrangianIntegrationModelExample_h
#define vtkLagrangianIntegrationModelExample_h
......@@ -49,15 +49,15 @@ public:
* This method is pure abstract at vtkLagrangianBasicIntegrationModel
* THIS IS THE MAIN METHOD TO BE DEFINED IN A LAGRANGIAN INTEGRATION MODEL PLUGIN
*/
virtual int FunctionValues(
vtkDataSet* dataSet, vtkIdType cellId, double* weights, double* x, double* f) override;
int FunctionValues(vtkLagrangianParticle* particle, vtkDataSet* dataSet, vtkIdType cellId,
double* weights, double* x, double* f) override;
/**
* This method is called each time a particle created from the seeds
* It should be inherited in order to initialize variable data in user variables
* from seed data
*/
virtual void InitializeParticle(vtkLagrangianParticle* particle) override;
void InitializeParticle(vtkLagrangianParticle* particle) override;
/**
* This method is called when initializing output point data
......@@ -66,8 +66,7 @@ public:
* Add some User Variable Data Array in provided particleData, allocate
* maxTuples tuples.
*/
virtual void InitializeVariablesParticleData(
vtkPointData* particleData, int maxTuples = 0) override;
void InitializeVariablesParticleData(vtkPointData* particleData, int maxTuples = 0) override;
/**
* This method is called when inserting particle data in output point data
......@@ -76,7 +75,7 @@ public:
* Insert user variables data in provided point data, user variables data array begins at
* arrayOffset. use stepEnum to identify which step ( prev, current or next ) should be inserted.
*/
virtual void InsertVariablesParticleData(
void InsertVariablesParticleData(
vtkLagrangianParticle* particle, vtkPointData* data, int stepEnum) override;
/**
......@@ -84,7 +83,7 @@ public:
* At vtkLagrangianBasicIntegrationModel this method does nothing
* Return true if particle is terminated, false otherwise
*/
virtual bool CheckFreeFlightTermination(vtkLagrangianParticle* particle) override;
bool CheckFreeFlightTermination(vtkLagrangianParticle* particle) override;
/**
* Methods used by ParaView surface helper to get default
......@@ -94,12 +93,12 @@ public:
* it is your responsibility to initialize all components of
* defaultValues[nComponent]
*/
virtual void ComputeSurfaceDefaultValues(
void ComputeSurfaceDefaultValues(
const char* arrayName, vtkDataSet* dataset, int nComponents, double* defaultValues) override;
protected:
vtkLagrangianIntegrationModelExample();
virtual ~vtkLagrangianIntegrationModelExample();
~vtkLagrangianIntegrationModelExample() override = default;
/**
* This method is called each time a particle interact with a surface
......@@ -110,15 +109,15 @@ protected:
* velocity,
* create new particle...
*/
virtual bool InteractWithSurface(int surfaceType, vtkLagrangianParticle* particle,
vtkDataSet* surface, vtkIdType cellId, std::queue<vtkLagrangianParticle*>& particles) override;
bool InteractWithSurface(int surfaceType, vtkLagrangianParticle* particle, vtkDataSet* surface,
vtkIdType cellId, std::queue<vtkLagrangianParticle*>& particles) override;
/**
* This method is called when trying to find the intersection point between a particle
* and a surface, enabling to use your any intersection code. in this case it only call the
* superclass method
*/
virtual bool IntersectWithLine(
bool IntersectWithLine(
vtkCell* cell, double p1[3], double p2[3], double tol, double& t, double x[3]) override;
double GetRelaxationTime(const double& dynVisc, const double& diameter, const double& density);
......
......@@ -20,7 +20,7 @@
* This is an abstract class for Lagrangian helper
* It defines the integration model
* as well as the SetArrayToGenerate method signature
*/
*/
#ifndef vtkLagrangianHelperBase_h
#define vtkLagrangianHelperBase_h
......
......@@ -26,6 +26,7 @@
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkLagrangianBasicIntegrationModel.h"
#include "vtkLagrangianParticle.h"
#include "vtkNew.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
......@@ -38,11 +39,11 @@ vtkStandardNewMacro(vtkLagrangianSeedHelper);
class vtkLagrangianSeedHelper::vtkInternals
{
public:
vtkInternals() { this->CompositeDataIterator = NULL; }
vtkInternals() { this->CompositeDataIterator = nullptr; }
~vtkInternals()
{
if (this->CompositeDataIterator != NULL)
if (this->CompositeDataIterator)
{
this->CompositeDataIterator->Delete();
}
......@@ -135,6 +136,7 @@ int vtkLagrangianSeedHelper::RequestData(
else
{
vtkErrorMacro("Ignored Flow input of type: " << (flow ? flow->GetClassName() : "(none)"));
return 0;
}
// Copy input into output
......@@ -164,11 +166,16 @@ int vtkLagrangianSeedHelper::RequestData(
vtkIdType cellId;
vtkDataSet* dataset;
vtkAbstractCellLocator* loc;
double* weights = new double[this->IntegrationModel->GetWeightsSize()];
std::vector<double> weights(this->IntegrationModel->GetWeightsSize());
double* weightsPtr = weights.data();
// Create and set a dummy particle so FindInLocators can use caching.
vtkLagrangianParticle dummyParticle(
0, 0, 0, 0, 0, nullptr, this->IntegrationModel->GetWeightsSize());
for (int iPt = 0; iPt < output->GetNumberOfPoints(); iPt++)
{
if (this->IntegrationModel->FindInLocators(
output->GetPoint(iPt), dataset, cellId, loc, weights))
output->GetPoint(iPt), &dummyParticle, dataset, cellId, loc, weightsPtr))
{
if (arrayVal.FlowFieldAssociation == vtkDataObject::FIELD_ASSOCIATION_CELLS)
{
......@@ -179,7 +186,6 @@ int vtkLagrangianSeedHelper::RequestData(
{
vtkErrorMacro("Could not find " << arrayVal.FlowArray.c_str()
<< " array in flow cell data. Aborting");
delete[] weights;
return 0;
}
if (flowArray->GetNumberOfComponents() != arrayVal.NumberOfComponents)
......@@ -187,7 +193,6 @@ int vtkLagrangianSeedHelper::RequestData(
vtkErrorMacro(
<< arrayVal.FlowArray.c_str()
<< " cell data flow array does not have the right number of components. Aborting");
delete[] weights;
return 0;
}
seedArray->SetTuple(iPt, flowArray->GetTuple(cellId));
......@@ -201,7 +206,6 @@ int vtkLagrangianSeedHelper::RequestData(
{
vtkErrorMacro("Could not find " << arrayVal.FlowArray.c_str()
<< " array in flow point data. Aborting");
delete[] weights;
return 0;
}
if (flowArray->GetNumberOfComponents() != arrayVal.NumberOfComponents)
......@@ -209,14 +213,13 @@ int vtkLagrangianSeedHelper::RequestData(
vtkErrorMacro(
<< arrayVal.FlowArray.c_str()
<< " point data flow array does not have the right number of components. Aborting");
delete[] weights;
return 0;
}
vtkDataArray* tmpArray = flowArray->NewInstance();
tmpArray->SetNumberOfComponents(arrayVal.NumberOfComponents);
tmpArray->SetNumberOfTuples(1);
tmpArray->InterpolateTuple(
0, dataset->GetCell(cellId)->GetPointIds(), flowArray, weights);
0, dataset->GetCell(cellId)->GetPointIds(), flowArray, weightsPtr);
seedArray->SetTuple(iPt, tmpArray->GetTuple(0));
tmpArray->Delete();
}
......@@ -230,7 +233,6 @@ int vtkLagrangianSeedHelper::RequestData(
}
}
}
delete[] weights;
}
outputPD->AddArray(seedArray);
seedArray->Delete();
......@@ -253,7 +255,7 @@ int vtkLagrangianSeedHelper::RequestDataObject(
if (hdInput)
{
// Composite data
if (this->Internals->CompositeDataIterator != NULL)
if (this->Internals->CompositeDataIterator)
{
this->Internals->CompositeDataIterator->Delete();
}
......
......@@ -20,7 +20,7 @@
*
* This filter enable to generate point data, array by array
* from constant value or by interpolating from a volumic input
*/
*/
#ifndef vtkLagrangianSeedHelper_h
#define vtkLagrangianSeedHelper_h
......
......@@ -130,6 +130,7 @@ int vtkLagrangianSurfaceHelper::RequestData(
else
{
vtkErrorMacro("Unsupported dataset type : " << output->GetClassName());
return 0;
}
return 1;
}
......@@ -144,7 +145,7 @@ void vtkLagrangianSurfaceHelper::FillFieldData(vtkDataSet* dataset, int leaf)
vtkInternals::ArrayVal& arrayVal = this->Internals->ArraysToGenerate[i];
if (leaf > arrayVal.NumberOfLeafs)
{
vtkErrorMacro("Leaf :" << leaf << "does not exist in constants values. Ignoring.");
vtkWarningMacro("Leaf :" << leaf << "does not exist in constants values. Ignoring.");
return;
}
......
......@@ -21,7 +21,7 @@
* This filter enables generation of field data array by array,
* different for each block when using composite data,
* from constant value
*/
*/
#ifndef vtkLagrangianSurfaceHelper_h
#define vtkLagrangianSurfaceHelper_h
......
......@@ -8,7 +8,6 @@ if (PARAVIEW_BUILD_QT_GUI AND BUILD_SHARED_LIBS)
"DATA{Data/Baseline/LagrangianParticleTracker_InterB.png}"
"DATA{Data/Baseline/LagrangianParticleTracker_InterF.png}"
"DATA{Data/Baseline/LagrangianParticleTracker_InterG.png}"
"DATA{Data/Baseline/LagrangianParticleTracker_InterH.png}"
"DATA{Data/Baseline/LagrangianParticleTracker_InterI.png}"
"DATA{Data/Baseline/LagrangianParticleTracker_InterJ.png}"
......
7b4c31dbcffbca82440eb7a9928d931553c75bfc39cdf2bd894ec1d577b06a35d3d508fddee37f1087b820d4cfbee4e2c8b146a91e9ebcc0fe5f5d7d8f4e0fef
1ba52ec46dff2f0ab7912105b32616bacfdbfa38a33bdde295ed825ab9971739a7598dc8172cdf781713aabf5abd1213a88049ca48a7b58b07c2bc9bd2244b4a
61eb60d2c99fd62950d600b8094ff4a3c7d69d229b00da9d68d9b68bf939f8593baac09e13d957326b077100c44555e15625f488c0d207dfcc3291e0201502ea
8ea691563aab508534032ce4bb0aec9aa6c29c805368380e967d4a3f47082ca6ea64b5685b472442f03f0b7d41204a4ccb1bfa27da6ad96e7f51565f5ba6ecd4
089260d96eaa8d240aa2fac06732639efdd01120cdb0d8f544f0f7a3932d850fe0ba16028fee0697b18ea64ce341b9161f9668e7672adc8056c40dd4e643391c
......@@ -57,10 +57,6 @@
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqcompareview object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/CentralWidgetFrame/Viewport" baseline="$PARAVIEW_DATA_ROOT/Plugins/LagrangianParticleTracker/Testing/Data/Baseline/LagrangianParticleTracker_InterG.png" threshold="5" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/CellLengthComputationMode/ComboBox" command="activated" arguments="Current Cell Divergence Theorem" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqcompareview object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/CentralWidgetFrame/Viewport" baseline="$PARAVIEW_DATA_ROOT/Plugins/LagrangianParticleTracker/Testing/Data/Baseline/LagrangianParticleTracker_InterH.png" threshold="5" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/CellLengthComputationMode/ComboBox" command="activated" arguments="Current Cell Velocity Direction" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Step/DoubleLineEdit0" command="set_string" arguments="0.1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Integrator/ProxySelectionWidget/comboBox" command="activated" arguments="Runge Kutta 2" />
......
......@@ -34,31 +34,13 @@
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/MinStep/DoubleLineEdit0" command="set_string" arguments="0.1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/MaxStep/DoubleLineEdit0" command="set_string" arguments="1.1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar/menuFilters/Alphabetical" command="activate" arguments="TubeFilter" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqClientMainWindow/cameraToolbar/actionResetCamera" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,12,10,/0:0/1:0/0:1" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,12,10,/0:0/1:0/0:1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mousePress" arguments="1,1,0,6,104" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseMove" arguments="1,0,0,6,64" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseRelease" arguments="1,0,0,6,64" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/Opacity/DoubleRangeWidget/DoubleLineEdit" command="set_string" arguments="0.2" />
<pqevent object="pqClientMainWindow/variableToolbar/displayColor/Variables" command="activated" arguments="vtkProcessId" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,12,11,/0:0/3:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,12,11,/0:0/3:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,91,9,/0:0/3:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,91,9,/0:0/3:0/0:0" />
<pqevent object="pqClientMainWindow/variableToolbar/displayColor/Variables" command="activated" arguments="Id" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuTools" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqClientMainWindow/cameraToolbar/actionNegativeZ" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/cameraToolbar/actionResetCamera" command="activate" arguments="" />
<pqcompareview object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/CentralWidgetFrame/Viewport" baseline="$PARAVIEW_DATA_ROOT/Plugins/LagrangianParticleTracker/Testing/Data/Baseline/LagrangianParticleTrackerParallelDistributed_InterA.png" threshold="5" />
<pqevent object="pqClientMainWindow/variableToolbar/displayColor/Variables" command="activated" arguments="Termination" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,49,8,/0:0/1:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,49,8,/0:0/1:0/0:0" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,66,10,/0:0/3:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,66,10,/0:0/3:0/0:0" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
</pqevents>
......@@ -50,8 +50,3 @@ pqIntegrationModelHelperWidget::pqIntegrationModelHelperWidget(
this->VTKConnector->Connect(
this->ModelProperty, vtkCommand::UncheckedPropertyModifiedEvent, this, SLOT(resetWidget()));
}
//-----------------------------------------------------------------------------
pqIntegrationModelHelperWidget::~pqIntegrationModelHelperWidget()
{
}
......@@ -51,7 +51,7 @@ class pqIntegrationModelHelperWidget : public pqPropertyWidget
public:
pqIntegrationModelHelperWidget(
vtkSMProxy* smproxy, vtkSMProperty* smproperty, QWidget* parentObject = 0);
~pqIntegrationModelHelperWidget() override;
~pqIntegrationModelHelperWidget() override = default;
protected slots:
virtual void resetWidget() = 0;
......
......@@ -67,11 +67,6 @@ pqIntegrationModelSeedHelperWidget::pqIntegrationModelSeedHelperWidget(
this->addPropertyLink(this, "arrayToGenerate", SIGNAL(arrayToGenerateChanged()), smproperty);
}
//-----------------------------------------------------------------------------
pqIntegrationModelSeedHelperWidget::~pqIntegrationModelSeedHelperWidget()
{
}
//-----------------------------------------------------------------------------
void pqIntegrationModelSeedHelperWidget::resetWidget()
{
......@@ -97,7 +92,7 @@ void pqIntegrationModelSeedHelperWidget::resetSeedWidget(bool force)
qDeleteAll(this->children());
// Recover model array names and components
if (this->ModelPropertyValue != NULL)
if (this->ModelPropertyValue)
{
this->ModelPropertyValue->UpdatePropertyInformation();
vtkSMStringVectorProperty* namesProp = vtkSMStringVectorProperty::SafeDownCast(
......@@ -300,7 +295,7 @@ void pqIntegrationModelSeedHelperWidget::setArrayToGenerate(const QList<QVariant
// Recover array name
QString arrayName = i->toString();
int type = (i + 1)->toInt();
gb = NULL;
gb = nullptr;
foreach (gb, gbs)
{
// Identify correct combo box
......@@ -309,7 +304,7 @@ void pqIntegrationModelSeedHelperWidget::setArrayToGenerate(const QList<QVariant
break;
}
}
if (gb == NULL)
if (!gb)
{
qCritical() << "Could not find group box with name" << arrayName;
continue;
......
......@@ -49,7 +49,7 @@ class pqIntegrationModelSeedHelperWidget : public pqIntegrationModelHelperWidget
public:
pqIntegrationModelSeedHelperWidget(
vtkSMProxy* smproxy, vtkSMProperty* smproperty, QWidget* parentObject = 0);
~pqIntegrationModelSeedHelperWidget() override;
~pqIntegrationModelSeedHelperWidget() override = default;
QList<QVariant> arrayToGenerate() const;
......
......@@ -62,11 +62,6 @@ pqIntegrationModelSurfaceHelperWidget::pqIntegrationModelSurfaceHelperWidget(
this->addPropertyLink(this, "arrayToGenerate", SIGNAL(arrayToGenerateChanged()), smproperty);
}
//-----------------------------------------------------------------------------
pqIntegrationModelSurfaceHelperWidget::~pqIntegrationModelSurfaceHelperWidget()
{
}
//-----------------------------------------------------------------------------
void pqIntegrationModelSurfaceHelperWidget::resetWidget()
{
......@@ -85,7 +80,7 @@ void pqIntegrationModelSurfaceHelperWidget::resetSurfaceWidget(bool force)
// Remove all previous layout and child widget
qDeleteAll(this->children());
if (this->ModelPropertyValue != NULL)
if (this->ModelPropertyValue)
{
// Force push the model proxy property to the server
this->ModelProperty->SetProxy(0, this->ModelPropertyValue);
......@@ -307,7 +302,7 @@ QList<QVariant> pqIntegrationModelSurfaceHelperWidget::arrayToGenerate() const
for (unsigned int j = 0; j < nComponents; j++)
{
QComboBox* cmb = qobject_cast<QComboBox*>(table->indexWidget(model->index(i, j)));
if (cmb != NULL)
if (cmb)
{
str << cmb->itemData(cmb->currentIndex()).toString().toLatin1().data() << ";";
}
......@@ -347,7 +342,7 @@ void pqIntegrationModelSurfaceHelperWidget::setArrayToGenerate(const QList<QVari
QString arrayName = i->toString();
int type = (i + 1)->toInt();
gb = NULL;
gb = nullptr;
foreach (gb, gbs)
{
if (arrayName == gb->property("name"))
......@@ -355,7 +350,7 @@ void pqIntegrationModelSurfaceHelperWidget::setArrayToGenerate(const QList<QVari
break;
}
}
if (gb == NULL)
if (!gb)
{
qCritical() << "Could not find group box with name" << arrayName;
continue;
......@@ -390,7 +385,7 @@ void pqIntegrationModelSurfaceHelperWidget::setArrayToGenerate(const QList<QVari
for (int k = 0; k < nComponents; k++)
{
QComboBox* cmb = qobject_cast<QComboBox*>(table->indexWidget(model->index(j, k)));
if (cmb != NULL)
if (cmb)
{
cmb->setCurrentIndex(cmb->findData(dataValues[j * nComponents + k]));
}
......
......@@ -50,7 +50,7 @@ class pqIntegrationModelSurfaceHelperWidget : public pqIntegrationModelHelperWid
public:
pqIntegrationModelSurfaceHelperWidget(
vtkSMProxy* smproxy, vtkSMProperty* smproperty, QWidget* parentObject = 0);
~pqIntegrationModelSurfaceHelperWidget() override;
~pqIntegrationModelSurfaceHelperWidget() override = default;
QList<QVariant> arrayToGenerate() const;
......
Subproject commit 8ff9ab66b77c3760a51de1d2e99cd33f65a3f378
Subproject commit bbb0449ea545118f9ed2d2dea143d7431b748a29
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