diff --git a/Applications/ParaView/ParaViewFilters.xml b/Applications/ParaView/ParaViewFilters.xml index e020c91af8f..8a95e2d1c59 100644 --- a/Applications/ParaView/ParaViewFilters.xml +++ b/Applications/ParaView/ParaViewFilters.xml @@ -15,6 +15,8 @@ + + diff --git a/Applications/ParaView/Testing/XML/CMakeLists.txt b/Applications/ParaView/Testing/XML/CMakeLists.txt index 93ccdd91fba..7fe5e8b5278 100644 --- a/Applications/ParaView/Testing/XML/CMakeLists.txt +++ b/Applications/ParaView/Testing/XML/CMakeLists.txt @@ -49,6 +49,7 @@ paraview_test_load_data("" Scenario1_p1.h5 Scenario1_p1.xmf servers-wiki.pvsc + sineWaves.csv singleSphereAnimation.pvd tensors.pvti Test1.h5 @@ -213,6 +214,7 @@ SET (TESTS_WITH_BASELINES ${CMAKE_CURRENT_SOURCE_DIR}/Flow.xml ${CMAKE_CURRENT_SOURCE_DIR}/Flow2.xml ${CMAKE_CURRENT_SOURCE_DIR}/Fractal2D.xml + ${CMAKE_CURRENT_SOURCE_DIR}/FunctionalBagPlots.xml ${CMAKE_CURRENT_SOURCE_DIR}/H5PartReaderPlugin.xml ${CMAKE_CURRENT_SOURCE_DIR}/ImageVolumeRendering.xml ${CMAKE_CURRENT_SOURCE_DIR}/LoadPartiallyUpdatedStateFiles.xml @@ -471,6 +473,11 @@ IF (PARAVIEW_USE_MPI) # Hence disable them. set (LineChartSelection_DISABLE_CS TRUE) set (LineChartSelection_DISABLE_CRS TRUE) + + # Selections end up highlighting different set of ID based points in parallel. + # Hence disable them. + set (FunctionalBagPlots_DISABLE_CS TRUE) + set (FunctionalBagPlots_DISABLE_CRS TRUE) ENDIF () # Composite Surface Selection is currently broken in everything but bultin @@ -544,6 +551,8 @@ SET (CutMulti_REVERSE_CONNECT TRUE) # Since this involves charts. SET(HistogramSelection_THRESHOLD 40) +SET(LineChartSelection_THRESHOLD 40) +SET(FunctionalBagPlots_THRESHOLD 40) # Increate threshold for this one since the chart axes # tends to render slightly differently. diff --git a/Applications/ParaView/Testing/XML/FunctionalBagPlots.xml b/Applications/ParaView/Testing/XML/FunctionalBagPlots.xml new file mode 100644 index 00000000000..ea21b2d1f50 --- /dev/null +++ b/Applications/ParaView/Testing/XML/FunctionalBagPlots.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CoProcessing/Catalyst/CMakeLists.txt b/CoProcessing/Catalyst/CMakeLists.txt index 74c36db2c3b..16e90db161f 100644 --- a/CoProcessing/Catalyst/CMakeLists.txt +++ b/CoProcessing/Catalyst/CMakeLists.txt @@ -77,6 +77,12 @@ if (CMAKE_Fortran_COMPILER_WORKS) ${CMAKE_CURRENT_BINARY_DIR}/FortranAdaptorAPIMangling.h) endif() +if (PARAVIEW_USE_MPI) + # this needs to be done before the vtk_module_library() since + # vtkMPI has add_definitions() call it in. + include(vtkMPI) +endif() + vtk_module_library(${vtk-module} ${Module_SRCS}) if(PARAVIEW_USE_MPI) vtk_mpi_link(${vtk-module}) diff --git a/ParaViewCore/ClientServerCore/Rendering/vtkPVBagChartRepresentation.cxx b/ParaViewCore/ClientServerCore/Rendering/vtkPVBagChartRepresentation.cxx index d130acba6a1..144870c0894 100644 --- a/ParaViewCore/ClientServerCore/Rendering/vtkPVBagChartRepresentation.cxx +++ b/ParaViewCore/ClientServerCore/Rendering/vtkPVBagChartRepresentation.cxx @@ -42,6 +42,8 @@ vtkPVBagChartRepresentation::vtkPVBagChartRepresentation() : { this->BagColor[0] = 1.0; this->BagColor[1] = this->BagColor[2] = 0.0; + this->SelectionColor[0] = this->SelectionColor[2] = 1.0; + this->SelectionColor[1] = 0.0; this->LineColor[0] = this->LineColor[1] = this->LineColor[2] = 0.0; this->PointColor[0] = this->PointColor[1] = this->PointColor[2] = 0.0; } @@ -151,6 +153,9 @@ void vtkPVBagChartRepresentation::PrepareForRendering() plot->GetPen()->SetColorF(this->PointColor); plot->GetPen()->SetOpacityF(1.0); + // Set selection point pen properties + plot->GetSelectionPen()->SetColorF(this->SelectionColor); + if (plotInput) { // We only consider the first vtkTable. diff --git a/ParaViewCore/ClientServerCore/Rendering/vtkPVBagChartRepresentation.h b/ParaViewCore/ClientServerCore/Rendering/vtkPVBagChartRepresentation.h index 34cffed49e5..080a3c30a2b 100644 --- a/ParaViewCore/ClientServerCore/Rendering/vtkPVBagChartRepresentation.h +++ b/ParaViewCore/ClientServerCore/Rendering/vtkPVBagChartRepresentation.h @@ -60,6 +60,11 @@ class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPVBagChartRepresentation : public vtkSetVector3Macro(BagColor, double); vtkGetVector3Macro(BagColor, double); + // Description: + // Set/get the color to used for the bag in the plot. + vtkSetVector3Macro(SelectionColor, double); + vtkGetVector3Macro(SelectionColor, double); + // Description: // Set/get the opacity for the bag in the plot. vtkSetMacro(Opacity, double); @@ -122,6 +127,7 @@ class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPVBagChartRepresentation : public int LineStyle; double LineColor[3]; double BagColor[3]; + double SelectionColor[3]; double Opacity; int PointSize; double PointColor[3]; diff --git a/ParaViewCore/ClientServerCore/Rendering/vtkXYChartRepresentation.cxx b/ParaViewCore/ClientServerCore/Rendering/vtkXYChartRepresentation.cxx index fc6479e1b86..e691adb0711 100644 --- a/ParaViewCore/ClientServerCore/Rendering/vtkXYChartRepresentation.cxx +++ b/ParaViewCore/ClientServerCore/Rendering/vtkXYChartRepresentation.cxx @@ -22,6 +22,7 @@ #include "vtkObjectFactory.h" #include "vtkPen.h" #include "vtkPlotBar.h" +#include "vtkPlotFunctionalBag.h" #include "vtkPlotPoints.h" #include "vtkPVContextView.h" #include "vtkScalarsToColors.h" @@ -187,6 +188,7 @@ class vtkXYChartRepresentation::vtkInternals assert(self != NULL); vtkChartXY* chartXY = self->GetChart(); + vtkPlot* lastFunctionalBagPlot = 0; for (MapOfTables::const_iterator tablesIter = tables.begin(); tablesIter != tables.end(); ++tablesIter) { @@ -197,14 +199,20 @@ class vtkXYChartRepresentation::vtkInternals for (vtkIdType cc=0; cc < numCols; ++cc) { std::string columnName = table->GetColumnName(cc); - if (!this->GetSeriesParameter(tableName, columnName, this->SeriesVisibilities, false)) + const bool visible = this->GetSeriesParameter( + tableName, columnName, this->SeriesVisibilities, false); + if (!visible) { - // skip invisible series. if (vtkPlot* plot = this->GetSeriesPlot(tableName, columnName)) { plot->SetVisible(false); } - continue; + // skip invisible series except for functionalbag that needs them all + // for the sake of selection. + if (self->GetChartType() != vtkChart::FUNCTIONALBAG) + { + continue; + } } // Now, we know the series needs to be shown, so update the vtkPlot. @@ -221,7 +229,7 @@ class vtkXYChartRepresentation::vtkInternals this->AddSeriesPlot(tableName, columnName, plot); } - plot->SetVisible(true); + plot->SetVisible(visible); std::string default_label = vtkChartRepresentation::GetDefaultSeriesLabel( tableName, columnName); @@ -231,6 +239,7 @@ class vtkXYChartRepresentation::vtkInternals vtkColor3d color = this->GetSeriesParameter(tableName, columnName, this->Colors, vtkColor3d(0, 0, 0)); plot->SetColor(color.GetRed(), color.GetGreen(), color.GetBlue()); + plot->GetSelectionPen()->SetColorF(self->SelectionColor); plot->SetWidth(this->GetSeriesParameter(tableName, columnName, this->LineThicknesses, 2)); @@ -269,6 +278,20 @@ class vtkXYChartRepresentation::vtkInternals plotBar->SetLookupTable(lut); } } + // Functional bag plots shall be stacked under the other plots. + vtkPlotFunctionalBag* plotBag = vtkPlotFunctionalBag::SafeDownCast(plot); + if (plotBag && plotBag->IsBag()) + { + if (!lastFunctionalBagPlot) + { + chartXY->LowerPlot(plotBag); + } + else + { + chartXY->StackPlotAbove(plotBag, lastFunctionalBagPlot); + } + lastFunctionalBagPlot = plotBag; + } } } } @@ -283,6 +306,9 @@ vtkXYChartRepresentation::vtkXYChartRepresentation() UseIndexForXAxis(true), PlotDataHasChanged(false) { + this->SelectionColor[0] = 1.; + this->SelectionColor[1] = 0.; + this->SelectionColor[2] = 1.; } //---------------------------------------------------------------------------- @@ -522,6 +548,13 @@ void vtkXYChartRepresentation::PrepareForRendering() } this->PlotDataHasChanged = false; + if (this->GetChartType() == vtkChart::FUNCTIONALBAG) + { + chartXY->SetSelectionMethod(vtkChart::SELECTION_COLUMNS); + } + chartXY->SetSelectionMethod( + this->GetChartType() == vtkChart::FUNCTIONALBAG ? + vtkChart::SELECTION_COLUMNS : vtkChart::SELECTION_ROWS); // Update plots. This will create new vtkPlot if needed. this->Internals->UpdatePlots(this, tables); diff --git a/ParaViewCore/ClientServerCore/Rendering/vtkXYChartRepresentation.h b/ParaViewCore/ClientServerCore/Rendering/vtkXYChartRepresentation.h index 34a91240b7c..ef4fe28c77a 100644 --- a/ParaViewCore/ClientServerCore/Rendering/vtkXYChartRepresentation.h +++ b/ParaViewCore/ClientServerCore/Rendering/vtkXYChartRepresentation.h @@ -98,6 +98,8 @@ class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkXYChartRepresentation : public vt void ClearMarkerStyles(); void ClearLabels(); + vtkSetVector3Macro(SelectionColor, double); + vtkGetVector3Macro(SelectionColor, double); //BTX protected: vtkXYChartRepresentation(); @@ -123,6 +125,7 @@ class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkXYChartRepresentation : public vt char* XAxisSeriesName; bool UseIndexForXAxis; bool PlotDataHasChanged; + double SelectionColor[3]; //ETX }; diff --git a/ParaViewCore/ServerManager/Core/vtkSMSettings.cxx b/ParaViewCore/ServerManager/Core/vtkSMSettings.cxx index 9adb0e6f84e..5b3873fa812 100644 --- a/ParaViewCore/ServerManager/Core/vtkSMSettings.cxx +++ b/ParaViewCore/ServerManager/Core/vtkSMSettings.cxx @@ -236,6 +236,7 @@ class vtkSMSettings::vtkSMSettingsInternal { if (hasInt) { property->SetElement(0, enumValue); + return true; } else { @@ -245,29 +246,23 @@ class vtkSMSettings::vtkSMSettingsInternal { { enumValue = enumDomain->GetEntryValueForText(stringValue.c_str()); property->SetElement(0, enumValue); + return true; } } } - else + std::vector vector; + if (!this->GetSetting(settingName, vector) || + vector.size() != property->GetNumberOfElements()) { - std::vector vector; - if (!this->GetSetting(settingName, vector) || - vector.size() != property->GetNumberOfElements()) - { - return false; - } - else if (property->GetRepeatable()) - { - property->SetNumberOfElements(static_cast(vector.size())); - } - else if (vector.size() != property->GetNumberOfElements()) - { - return false; - } - - property->SetElements(&vector[0]); + return false; + } + if (property->GetRepeatable()) + { + property->SetNumberOfElements(static_cast(vector.size())); } + property->SetElements(&vector[0]); + return true; } diff --git a/ParaViewCore/ServerManager/Default/settings.xml b/ParaViewCore/ServerManager/Default/settings.xml index 6a040981424..71ed7832dd3 100644 --- a/ParaViewCore/ServerManager/Default/settings.xml +++ b/ParaViewCore/ServerManager/Default/settings.xml @@ -162,6 +162,7 @@ + @@ -176,6 +177,7 @@ + diff --git a/ParaViewCore/ServerManager/Rendering/vtkSMChartSeriesSelectionDomain.cxx b/ParaViewCore/ServerManager/Rendering/vtkSMChartSeriesSelectionDomain.cxx index 4c5b8532275..81962bad5f7 100644 --- a/ParaViewCore/ServerManager/Rendering/vtkSMChartSeriesSelectionDomain.cxx +++ b/ParaViewCore/ServerManager/Rendering/vtkSMChartSeriesSelectionDomain.cxx @@ -312,8 +312,12 @@ void vtkSMChartSeriesSelectionDomain::Update(vtkSMProperty*) blockNameStream << compositeIndexHelper.GetAsInt(cc); } } + // if there is only 1 element, use the element to avoid having partial data. + vtkPVDataInformation* dataInfoWithArrays = + numElems == 1 ? childInfo : dataInfo; this->Internals->PopulateAvailableArrays(blockNameStream.str(), - column_names, dataInfo, fieldAssociation, this->FlattenTable); + column_names, dataInfoWithArrays, fieldAssociation, + this->FlattenTable); } this->SetStrings(column_names); } diff --git a/ParaViewCore/ServerManager/Rendering/vtkSMFunctionalBagChartSeriesSelectionDomain.cxx b/ParaViewCore/ServerManager/Rendering/vtkSMFunctionalBagChartSeriesSelectionDomain.cxx index 7e6e4ace558..22ec99214dd 100644 --- a/ParaViewCore/ServerManager/Rendering/vtkSMFunctionalBagChartSeriesSelectionDomain.cxx +++ b/ParaViewCore/ServerManager/Rendering/vtkSMFunctionalBagChartSeriesSelectionDomain.cxx @@ -42,11 +42,11 @@ bool vtkSMFunctionalBagChartSeriesSelectionDomain::GetDefaultSeriesVisibility(co //---------------------------------------------------------------------------- std::vector vtkSMFunctionalBagChartSeriesSelectionDomain::GetDefaultValue(const char* series) { + std::vector values; + std::string name(series); if (this->DefaultMode == LABEL) { - std::vector values; // Remove _outlier extension in the series label - std::string name(series); if (vtksys::SystemTools::StringEndsWith(series, "_outlier")) { vtksys::SystemTools::ReplaceString(name, "_outlier", ""); @@ -66,6 +66,30 @@ std::vector vtkSMFunctionalBagChartSeriesSelectionDomain::GetDefau values.push_back(name.c_str()); return values; } + else if (this->DefaultMode == COLOR) + { + if (name == "Q3Points") + { + values.push_back("0.50"); + values.push_back("0.00"); + values.push_back("0.00"); + return values; + } + else if (name == "QMedPoints") + { + values.push_back("0.75"); + values.push_back("0.00"); + values.push_back("0.00"); + return values; + } + else if (name == "QMedianLine") + { + values.push_back("0.00"); + values.push_back("0.00"); + values.push_back("0.00"); + return values; + } + } return this->Superclass::GetDefaultValue(series); } diff --git a/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml b/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml index 0e788fff7de..86b80054297 100644 --- a/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml +++ b/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml @@ -11032,15 +11032,10 @@ source. Specify the smoothing parameter of the HDR. - - - diff --git a/ParaViewCore/ServerManager/SMApplication/Resources/views_and_representations.xml b/ParaViewCore/ServerManager/SMApplication/Resources/views_and_representations.xml index 2be199e278f..8b3797e4b69 100644 --- a/ParaViewCore/ServerManager/SMApplication/Resources/views_and_representations.xml +++ b/ParaViewCore/ServerManager/SMApplication/Resources/views_and_representations.xml @@ -5477,7 +5477,21 @@ - + + + + + + + + + + + + + + + + + + + @@ -6586,8 +6637,9 @@ Data input for the representation. - - + + - - + number_of_elements="1"> + + In case of Composite datasets, set the flat index of the + dataset to pass. The flat index must point to a non-empty, + non-composite dataset for anything to be passed through. If the input + is not a composite dataset, then this index is ignored. + + - + - This property lists the ids of the blocks to extract - from the input multiblock dataset. - - + + + + + + + + + + + + + + + diff --git a/ParaViewCore/VTKExtensions/CosmoTools/module.cmake b/ParaViewCore/VTKExtensions/CosmoTools/module.cmake index 1150f33a361..a273174dc50 100644 --- a/ParaViewCore/VTKExtensions/CosmoTools/module.cmake +++ b/ParaViewCore/VTKExtensions/CosmoTools/module.cmake @@ -25,6 +25,8 @@ set_property(GLOBAL PROPERTY ## CosmoTools Filters ${CMAKE_CURRENT_LIST_DIR}/resources/LANLHaloFinder.xml + ${CMAKE_CURRENT_LIST_DIR}/resources/ANLHaloFinder.xml + ${CMAKE_CURRENT_LIST_DIR}/resources/ANLSubHaloFinder.xml ${CMAKE_CURRENT_LIST_DIR}/resources/MergeConnected.xml ${CMAKE_CURRENT_LIST_DIR}/resources/MinkowskiFilter.xml ) diff --git a/ParaViewCore/VTKExtensions/CosmoTools/resources/ANLHaloFinder.xml b/ParaViewCore/VTKExtensions/CosmoTools/resources/ANLHaloFinder.xml new file mode 100644 index 00000000000..c7b54e13ce0 --- /dev/null +++ b/ParaViewCore/VTKExtensions/CosmoTools/resources/ANLHaloFinder.xml @@ -0,0 +1,313 @@ + + + + + + + + + + + + + This property specifies the input of the filter. + + + + + + + The box side length used to wrap particles around if they exceed rL + (or less than 0) in any dimension (only positive positions are allowed + in the input, or they are wrapped around). + + + + + + + The space (in rL units) to extend processor particle ownership for ghost + particles/cells. Needed for correct halo calculation when halos cross + processor boundaries in parallel computation. Called DeadSize in the + hacc config files. + + + + + + + Number of seeded particles in one dimension. Therefore, total simulation + particles is np^3 (cubed). + + + + + + + Linking length measured in units of interparticle spacing and is + dimensionless. Used to link particles into halos for the + friends-of-friends (FOF) algorithm. + + + + + + + Minimum number of particles (threshold) needed before a group is called + a friends-of-friends (FOF) halo. + + + + + + + The mass of each particle. + + + + + + Some input files may have the world coordinates scaled from what the + halo finder expects. This parameter is the conversion factor that + will be multiplied by the positions of all particles. + + + + + + For some inputs the particle mass may need to be converted before the + halo finder can be run. This is the number that is multiplied by the + particle mass. + + + + + + + + + + + + Set the method used to determine the halo "center". + + + + + + + Sets the smoothing length used by some of the center finding + techniques. + + + + + + Sets the OmegaDM parameter of the center finding algorithms. This + parameter comes from the simulation input and is not needed if + Center Finding Method is set to None. + + + + + + Sets the OmegaNU parameter of the center finding algorithms. This + parameter comes from the simulation input and is not needed if + Center Finding Method is set to None. + + + + + + Sets the Deut parameter of the center finding algorithms. This + parameter comes from the simulation input and is not needed if + Center Finding Method is set to None. + + + + + + Sets the Hubble parameter of the center finding algorithms. This + parameter comes from the simulation input and is not needed if + Center Finding Method is set to None. + + + + + + Sets the Redshift parameter of the center finding algorithms. This + parameter comes from the simulation input and is not needed if + Center Finding Method is set to None. + + + + + + + Turn this on to also find subhalos in halos of sufficient size. See + the advanced parameters to set subhalo finder options. + + + + + + + A tuning parameter of subhalo finding. This controls how aggressively small + suhalos will be grown. Alpha factor of 1.0 is the least agrressive. + Only used if subhalo finding is enabled. + + + + + + A tuning parameter of subhalo finding. This controls how saddle points between + subhalos are treated. Larger values allow identification of smaller scale + structures such as tails. Only used if subhalo finding is enabled. + + + + + + + The minimum number of close neighbors for a halo candidate to include a particle. + If this many particles in the halo are close enough to the particle, then the + particle is considered inside the halo. + + + + + + + The miminum sized halo to run the subhalo finder of to subdivide further. Only used + if subhalo finding is enabled. + + + + + + + A subhalo candidate must have at least this many particles to be a subhalo. + + + + + + A parameter of the subhalo finder. Only used if subhalo finding is enabled. + + + + + + + The nearest X particles will be used to determine the local density in + the subhalo finder where X is the value of this parameter. Only used + if subhalo finding is enabled. + + + + + + + + + + diff --git a/ParaViewCore/VTKExtensions/CosmoTools/resources/ANLSubHaloFinder.xml b/ParaViewCore/VTKExtensions/CosmoTools/resources/ANLSubHaloFinder.xml new file mode 100644 index 00000000000..839de0cced6 --- /dev/null +++ b/ParaViewCore/VTKExtensions/CosmoTools/resources/ANLSubHaloFinder.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + This property specifies the input of the filter. + + + + + + + + + + + The box side length used to wrap particles around if they exceed rL + (or less than 0) in any dimension (only positive positions are allowed + in the input, or they are wrapped around). + + + + + + + The space (in rL units) to extend processor particle ownership for ghost + particles/cells. Needed for correct halo calculation when halos cross + processor boundaries in parallel computation. Called DeadSize in the + hacc config files. + + + + + + + Linking length measured in units of interparticle spacing and is + dimensionless. Used to link particles into halos for the + friends-of-friends (FOF) algorithm. + + + + + + + The mass of each particle. + + + + + + + A tuning parameter of subhalo finding. This controls how aggressively small + suhalos will be grown. Alpha factor of 1.0 is the least agrressive. + + + + + + A tuning parameter of subhalo finding. This controls how saddle points between + subhalos are treated. Larger values allow identification of smaller scale + structures such as tails. + + + + + + + A subhalo candidate must have at least this many particles to be a subhalo. + + + + + + A parameter of the subhalo finder. + + + + + + + The nearest X particles will be used to determine the local density in + the subhalo finder where X is the value of this parameter. + + + + + + + + + diff --git a/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLHaloFinder.cxx b/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLHaloFinder.cxx index e8fa808373b..5f48e78525a 100644 --- a/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLHaloFinder.cxx +++ b/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLHaloFinder.cxx @@ -218,6 +218,14 @@ vtkPANLHaloFinder::vtkPANLHaloFinder() this->MinCandidateSize = 200; this->NumSPHNeighbors = 64; this->NumNeighbors = 20; + + this->CenterFindingMode = NONE; + this->SmoothingLength = 0.0; + this->OmegaDM = 0.26627; + this->OmegaNU = 0.0; + this->Deut = 0.02258; + this->Hubble = 0.673; + this->RedShift = 0.0; } vtkPANLHaloFinder::~vtkPANLHaloFinder() @@ -630,6 +638,9 @@ void vtkPANLHaloFinder::FindCenters(vtkUnstructuredGrid *fofProperties) } int numberOfFOFHalos = this->Internal->haloFinder->getNumberOfHalos(); int* fofHaloCount = this->Internal->haloFinder->getHaloCount(); + double OmegaBar = this->Deut/this->Hubble/this->Hubble; + double OmegaCB = OmegaDM + OmegaBar; + double OmegaMatter = OmegaCB + this->OmegaNU; vtkNew< vtkFloatArray > centers; centers->SetName("fof_center"); @@ -644,7 +655,7 @@ void vtkPANLHaloFinder::FindCenters(vtkUnstructuredGrid *fofProperties) haloData.SetParticles(centerFinder); centerFinder.setParameters(this->BB,this->SmoothingLength, this->DistanceConvertFactor,this->RL, - this->NP,this->OmegaMatter,this->OmegaCB, + this->NP,OmegaMatter,OmegaCB, this->Hubble,this->RedShift); int centerIndex = -1; if (this->CenterFindingMode == MOST_BOUND_PARTICLE) diff --git a/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLHaloFinder.h b/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLHaloFinder.h index b31cbf01f9f..db3802845e8 100644 --- a/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLHaloFinder.h +++ b/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLHaloFinder.h @@ -155,12 +155,59 @@ class VTKPVVTKEXTENSIONSCOSMOTOOLS_EXPORT vtkPANLHaloFinder : public vtkUnstruct vtkGetMacro(NumNeighbors,int) enum CenterFindingType { - NONE, - MOST_BOUND_PARTICLE, - MOST_CONNECTED_PARTICLE, - HIST_CENTER_FINDING + NONE = 0, + MOST_BOUND_PARTICLE = 1, + MOST_CONNECTED_PARTICLE = 2, + HIST_CENTER_FINDING = 3 }; + // Description: + // Gets/Sets the center finding method used by the halo finder once halos are + // identified. + // Default: NONE + vtkSetMacro(CenterFindingMode,int) + vtkGetMacro(CenterFindingMode,int) + + // Description: + // Gets/Sets the smoothing length used by the center finders + // Default: 0.0 + vtkSetMacro(SmoothingLength,double) + vtkGetMacro(SmoothingLength,double) + + // Description: + // Gets/Sets the OmegaDM parameter of the simulation. Used by the center + // finding algorithms. + // Default: 0.26627 + vtkSetMacro(OmegaDM,double) + vtkGetMacro(OmegaDM,double) + + // Description: + // Gets/Sets the OmegaNU parameter of the simulation. Used by the center + // finding algorithms. + // Default: 0.0 + vtkSetMacro(OmegaNU,double) + vtkGetMacro(OmegaNU,double) + + // Description: + // Gets/Sets the Deut parameter of the simulation. Used by the center + // finding algorithms. + // Default: 0.02258 + vtkSetMacro(Deut,double) + vtkGetMacro(Deut,double) + + // Description: + // Gets/Sets the Hubble parameter of the simulation. Used by the center + // finding algorithms. + // Default: 0.673 + vtkSetMacro(Hubble,double) + vtkGetMacro(Hubble,double) + + // Description: + // Gets/Sets the current redshift. Used by the center finding algorithms. + // Default: 0.0 + vtkSetMacro(RedShift,double) + vtkGetMacro(RedShift,double) + protected: vtkPANLHaloFinder(); virtual ~vtkPANLHaloFinder(); @@ -187,10 +234,11 @@ class VTKPVVTKEXTENSIONSCOSMOTOOLS_EXPORT vtkPANLHaloFinder : public vtkUnstruct bool RunSubHaloFinder; // Center finding parameters - CenterFindingType CenterFindingMode; + int CenterFindingMode; double SmoothingLength; - double OmegaMatter; - double OmegaCB; + double OmegaNU; + double OmegaDM; + double Deut; double Hubble; double RedShift; diff --git a/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLSubhaloFinder.cxx b/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLSubhaloFinder.cxx index 64bace28d89..a8078bf0ae8 100644 --- a/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLSubhaloFinder.cxx +++ b/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLSubhaloFinder.cxx @@ -163,11 +163,31 @@ int vtkPANLSubhaloFinder::RequestData( return 1; } +vtkIdType vtkPANLSubhaloFinder::GetHaloToProcess(vtkIdType idx) +{ + return this->HalosToProcess->GetId(idx); +} + void vtkPANLSubhaloFinder::AddHaloToProcess(vtkIdType haloId) { this->HalosToProcess->InsertNextId(haloId); } +void vtkPANLSubhaloFinder::SetHaloToProcess(vtkIdType idx, vtkIdType haloId) +{ + this->HalosToProcess->SetId(idx,haloId); +} + +void vtkPANLSubhaloFinder::SetNumberOfHalosToProcess(vtkIdType num) +{ + this->HalosToProcess->SetNumberOfIds(num); +} + +vtkIdType vtkPANLSubhaloFinder::GetNumberOfHalosToProcess() +{ + return this->HalosToProcess->GetNumberOfIds(); +} + void vtkPANLSubhaloFinder::ClearHalosToProcess() { this->HalosToProcess->Reset(); diff --git a/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLSubhaloFinder.h b/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLSubhaloFinder.h index aeb8399b891..a80564b8f3f 100644 --- a/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLSubhaloFinder.h +++ b/ParaViewCore/VTKExtensions/CosmoTools/vtkPANLSubhaloFinder.h @@ -46,10 +46,22 @@ class VTKPVVTKEXTENSIONSCOSMOTOOLS_EXPORT vtkPANLSubhaloFinder : public vtkUnstr static vtkPANLSubhaloFinder* New(); void PrintSelf(ostream &os, vtkIndent indent); + // Description: + // Gets the halo to process at the given index + vtkIdType GetHaloToProcess(vtkIdType idx); // Description: // Adds a halo to the list of halos that will have the subhalo finder run on them void AddHaloToProcess(vtkIdType haloId); // Description: + // Sets the halo id to process at the given index in the list + void SetHaloToProcess(vtkIdType idx, vtkIdType haloId); + // Description: + // Sets the number of halos to process + void SetNumberOfHalosToProcess(vtkIdType num); + // Description: + // Gets the number of halos to process + vtkIdType GetNumberOfHalosToProcess(); + // Description: // Clears the list of halos that will have the subhalo finder run on them void ClearHalosToProcess(); diff --git a/ParaViewCore/VTKExtensions/Default/vtkPVExtractBagPlots.cxx b/ParaViewCore/VTKExtensions/Default/vtkPVExtractBagPlots.cxx index 5ea6f1c5adb..a8c1485af02 100644 --- a/ParaViewCore/VTKExtensions/Default/vtkPVExtractBagPlots.cxx +++ b/ParaViewCore/VTKExtensions/Default/vtkPVExtractBagPlots.cxx @@ -60,7 +60,7 @@ vtkPVExtractBagPlots::vtkPVExtractBagPlots() this->RobustPCA = false; this->Sigma = 1.; this->Internal = new PVExtractBagPlotsInternal(); - this->SetNumberOfOutputPorts(2); + this->SetNumberOfOutputPorts(1); } //---------------------------------------------------------------------------- @@ -101,15 +101,27 @@ int vtkPVExtractBagPlots::RequestData(vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector* outputVector) { + vtkInformation* outputInfo = outputVector->GetInformationObject(0); + vtkTable* inTable = vtkTable::GetData(inputVector[0]); - vtkTable* outTable = vtkTable::GetData(outputVector, 0); - vtkTable* outTable2 = vtkTable::GetData(outputVector, 1); + vtkMultiBlockDataSet* outTables = + vtkMultiBlockDataSet::SafeDownCast( + outputInfo->Get(vtkDataObject::DATA_OBJECT())); + + vtkTable* outTable = 0; + vtkTable* outTable2 = 0; if (inTable->GetNumberOfColumns() == 0) { return 1; } + if (!outTables) + { + return 0; + } + outTables->SetNumberOfBlocks(2); + vtkNew transpose; // Construct a table that holds only the selected columns @@ -125,7 +137,7 @@ int vtkPVExtractBagPlots::RequestData(vtkInformation*, vtkTable *inputTable = subTable.GetPointer(); - outTable->ShallowCopy(subTable.GetPointer()); + outTable = subTable.GetPointer(); if (this->TransposeTable) { @@ -137,7 +149,7 @@ int vtkPVExtractBagPlots::RequestData(vtkInformation*, inputTable = transpose->GetOutput(); } - outTable2->ShallowCopy(inputTable); + outTable2 = inputTable; // Compute PCA @@ -162,7 +174,7 @@ int vtkPVExtractBagPlots::RequestData(vtkInformation*, vtkTable* outputPCATable = vtkTable::SafeDownCast( pca->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); - outTable2->ShallowCopy(outputPCATable); + outTable2 = outputPCATable; // Compute HDR @@ -199,12 +211,11 @@ int vtkPVExtractBagPlots::RequestData(vtkInformation*, vtkMultiBlockDataSet* outputHDR = vtkMultiBlockDataSet::SafeDownCast( hdr->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); vtkTable* outputHDRTable = vtkTable::SafeDownCast(outputHDR->GetBlock(0)); - outTable2->ShallowCopy(outputHDRTable); + outTable2 = outputHDRTable; vtkAbstractArray *cname = inputTable->GetColumnByName("ColName"); if (cname) { outputHDRTable->AddColumn(cname); - outTable2->AddColumn(cname); } else { @@ -230,7 +241,22 @@ int vtkPVExtractBagPlots::RequestData(vtkInformation*, ebp->Update(); vtkTable* outBPTable = ebp->GetOutput(); - outTable->ShallowCopy(outBPTable); + outTable = outBPTable; + + unsigned int blockID = 0; + outTables->SetBlock(blockID, outTable); + outTables->GetMetaData(blockID)->Set(vtkCompositeDataSet::NAME(), "Functional Bag Plot Data"); + blockID = 1; + outTables->SetBlock(blockID, outTable2); + outTables->GetMetaData(blockID)->Set(vtkCompositeDataSet::NAME(), "Bag Plot Data"); return 1; } + +//---------------------------------------------------------------------------- +int vtkPVExtractBagPlots +::FillInputPortInformation( int vtkNotUsed(port), vtkInformation *info ) +{ + info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkTable"); + return 1; +} diff --git a/ParaViewCore/VTKExtensions/Default/vtkPVExtractBagPlots.h b/ParaViewCore/VTKExtensions/Default/vtkPVExtractBagPlots.h index 9673b7398d3..615f5a95027 100644 --- a/ParaViewCore/VTKExtensions/Default/vtkPVExtractBagPlots.h +++ b/ParaViewCore/VTKExtensions/Default/vtkPVExtractBagPlots.h @@ -20,15 +20,16 @@ #define __vtkPVExtractBagPlots_h #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports -#include "vtkTransposeTable.h" +#include "vtkMultiBlockDataSetAlgorithm.h" class PVExtractBagPlotsInternal; -class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkPVExtractBagPlots : public vtkTransposeTable +class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkPVExtractBagPlots + : public vtkMultiBlockDataSetAlgorithm { public: static vtkPVExtractBagPlots* New(); - vtkTypeMacro(vtkPVExtractBagPlots, vtkTransposeTable); + vtkTypeMacro(vtkPVExtractBagPlots, vtkMultiBlockDataSetAlgorithm); virtual void PrintSelf(ostream& os, vtkIndent indent); // Description: @@ -56,6 +57,8 @@ class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkPVExtractBagPlots : public vtkTranspos vtkPVExtractBagPlots(); virtual ~vtkPVExtractBagPlots(); + virtual int FillInputPortInformation( int port, vtkInformation *info ); + int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*); diff --git a/ParaViewCore/VTKExtensions/Default/vtkPVLegacyGlyphFilter.cxx b/ParaViewCore/VTKExtensions/Default/vtkPVLegacyGlyphFilter.cxx index 836c1df0cde..613a231a037 100644 --- a/ParaViewCore/VTKExtensions/Default/vtkPVLegacyGlyphFilter.cxx +++ b/ParaViewCore/VTKExtensions/Default/vtkPVLegacyGlyphFilter.cxx @@ -487,7 +487,7 @@ void vtkPVLegacyGlyphFilter::CalculatePtsToGlyph(double PtsNotBlanked) this->BlockPointCounter = 0; this->BlockNumGlyphedPts = 0; - if( !this->KeepRandomPoints || !this->RandomPtsInDataset.size() || this->MaximumNumberOfPoints != this->MaximumNumberOfPointsOld ) + if( !this->KeepRandomPoints || this->RandomPtsInDataset.empty() || this->MaximumNumberOfPoints != this->MaximumNumberOfPointsOld ) { //Reset the random points vector this->RandomPtsInDataset.clear(); diff --git a/ParaViewCore/VTKExtensions/Default/vtkPhastaReader.cxx b/ParaViewCore/VTKExtensions/Default/vtkPhastaReader.cxx index 75696305d1c..b296129ef78 100644 --- a/ParaViewCore/VTKExtensions/Default/vtkPhastaReader.cxx +++ b/ParaViewCore/VTKExtensions/Default/vtkPhastaReader.cxx @@ -560,7 +560,7 @@ int vtkPhastaReader::RequestData(vtkInformation*, points->Delete(); } - if (!this->Internal->FieldInfoMap.size()) + if (this->Internal->FieldInfoMap.empty()) { vtkDataSetAttributes* field = output->GetPointData(); this->ReadFieldFile(this->FieldFileName, fvn, field, noOfNodes); diff --git a/ParaViewCore/VTKExtensions/Default/vtkSciVizStatistics.cxx b/ParaViewCore/VTKExtensions/Default/vtkSciVizStatistics.cxx index c6799af96de..63aff267c0f 100644 --- a/ParaViewCore/VTKExtensions/Default/vtkSciVizStatistics.cxx +++ b/ParaViewCore/VTKExtensions/Default/vtkSciVizStatistics.cxx @@ -221,7 +221,7 @@ int vtkSciVizStatistics::RequestData( return 1; } - if ( ! this->P->Buffer.size() ) + if ( this->P->Buffer.empty() ) { // Silently ignore empty requests. return 1; diff --git a/Plugins/SciberQuestToolKit/SciberQuest/GDAMetaData.cxx b/Plugins/SciberQuestToolKit/SciberQuest/GDAMetaData.cxx index c1f3972343b..f0a1e0ed4a1 100644 --- a/Plugins/SciberQuestToolKit/SciberQuest/GDAMetaData.cxx +++ b/Plugins/SciberQuestToolKit/SciberQuest/GDAMetaData.cxx @@ -356,7 +356,7 @@ int GDAMetaData::OpenDatasetForRead(const char *fileName) prefix+="_"; } GetSeriesIds(path,prefix.c_str(),this->TimeSteps); - if (!this->TimeSteps.size()) + if (this->TimeSteps.empty()) { sqErrorMacro(std::cerr, << " Error: Time series was not found in " << path << "." diff --git a/Plugins/SciberQuestToolKit/SciberQuest/vtkSQFTLE.cxx b/Plugins/SciberQuestToolKit/SciberQuest/vtkSQFTLE.cxx index 553a152012b..b3f41ead9c8 100644 --- a/Plugins/SciberQuestToolKit/SciberQuest/vtkSQFTLE.cxx +++ b/Plugins/SciberQuestToolKit/SciberQuest/vtkSQFTLE.cxx @@ -247,7 +247,7 @@ void vtkSQFTLE::ClearInputArrays() << "=====vtkSQFTLE::ClearInputArrays" << std::endl; #endif - if (this->InputArrays.size()) + if (!this->InputArrays.empty()) { this->InputArrays.clear(); this->Modified(); diff --git a/Plugins/SciberQuestToolKit/SciberQuest/vtkSQImageGhosts.cxx b/Plugins/SciberQuestToolKit/SciberQuest/vtkSQImageGhosts.cxx index 4273d979b8b..54ee53a03a7 100644 --- a/Plugins/SciberQuestToolKit/SciberQuest/vtkSQImageGhosts.cxx +++ b/Plugins/SciberQuestToolKit/SciberQuest/vtkSQImageGhosts.cxx @@ -157,7 +157,7 @@ void vtkSQImageGhosts::ClearArraysToCopy() pCerr() << "=====vtkSQImageGhosts::ClearArraysToCopy" << std::endl; #endif - if (this->ArraysToCopy.size()) + if (!this->ArraysToCopy.empty()) { this->ArraysToCopy.clear(); this->Modified(); diff --git a/Plugins/SciberQuestToolKit/SciberQuest/vtkSQKernelConvolution.cxx b/Plugins/SciberQuestToolKit/SciberQuest/vtkSQKernelConvolution.cxx index f477c0d3a6b..e5df9248fc9 100644 --- a/Plugins/SciberQuestToolKit/SciberQuest/vtkSQKernelConvolution.cxx +++ b/Plugins/SciberQuestToolKit/SciberQuest/vtkSQKernelConvolution.cxx @@ -396,7 +396,7 @@ void vtkSQKernelConvolution::ClearInputArrays() << "=====vtkSQKernelConvolution::ClearInputArrays" << std::endl; #endif - if (this->InputArrays.size()) + if (!this->InputArrays.empty()) { this->InputArrays.clear(); this->Modified(); @@ -425,7 +425,7 @@ void vtkSQKernelConvolution::ClearArraysToCopy() pCerr() << "=====vtkSQKernelConvolution::ClearArraysToCopy" << std::endl; #endif - if (this->ArraysToCopy.size()) + if (!this->ArraysToCopy.empty()) { this->ArraysToCopy.clear(); this->Modified(); @@ -1225,7 +1225,7 @@ int vtkSQKernelConvolution::RequestData( } // Deep copy the input - if (this->ArraysToCopy.size()) + if (!this->ArraysToCopy.empty()) { if (this->LogLevel || globalLogLevel) { diff --git a/Plugins/SciberQuestToolKit/SciberQuest/vtkSQVortexFilter.cxx b/Plugins/SciberQuestToolKit/SciberQuest/vtkSQVortexFilter.cxx index 5550934c04e..74d6c483d96 100644 --- a/Plugins/SciberQuestToolKit/SciberQuest/vtkSQVortexFilter.cxx +++ b/Plugins/SciberQuestToolKit/SciberQuest/vtkSQVortexFilter.cxx @@ -192,7 +192,7 @@ void vtkSQVortexFilter::ClearInputArrays() << "=====vtkSQVortexFilter::ClearInputArrays" << std::endl; #endif - if (this->InputArrays.size()) + if (!this->InputArrays.empty()) { this->InputArrays.clear(); this->Modified(); @@ -221,7 +221,7 @@ void vtkSQVortexFilter::ClearArraysToCopy() pCerr() << "=====vtkSQVortexFilter::ClearArraysToCopy" << std::endl; #endif - if (this->ArraysToCopy.size()) + if (!this->ArraysToCopy.empty()) { this->ArraysToCopy.clear(); this->Modified(); diff --git a/Qt/ApplicationComponents/pqQtMessageHandlerBehavior.cxx b/Qt/ApplicationComponents/pqQtMessageHandlerBehavior.cxx index fd3689c86fd..2199c27fecc 100644 --- a/Qt/ApplicationComponents/pqQtMessageHandlerBehavior.cxx +++ b/Qt/ApplicationComponents/pqQtMessageHandlerBehavior.cxx @@ -78,7 +78,7 @@ static void QtMessageOutput(QtMsgType type, const char *msg) vtkOutputWindow::GetInstance()->DisplayText(msg); break; case QtWarningMsg: - vtkOutputWindow::GetInstance()->DisplayErrorText(msg); + vtkOutputWindow::GetInstance()->DisplayWarningText(msg); break; case QtCriticalMsg: vtkOutputWindow::GetInstance()->DisplayErrorText(msg); diff --git a/Qt/Components/pqSearchBox.cxx b/Qt/Components/pqSearchBox.cxx index 3bd4ad81654..45ed1639e82 100644 --- a/Qt/Components/pqSearchBox.cxx +++ b/Qt/Components/pqSearchBox.cxx @@ -93,13 +93,17 @@ pqSearchBox::~pqSearchBox() //----------------------------------------------------------------------------- void pqSearchBox::keyPressEvent(QKeyEvent* keyEvent) { - this->Superclass::keyPressEvent(keyEvent); - // Remove the current text in the line edit on escape pressed - if (keyEvent && keyEvent->key() == Qt::Key_Escape) + if (keyEvent && + keyEvent->key() == Qt::Key_Escape && + !this->Internals->SearchLineEdit->text().isEmpty()) { this->Internals->SearchLineEdit->clear(); } + else + { + this->Superclass::keyPressEvent(keyEvent); + } } //----------------------------------------------------------------------------- diff --git a/Qt/Components/pqSettingsDialog.cxx b/Qt/Components/pqSettingsDialog.cxx index 19c7e457cb7..e3dbc6734d7 100644 --- a/Qt/Components/pqSettingsDialog.cxx +++ b/Qt/Components/pqSettingsDialog.cxx @@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "pqProxyWidget.h" #include "pqSearchBox.h" #include "pqServer.h" +#include "pqServerManagerModel.h" #include "pqSettings.h" #include "pqUndoStack.h" #include "vtkNew.h" @@ -52,6 +53,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include #include @@ -65,6 +67,8 @@ class pqSettingsDialog::pqInternals // Map from tab indices to stack widget indices. This is needed because there // are more widgets in the stacked widgets than just what we add. QMap TabToStackedWidgets; + + QPointer Server; }; bool pqSettingsDialog::ShowRestartRequired = false; @@ -87,6 +91,8 @@ pqSettingsDialog::pqSettingsDialog(QWidget* parentObject, Qt::WindowFlags f) QList proxies_to_show; pqServer* server = pqActiveObjects::instance().activeServer(); + this->Internals->Server = server; + vtkNew iter; iter->SetSession(server->session()); iter->SetModeToOneGroup(); @@ -167,6 +173,9 @@ pqSettingsDialog::pqSettingsDialog(QWidget* parentObject, Qt::WindowFlags f) this->onTabIndexChanged(0); this->filterPanelWidgets(); + + pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel(); + this->connect(smmodel, SIGNAL(serverRemoved(pqServer*)), SLOT(serverRemoved(pqServer*))); } //----------------------------------------------------------------------------- @@ -176,6 +185,16 @@ pqSettingsDialog::~pqSettingsDialog() this->Internals = NULL; } +//----------------------------------------------------------------------------- +void pqSettingsDialog::serverRemoved(pqServer* server) +{ + // BUG #14957: Close this dialog if the server session closes. + if (this->Internals->Server == server) + { + this->close(); + } +} + //----------------------------------------------------------------------------- void pqSettingsDialog::clicked(QAbstractButton *button) { diff --git a/Qt/Components/pqSettingsDialog.h b/Qt/Components/pqSettingsDialog.h index 8f04603d496..7dffe21a4c9 100644 --- a/Qt/Components/pqSettingsDialog.h +++ b/Qt/Components/pqSettingsDialog.h @@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "pqComponentsModule.h" +class pqServer; class QAbstractButton; class vtkSMProperty; @@ -62,6 +63,10 @@ private slots: void filterPanelWidgets(); + /// Callback for when pqServerManagerModel notifies the application that the + /// server is being removed. We close the dialog. + void serverRemoved(pqServer*); + signals: void filterWidgets(bool showAdvanced, const QString& text); diff --git a/Qt/Core/CMakeLists.txt b/Qt/Core/CMakeLists.txt index 3b4f7f387c5..5c259deb8a3 100644 --- a/Qt/Core/CMakeLists.txt +++ b/Qt/Core/CMakeLists.txt @@ -43,6 +43,8 @@ set(Module_SRCS pqAutoStartInterface.h pqBoxChartView.cxx pqBoxChartView.h + pqCheckBoxDelegate.h + pqCheckBoxDelegate.cxx pqCollaborationEventPlayer.cxx pqCollaborationEventPlayer.h pqCollaborationManager.cxx @@ -115,6 +117,8 @@ set(Module_SRCS pqOutputWindowAdapter.h pqOutputWindow.cxx pqOutputWindow.h + pqOutputWindowModel.cxx + pqOutputWindowModel.h pqParallelCoordinatesChartView.cxx pqParallelCoordinatesChartView.h pqPipelineFilter.cxx @@ -225,6 +229,7 @@ set (Module_MOC_HDRS pqAnimationScene.h pqApplicationCore.h pqBoxChartView.h + pqCheckBoxDelegate.h pqCollaborationEventPlayer.h pqCollaborationManager.h pqComparativeContextView.h @@ -256,6 +261,7 @@ set (Module_MOC_HDRS pqOutputPort.h pqOutputWindowAdapter.h pqOutputWindow.h + pqOutputWindowModel.h pqParallelCoordinatesChartView.h pqPipelineFilter.h pqPipelineRepresentation.h diff --git a/Qt/Core/Resources/UI/pqOutputWindow.ui b/Qt/Core/Resources/UI/pqOutputWindow.ui index 9106aab48dc..dc251f07fa0 100644 --- a/Qt/Core/Resources/UI/pqOutputWindow.ui +++ b/Qt/Core/Resources/UI/pqOutputWindow.ui @@ -1,7 +1,8 @@ - + + pqOutputWindow - - + + 0 0 @@ -9,41 +10,79 @@ 400 - - - 1 - 1 + + 0 0 - + Dialog - + false - - - 8 - - + + 6 - - - + + 8 + + + + 0 - + + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + + + + + + + + + 6 + + 0 + + + + + Console View + + + - + Qt::Horizontal - + 131 31 @@ -52,24 +91,28 @@ - - + + Clear - - + + + Filter + + + + + + Close - - - @@ -80,7 +123,7 @@ - + @@ -89,11 +132,11 @@ pqOutputWindow accept() - + 316 198 - + 139 199 diff --git a/Qt/Core/pqApplicationCore.cxx b/Qt/Core/pqApplicationCore.cxx index 5bac2762631..59a7f2a5939 100644 --- a/Qt/Core/pqApplicationCore.cxx +++ b/Qt/Core/pqApplicationCore.cxx @@ -511,8 +511,11 @@ pqSettings* pqApplicationCore::settings() QApplication::applicationName() + QApplication::applicationVersion(), this); } - vtkProcessModuleAutoMPI::SetEnableAutoMPI(this->Settings->value("autoMPI").toBool()); - vtkProcessModuleAutoMPI::SetNumberOfCores(this->Settings->value("autoMPI_NumberOfCores").toInt()); + + vtkProcessModuleAutoMPI::SetEnableAutoMPI( + this->Settings->value("GeneralSettings.EnableAutoMPI").toBool()); + vtkProcessModuleAutoMPI::SetNumberOfCores( + this->Settings->value("GeneralSettings.AutoMPILimit").toInt()); } return this->Settings; } @@ -570,12 +573,6 @@ void pqApplicationCore::showOutputWindow() this->OutputWindow->activateWindow(); } -//----------------------------------------------------------------------------- -void pqApplicationCore::disableOutputWindow() -{ - this->OutputWindowAdapter->setActive(false); -} - //----------------------------------------------------------------------------- void pqApplicationCore::loadConfiguration(const QString& filename) { diff --git a/Qt/Core/pqApplicationCore.h b/Qt/Core/pqApplicationCore.h index e564cdd7256..71c497290f9 100644 --- a/Qt/Core/pqApplicationCore.h +++ b/Qt/Core/pqApplicationCore.h @@ -85,10 +85,6 @@ class PQCORE_EXPORT pqApplicationCore : public QObject /// options will be created. pqApplicationCore(int& argc, char** argv, pqOptions* options=0, QObject* parent=0); - /// Dangerous option that disables the debug output window, intended for - /// demo purposes only - void disableOutputWindow(); - /// Provides access to the command line options object. pqOptions* getOptions() const { return this->Options; } @@ -180,6 +176,9 @@ class PQCORE_EXPORT pqApplicationCore : public QObject pqOutputWindowAdapter* outputWindowAdapter() { return this->OutputWindowAdapter; } + pqOutputWindow* outputWindow() + { return this->OutputWindow; } + /// It is possible to change the display policy used by /// the application. Used to change the active display /// policy. The pqApplicationCore takes over the ownership of the display policy. diff --git a/Qt/Core/pqCheckBoxDelegate.cxx b/Qt/Core/pqCheckBoxDelegate.cxx new file mode 100644 index 00000000000..53f2b3229b9 --- /dev/null +++ b/Qt/Core/pqCheckBoxDelegate.cxx @@ -0,0 +1,167 @@ +/*========================================================================= + + Program: ParaView + Module: pqOutputWindow.h + + Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. + All rights reserved. + + ParaView is a free software; you can redistribute it and/or modify it + under the terms of the ParaView license version 1.2. + + See License_v1.2.txt for the full ParaView license. + A copy of this license can be obtained by contacting + Kitware Inc. + 28 Corporate Drive + Clifton Park, NY 12065 + USA + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=========================================================================*/ + +#include "pqCheckBoxDelegate.h" + +#include +#include +#include + +#include +#include + + +namespace +{ +QRect CheckBoxRect(const QStyleOptionViewItem &option) +{ + QStyleOptionButton checkBoxOption; + QRect checkBoxRect = QApplication::style()->subElementRect( + QStyle::SE_CheckBoxIndicator, &checkBoxOption); + QPoint checkBoxPoint(option.rect.x() + + option.rect.width() / 2 - + checkBoxRect.width() / 2, + option.rect.y() + + option.rect.height() / 2 - + checkBoxRect.height() / 2); + return QRect(checkBoxPoint, checkBoxRect.size()); +} +}; + +struct pqCheckBoxDelegate::pqInternals +{ + pqInternals() + { + const double PI =3.141592653589793238463; + this->ContractedPolygon << QPointF(1.0, 0.0) + << QPointF(cos(2*PI/3), sin(2*PI/3)) + << QPointF(cos(-2*PI/3), sin(-2*PI/3)); + this->ExpandedPolygon << QPointF(0.0, 1.0) + << QPointF(cos(-PI/6), sin(-PI/6)) + << QPointF(cos(-5*PI/6), sin(-5*PI/6)); + } + QPolygonF ContractedPolygon; + QPolygonF ExpandedPolygon; +}; + +pqCheckBoxDelegate::pqCheckBoxDelegate(QObject *_parent) + : QStyledItemDelegate(_parent) +{ + this->Internals = new pqInternals(); +} + +pqCheckBoxDelegate::~pqCheckBoxDelegate() +{ + delete this->Internals; +} + +void pqCheckBoxDelegate::paint(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const +{ + QVariant d = index.model()->data(index, Qt::DisplayRole); + if (!d.isNull()) + { + int checked = d.toInt(); + QRect rect = CheckBoxRect(option); + QPalette palette = qApp->palette(); + if (checked == pqCheckBoxDelegate::NOT_EXPANDED_DISABLED) + { + checked = pqCheckBoxDelegate::NOT_EXPANDED; + painter->setBrush(palette.brush(QPalette::Disabled, QPalette::ButtonText)); + } + else + { + painter->setBrush(palette.brush(QPalette::Active, QPalette::ButtonText)); + } + double PaintingScaleFactor = + ((double)rect.bottomLeft().y() - rect.topLeft().y()) * 0.5; + painter->save(); + painter->translate(rect.center()); + painter->scale(PaintingScaleFactor, PaintingScaleFactor); + + switch(checked) + { + case pqCheckBoxDelegate::EXPANDED: + painter->drawPolygon(this->Internals->ExpandedPolygon, Qt::WindingFill); + break; + case pqCheckBoxDelegate::NOT_EXPANDED: + painter->drawPolygon(this->Internals->ContractedPolygon, Qt::WindingFill); + break; + } + painter->restore(); + } +} + +bool pqCheckBoxDelegate::editorEvent(QEvent *_event, + QAbstractItemModel *model, + const QStyleOptionViewItem &option, + const QModelIndex &index) +{ + QVariant d = index.model()->data(index, Qt::DisplayRole); + if (!d.isNull()) + { + int checked = d.toInt(); + if (checked != pqCheckBoxDelegate::NOT_EXPANDED_DISABLED) + { + if ((_event->type() == QEvent::MouseButtonRelease) || + (_event->type() == QEvent::MouseButtonDblClick)) + { + QMouseEvent *mouse_event = static_cast(_event); + if (mouse_event->button() != Qt::LeftButton || + !CheckBoxRect(option).contains(mouse_event->pos())) + { + return false; + } + if (_event->type() == QEvent::MouseButtonDblClick) + { + return true; + } + } + else if (_event->type() == QEvent::KeyPress) + { + if (static_cast(_event)->key() != Qt::Key_Space && + static_cast(_event)->key() != Qt::Key_Select) + { + return false; + } + } + else + { + return false; + } + + return model->setData(index, !checked, Qt::EditRole); + } + } + return false; +} diff --git a/Qt/Core/pqCheckBoxDelegate.h b/Qt/Core/pqCheckBoxDelegate.h new file mode 100644 index 00000000000..c4733203332 --- /dev/null +++ b/Qt/Core/pqCheckBoxDelegate.h @@ -0,0 +1,66 @@ +/*========================================================================= + + Program: ParaView + Module: pqOutputWindow.h + + Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. + All rights reserved. + + ParaView is a free software; you can redistribute it and/or modify it + under the terms of the ParaView license version 1.2. + + See License_v1.2.txt for the full ParaView license. + A copy of this license can be obtained by contacting + Kitware Inc. + 28 Corporate Drive + Clifton Park, NY 12065 + USA + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=========================================================================*/ + +#include "pqCoreModule.h" +#include + +/// Delegate for QTableView to draw a checkbox as an left-right (unchecked) +/// and top-bottom (checked) arrow. +/// The checkbox has an extra state for unchecked disabled. +/// Based on a Stack overflow answer: +/// http://stackoverflow.com/questions/3363190/qt-qtableview-how-to-have-a-checkbox-only-column +class PQCORE_EXPORT pqCheckBoxDelegate : public QStyledItemDelegate +{ + Q_OBJECT + +public: + enum CheckBoxValues + { + NOT_EXPANDED, + EXPANDED, + NOT_EXPANDED_DISABLED + }; + + pqCheckBoxDelegate(QObject *parent); + ~pqCheckBoxDelegate(); + + void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const; + bool editorEvent(QEvent *event, + QAbstractItemModel *model, + const QStyleOptionViewItem &option, + const QModelIndex &index); +private: + Q_DISABLE_COPY(pqCheckBoxDelegate) + struct pqInternals; + pqInternals* Internals; +}; diff --git a/Qt/Core/pqOutputWindow.cxx b/Qt/Core/pqOutputWindow.cxx index 92ec4045e82..c9996c2af0b 100644 --- a/Qt/Core/pqOutputWindow.cxx +++ b/Qt/Core/pqOutputWindow.cxx @@ -30,20 +30,86 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =========================================================================*/ +#include +#include +#include +#include + + #include "pqApplicationCore.h" +#include "pqCheckBoxDelegate.h" #include "pqOutputWindow.h" +#include "pqOutputWindowModel.h" #include "pqSettings.h" + +#include "vtkObjectFactory.h" + #include "ui_pqOutputWindow.h" -#include + +namespace +{ +const int LOOK_BACK = 4; + +bool parsePythonMessage( + const QString& text, QList* location, QList* message) +{ + QRegExp reMessage("(Traceback .*\n(?: +.*\n)+)([^ ].*)"); + int pos = 0; + + while ((pos = reMessage.indexIn(text, pos)) != -1) + { + location->push_back(reMessage.cap(1).trimmed()); + message->push_back(reMessage.cap(2).trimmed()); + std::cerr << location->at(location->size() - 1).toStdString() << std::endl; + pos += reMessage.matchedLength(); + } + return location->size() > 0; +} + + +bool parseVtkMessage(int messageType, + const QString& text, QString* location, QString* message) +{ + // WARNING: This array has to match the order of pqOutputWindow::MessageType + const char* messageStart[] = {"ERROR: ", "Warning: ", + "Debug : "}; + const char* reAlternateWarningPattern = "Generic Warning: (.* line \\d+)(.*)"; + const char* reLast = "(.*0x\\d+[^:]*): (.+)"; + QString reMessagePattern = QString(messageStart[messageType]) + reLast; + QRegExp reMessage(reMessagePattern); + QRegExp reAlternateWarning(reAlternateWarningPattern); + if (reMessage.exactMatch(text)) + { + *location = reMessage.cap(1); + *message = reMessage.cap(2); + return true; + } + else if(messageType == pqOutputWindow::WARNING && + reAlternateWarning.exactMatch(text)) + { + *location = reAlternateWarning.cap(1); + *message = reAlternateWarning.cap(2); + return true; + } + return false; +} +}; ////////////////////////////////////////////////////////////////////// // pqOutputWindow::pqImplementation struct pqOutputWindow::pqImplementation { + pqImplementation(QObject* parent) + { + // pqOutputWindow is the parent, so this object is deleted then. + this->TableModel = new pqOutputWindowModel(parent, Messages); + } Ui::pqOutputWindow Ui; + QList Messages; + pqOutputWindowModel* TableModel; }; ////////////////////////////////////////////////////////////////////// @@ -51,65 +117,108 @@ struct pqOutputWindow::pqImplementation pqOutputWindow::pqOutputWindow(QWidget* Parent) : Superclass(Parent), - Implementation(new pqImplementation()) -{ - this->Implementation->Ui.setupUi(this); + Implementation(new pqImplementation(this)) +{ + for (int i = 0; i < MESSAGE_TYPE_COUNT; ++i) + { + this->Show[i] = true; + } + Ui::pqOutputWindow& ui = this->Implementation->Ui; + ui.setupUi(this); + this->Implementation->TableModel->setView(ui.tableView); this->setObjectName("outputDialog"); this->setWindowTitle(tr("Output Messages")); - this->ShowOutput = true; - QObject::connect(this->Implementation->Ui.clearButton, + QObject::connect(ui.clearButton, SIGNAL(clicked(bool)), this, SLOT(clear())); + QObject::connect(ui.checkBoxConsoleView, + SIGNAL(stateChanged(int)), this, SLOT(setConsoleView(int))); + QMenu* filterMenu = new QMenu(); + QAction* errorAction = new QAction (tr("Errors"), this); + errorAction->setCheckable(true); + errorAction->setChecked(true); + filterMenu->addAction (errorAction); + QObject::connect(errorAction, SIGNAL(toggled(bool)), + this, SLOT(errorToggled(bool))); + QAction* warningAction = new QAction (tr("Warnings"), this); + warningAction->setCheckable(true); + warningAction->setChecked(true); + QObject::connect(warningAction, SIGNAL(toggled(bool)), + this, SLOT(warningToggled(bool))); + filterMenu->addAction(warningAction); + QAction* debugAction = new QAction (tr("Debug"), this); + debugAction->setCheckable(true); + debugAction->setChecked(true); + QObject::connect(debugAction, SIGNAL(toggled(bool)), + this, SLOT(debugToggled(bool))); + filterMenu->addAction(debugAction); + ui.filterButton->setMenu(filterMenu); + + ui.tableView->verticalHeader()->hide(); + ui.tableView->horizontalHeader()->hide(); + ui.tableView->setShowGrid(false); + ui.tableView->horizontalHeader()->setStretchLastSection(true); + ui.tableView->setSelectionMode(QAbstractItemView::NoSelection); + ui.tableView->setFocusPolicy(Qt::NoFocus); + ui.tableView->setItemDelegateForColumn(0, new pqCheckBoxDelegate(ui.tableView)); + ui.tableView->setModel(this->Implementation->TableModel); } pqOutputWindow::~pqOutputWindow() { - delete Implementation; } void pqOutputWindow::onDisplayTextInWindow(const QString& text) { - QTextCharFormat format = this->Implementation->Ui.consoleWidget->getFormat(); + Ui::pqOutputWindow& ui = this->Implementation->Ui; + QTextCharFormat format = ui.consoleWidget->getFormat(); format.setForeground(Qt::darkGreen); format.clearBackground(); - this->Implementation->Ui.consoleWidget->setFormat(format); - this->Implementation->Ui.consoleWidget->printString(text); - if (this->ShowOutput && !text.trimmed().isEmpty()) + ui.consoleWidget->setFormat(format); + ui.consoleWidget->printString(text); + if (!text.trimmed().isEmpty()) { this->show(); + this->addPythonMessages(DEBUG, text); } } void pqOutputWindow::onDisplayErrorTextInWindow(const QString& text) { - QTextCharFormat format = this->Implementation->Ui.consoleWidget->getFormat(); + Ui::pqOutputWindow& ui = this->Implementation->Ui; + QTextCharFormat format = ui.consoleWidget->getFormat(); format.setForeground(Qt::darkRed); format.clearBackground(); - this->Implementation->Ui.consoleWidget->setFormat(format); - this->Implementation->Ui.consoleWidget->printString(text); - if (this->ShowOutput && !text.trimmed().isEmpty()) + ui.consoleWidget->setFormat(format); + ui.consoleWidget->printString(text); + if (!text.trimmed().isEmpty()) { this->show(); + this->addPythonMessages(ERROR, text); } + } void pqOutputWindow::onDisplayText(const QString& text) { - QTextCharFormat format = this->Implementation->Ui.consoleWidget->getFormat(); + Ui::pqOutputWindow& ui = this->Implementation->Ui; + QTextCharFormat format = ui.consoleWidget->getFormat(); format.setForeground(Qt::darkGreen); format.clearBackground(); - this->Implementation->Ui.consoleWidget->setFormat(format); + ui.consoleWidget->setFormat(format); - this->Implementation->Ui.consoleWidget->printString(text + "\n"); + ui.consoleWidget->printString(text + "\n"); cerr << text.toLatin1().data() << endl; - if (this->ShowOutput && !text.trimmed().isEmpty()) + if (!text.trimmed().isEmpty()) { this->show(); + this->addMessage(DEBUG, text); } } void pqOutputWindow::onDisplayWarningText(const QString& text) { + Ui::pqOutputWindow& ui = this->Implementation->Ui; if ( text.contains("QEventDispatcherUNIX::unregisterTimer", Qt::CaseSensitive) || text.contains("looking for 'HistogramView") || @@ -119,38 +228,42 @@ void pqOutputWindow::onDisplayWarningText(const QString& text) { return; } - QTextCharFormat format = this->Implementation->Ui.consoleWidget->getFormat(); + QTextCharFormat format = ui.consoleWidget->getFormat(); format.setForeground(Qt::black); format.clearBackground(); - this->Implementation->Ui.consoleWidget->setFormat(format); + ui.consoleWidget->setFormat(format); - this->Implementation->Ui.consoleWidget->printString(text + "\n"); + ui.consoleWidget->printString(text + "\n"); cerr << text.toLatin1().data() << endl; - if (this->ShowOutput && !text.trimmed().isEmpty()) + if (!text.trimmed().isEmpty()) { this->show(); + this->addMessage(WARNING, text); } } void pqOutputWindow::onDisplayGenericWarningText(const QString& text) { - QTextCharFormat format = this->Implementation->Ui.consoleWidget->getFormat(); + Ui::pqOutputWindow& ui = this->Implementation->Ui; + QTextCharFormat format = ui.consoleWidget->getFormat(); format.setForeground(Qt::black); format.clearBackground(); - this->Implementation->Ui.consoleWidget->setFormat(format); + ui.consoleWidget->setFormat(format); - this->Implementation->Ui.consoleWidget->printString(text + "\n"); + ui.consoleWidget->printString(text + "\n"); cerr << text.toLatin1().data() << endl; - if (this->ShowOutput && !text.trimmed().isEmpty()) + if (!text.trimmed().isEmpty()) { this->show(); + this->addMessage(WARNING, text); } } void pqOutputWindow::onDisplayErrorText(const QString& text) { + Ui::pqOutputWindow& ui = this->Implementation->Ui; if ( text.contains("Unrecognised OpenGL version") || /* Skip DBusMenuExporterPrivate errors. These, I suspect, are due to @@ -161,17 +274,18 @@ void pqOutputWindow::onDisplayErrorText(const QString& text) return; } - QTextCharFormat format = this->Implementation->Ui.consoleWidget->getFormat(); + QTextCharFormat format = ui.consoleWidget->getFormat(); format.setForeground(Qt::darkRed); format.clearBackground(); - this->Implementation->Ui.consoleWidget->setFormat(format); + ui.consoleWidget->setFormat(format); - this->Implementation->Ui.consoleWidget->printString(text + "\n"); + ui.consoleWidget->printString(text + "\n"); cerr << text.toLatin1().data() << endl; - if (this->ShowOutput && !text.trimmed().isEmpty()) + if (!text.trimmed().isEmpty()) { this->show(); + this->addMessage(ERROR, text); } } @@ -189,7 +303,10 @@ void pqOutputWindow::reject() void pqOutputWindow::clear() { - this->Implementation->Ui.consoleWidget->clear(); + Ui::pqOutputWindow& ui = this->Implementation->Ui; + ui.consoleWidget->clear(); + this->Implementation->Messages.clear(); + this->Implementation->TableModel->clear(); } void pqOutputWindow::showEvent(QShowEvent* e) @@ -211,3 +328,81 @@ void pqOutputWindow::hideEvent(QHideEvent* e) } Superclass::hideEvent(e); } + +void pqOutputWindow::setConsoleView(int on) +{ + Ui::pqOutputWindow& ui = this->Implementation->Ui; + ui.stackedWidget->setCurrentIndex(on ? 1 : 0); +} + +void pqOutputWindow::errorToggled(bool checked) +{ + this->Show[ERROR] = checked; + this->Implementation->TableModel->ShowMessages(this->Show); +} + +void pqOutputWindow::warningToggled(bool checked) +{ + this->Show[WARNING] = checked; + this->Implementation->TableModel->ShowMessages(this->Show); +} + +void pqOutputWindow::debugToggled(bool checked) +{ + this->Show[DEBUG] = checked; + this->Implementation->TableModel->ShowMessages(this->Show); +} + + +void pqOutputWindow::addMessage(int messageType, const QString& text) +{ + QString location; + QString message = text; + //const char* s = "Traceback (most recent call last):\n File \"\", line 4, in \n File \"/home/danlipsa/build/ParaView-output-window-15240/lib/site-packages/paraview/calculator.py\", line 102, in execute\n retVal = compute(inputs, expression, ns=variables)\n File \"/home/danlipsa/build/ParaView-output-window-15240/lib/site-packages/paraview/calculator.py\", line 74, in compute\n retVal = eval(expression, globals(), mylocals)\n File \"\", line 1\n $\n ^\nSyntaxError: unexpected EOF while parsing"; + //parsePythonMessage(0, s, &location, &message); + parseVtkMessage(messageType, text, &location, &message); + this->addMessage(messageType, location.trimmed(), message.trimmed()); +} + +void pqOutputWindow::addPythonMessages(int messageType, const QString& text) +{ + QList location; + QList message; + if (parsePythonMessage(text, &location, &message)) + { + for (int i = 0; i < location.size(); ++i) + { + this->addMessage(messageType, location[i], message[i]); + } + } + else + { + this->addMessage(messageType, "", text); + } +} + + +void pqOutputWindow::addMessage(int messageType, + const QString& location, const QString& message) +{ + int i = 0; + for (; i < LOOK_BACK && this->Implementation->Messages.size() - 1 - i >= 0; ++i) + { + MessageT& wholeMessage = this->Implementation->Messages[ + this->Implementation->Messages.size() - 1 - i]; + if (wholeMessage.Type == messageType && + (location.isEmpty() ? wholeMessage.Message == message : + wholeMessage.Location == location)) + { + ++wholeMessage.Count; + return; + } + } + // this is a new message + this->Implementation->Messages.push_back( + MessageT(pqOutputWindow::MessageType(messageType), 1, location, message)); + if (this->Show[messageType]) + { + this->Implementation->TableModel->appendLastRow(); + } +} diff --git a/Qt/Core/pqOutputWindow.h b/Qt/Core/pqOutputWindow.h index f432cca8daf..a8f119e1e08 100644 --- a/Qt/Core/pqOutputWindow.h +++ b/Qt/Core/pqOutputWindow.h @@ -48,17 +48,21 @@ to the corresponding pqOutputWindow slots. class PQCORE_EXPORT pqOutputWindow : public QDialog { - typedef QDialog Superclass; - + typedef QDialog Superclass; Q_OBJECT public: + enum MessageType + { + ERROR, + WARNING, + DEBUG, + MESSAGE_TYPE_COUNT + }; + pqOutputWindow(QWidget* Parent); ~pqOutputWindow(); - void setShowOutput(bool state) - { this->ShowOutput = state; } - /// static pqOutputWindow* instance(); @@ -75,20 +79,33 @@ public slots: void onDisplayErrorTextInWindow(const QString&); private slots: + /// Standard methods for a QDialog. Both hide the dialog. void accept(); void reject(); + /// Clears all messages from the output window void clear(); + /// Sets the console view if 'on' is true or the table view if 'on' is false. + void setConsoleView(int on); + /// Slots called to filter (on or off) errors, warnings or debug messages. + void errorToggled(bool checked); + void warningToggled(bool checked); + void debugToggled(bool checked); private: pqOutputWindow(const pqOutputWindow&); pqOutputWindow& operator=(const pqOutputWindow&); + void addMessage(int messageType, const QString& text); + void addPythonMessages(int messageType, const QString& text); + + void addMessage(int messageType, const QString& location, + const QString& message); virtual void showEvent(QShowEvent*); virtual void hideEvent(QHideEvent*); - int ShowOutput; + bool Show[MESSAGE_TYPE_COUNT]; struct pqImplementation; - pqImplementation* const Implementation; + const QScopedPointer Implementation; }; #endif // !_pqOutputWindow_h diff --git a/Qt/Core/pqOutputWindowAdapter.cxx b/Qt/Core/pqOutputWindowAdapter.cxx index 184bb88e129..903a6c65d53 100644 --- a/Qt/Core/pqOutputWindowAdapter.cxx +++ b/Qt/Core/pqOutputWindowAdapter.cxx @@ -36,11 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. vtkStandardNewMacro(pqOutputWindowAdapter); -pqOutputWindowAdapter::pqOutputWindowAdapter() : - TextCount(0), - ErrorCount(0), - WarningCount(0), - GenericWarningCount(0) +pqOutputWindowAdapter::pqOutputWindowAdapter() { this->Active=true; } @@ -49,26 +45,6 @@ pqOutputWindowAdapter::~pqOutputWindowAdapter() { } -unsigned int pqOutputWindowAdapter::getTextCount() -{ - return this->TextCount; -} - -unsigned int pqOutputWindowAdapter::getErrorCount() -{ - return this->ErrorCount; -} - -unsigned int pqOutputWindowAdapter::getWarningCount() -{ - return this->WarningCount; -} - -unsigned int pqOutputWindowAdapter::getGenericWarningCount() -{ - return this->GenericWarningCount; -} - void pqOutputWindowAdapter::setActive(bool active) { this->Active=active; @@ -76,7 +52,6 @@ void pqOutputWindowAdapter::setActive(bool active) void pqOutputWindowAdapter::DisplayTextInWindow(const QString& text) { - ++this->TextCount; if (this->Active) { emit displayTextInWindow(text); @@ -85,7 +60,6 @@ void pqOutputWindowAdapter::DisplayTextInWindow(const QString& text) void pqOutputWindowAdapter::DisplayErrorTextInWindow(const QString& text) { - ++this->ErrorCount; if (this->Active) { emit displayErrorTextInWindow(text); @@ -94,7 +68,6 @@ void pqOutputWindowAdapter::DisplayErrorTextInWindow(const QString& text) void pqOutputWindowAdapter::DisplayText(const char* text) { - ++this->TextCount; if(this->Active) { emit displayText(text); @@ -103,7 +76,6 @@ void pqOutputWindowAdapter::DisplayText(const char* text) void pqOutputWindowAdapter::DisplayErrorText(const char* text) { - ++this->ErrorCount; if(this->Active) { emit displayErrorText(text); @@ -112,7 +84,6 @@ void pqOutputWindowAdapter::DisplayErrorText(const char* text) void pqOutputWindowAdapter::DisplayWarningText(const char* text) { - ++this->WarningCount; if(this->Active) { emit displayWarningText(text); @@ -121,7 +92,6 @@ void pqOutputWindowAdapter::DisplayWarningText(const char* text) void pqOutputWindowAdapter::DisplayGenericWarningText(const char* text) { - ++this->GenericWarningCount; if(this->Active) { emit displayGenericWarningText(text); diff --git a/Qt/Core/pqOutputWindowAdapter.h b/Qt/Core/pqOutputWindowAdapter.h index 4482b57b160..db1ab6e73ba 100644 --- a/Qt/Core/pqOutputWindowAdapter.h +++ b/Qt/Core/pqOutputWindowAdapter.h @@ -56,14 +56,6 @@ class PQCORE_EXPORT pqOutputWindowAdapter : static pqOutputWindowAdapter *New(); vtkTypeMacro(pqOutputWindowAdapter, vtkOutputWindow); - /// Returns the number of text messages received - unsigned int getTextCount(); - /// Returns the number of error messages received - unsigned int getErrorCount(); - /// Returns the number of warning messages received - unsigned int getWarningCount(); - /// Returns the number of generic warning messages received - unsigned int getGenericWarningCount(); /// If active signals are emitted on messages. void setActive(bool active); @@ -93,11 +85,6 @@ class PQCORE_EXPORT pqOutputWindowAdapter : pqOutputWindowAdapter& operator=(const pqOutputWindowAdapter&); ~pqOutputWindowAdapter(); - unsigned int TextCount; - unsigned int ErrorCount; - unsigned int WarningCount; - unsigned int GenericWarningCount; - virtual void DisplayText(const char*); virtual void DisplayErrorText(const char*); virtual void DisplayWarningText(const char*); diff --git a/Qt/Core/pqOutputWindowModel.cxx b/Qt/Core/pqOutputWindowModel.cxx new file mode 100644 index 00000000000..220ef7441e9 --- /dev/null +++ b/Qt/Core/pqOutputWindowModel.cxx @@ -0,0 +1,281 @@ +/*========================================================================= + + Program: ParaView + Module: pqOutputWindow.cxx + + Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. + All rights reserved. + + ParaView is a free software; you can redistribute it and/or modify it + under the terms of the ParaView license version 1.2. + + See License_v1.2.txt for the full ParaView license. + A copy of this license can be obtained by contacting + Kitware Inc. + 28 Corporate Drive + Clifton Park, NY 12065 + USA + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=========================================================================*/ + +#include +#include +#include +#include + + +#include "pqOutputWindowModel.h" +#include "pqOutputWindow.h" +#include "pqCheckBoxDelegate.h" + +#include + +namespace +{ +const int EXPANDED_ROW_EXTRA = 1; +// WARNING: The string order has to match the order in pqOutputWindow::MessageType +const QStyle::StandardPixmap MessageTypeIcon[] = +{ + QStyle::SP_MessageBoxCritical, + QStyle::SP_MessageBoxWarning, + QStyle::SP_MessageBoxInformation +}; +enum ColumnLocation +{ + COLUMN_EXPANDED, + COLUMN_TYPE, + COLUMN_COUNT, + COLUMN_MESSAGE, + COUNT +}; +}; + +struct pqOutputWindowModel::pqInternals +{ + QList Icons; +}; + +pqOutputWindowModel::pqOutputWindowModel( + QObject *_parent, const QList& messages) : + QAbstractTableModel(_parent), + Messages(messages), + View(NULL), + Internals(new pqInternals()) +{ + Q_ASSERT (EXPANDED_ROW_EXTRA == 1); +} + +pqOutputWindowModel::~pqOutputWindowModel() +{ +} + +int pqOutputWindowModel::rowCount(const QModelIndex &_parent) const +{ + (void)_parent; + return this->Rows.size(); +} + +int pqOutputWindowModel::columnCount(const QModelIndex &_parent) const +{ + (void)_parent; + return COUNT; +} + +Qt::ItemFlags pqOutputWindowModel::flags(const QModelIndex & _index) const +{ + int r = _index.row(); + Qt::ItemFlags f; + if (! this->Messages[this->Rows[r]].Location.isEmpty() || + _index.column() != COLUMN_EXPANDED) + { + f |= Qt::ItemIsEnabled; + } + return f; +} + +QVariant pqOutputWindowModel::data(const QModelIndex &_index, int role) const +{ + int r = _index.row(); + switch(role) + { + case Qt::DisplayRole: + { + if (r - EXPANDED_ROW_EXTRA >= 0 && + this->Rows[r] == this->Rows[r - EXPANDED_ROW_EXTRA]) + { + // row expansion. + return (_index.column() == COLUMN_MESSAGE) ? + this->Messages[this->Rows[r]].Location : + QVariant(); + } + else + { + // regular row (not an expansion) + switch (_index.column()) + { + case COLUMN_EXPANDED: + return this->Messages[this->Rows[r]].Location.isEmpty() ? + pqCheckBoxDelegate::NOT_EXPANDED_DISABLED : + ((r == this->Rows.size() - 1 || + this->Rows[r] != this->Rows[r + 1]) ? + pqCheckBoxDelegate::NOT_EXPANDED : pqCheckBoxDelegate::EXPANDED); + case COLUMN_COUNT: + return QString::number(this->Messages[this->Rows[r]].Count); + case COLUMN_MESSAGE: + return this->Messages[this->Rows[r]].Message; + } + return QVariant(); + } + break; + } + case Qt::TextAlignmentRole: + { + if (_index.column() == COLUMN_COUNT) + { + return Qt::AlignCenter; + } + break; + } + case Qt::DecorationRole: + { + if ((r - EXPANDED_ROW_EXTRA < 0 || + this->Rows[r] != this->Rows[r - EXPANDED_ROW_EXTRA]) && + (_index.column() == COLUMN_TYPE)) + { + return this->Internals->Icons[this->Messages[this->Rows[r]].Type]; + } + break; + } + } + return QVariant(); +} + +bool pqOutputWindowModel::setData(const QModelIndex & _index, + const QVariant & value, int role) +{ + int r = _index.row(); + if (role == Qt::EditRole) + { + if (r - EXPANDED_ROW_EXTRA < 0 || + this->Rows[r] != this->Rows[r - EXPANDED_ROW_EXTRA]) + { + // regular row (not an expansion) + if (_index.column() == COLUMN_EXPANDED) + { + switch (value.toInt()) + { + case pqCheckBoxDelegate::EXPANDED: + this->expandRow(r); + break; + case pqCheckBoxDelegate::NOT_EXPANDED: + this->contractRow(r); + break; + } + } + } + } + return true; +} + +void pqOutputWindowModel::appendLastRow() +{ + this->beginInsertRows(QModelIndex(), this->Rows.size(), this->Rows.size()); + this->Rows.push_back(this->Messages.size() - 1); + this->endInsertRows(); + if (this->Rows.size() == 1) + { + for (int i = 0; i < 3; ++i) + { + this->View->resizeColumnToContents(i); + } + } + this->View->resizeRowToContents(this->Rows.size() - 1); +} + +void pqOutputWindowModel::expandRow(int r) +{ + this->beginInsertRows(QModelIndex(), r+1, r+1); + this->Rows.insert(r+1, this->Rows[r]); + this->endInsertRows(); + this->View->resizeRowToContents(r+1); +} + +void pqOutputWindowModel::contractRow(int r) +{ + beginRemoveRows(QModelIndex(), r+1, r+1); + this->Rows.removeAt(r+1); + endRemoveRows(); +} + + +void pqOutputWindowModel::clear() +{ + if (this->Rows.size() > 0) + { + beginRemoveRows(QModelIndex(), 0, this->Rows.size() - 1); + this->Rows.clear(); + endRemoveRows(); + } +} + +void pqOutputWindowModel::ShowMessages(bool* show) +{ + this->clear(); + int _rowCount = 0; + for (int i = 0; i < this->Messages.size(); ++i) + { + for (int j = 0; j < pqOutputWindow::MESSAGE_TYPE_COUNT; ++j) + { + if (show[j] && this->Messages[i].Type == j) + { + ++_rowCount; + break; + } + } + } + this->Rows.reserve(_rowCount); + this->beginInsertRows(QModelIndex(), 0, _rowCount - 1); + for (int i = 0; i < this->Messages.size(); ++i) + { + for (int j = 0; j < pqOutputWindow::MESSAGE_TYPE_COUNT; ++j) + { + if (show[j] && this->Messages[i].Type == j) + { + this->Rows.push_back(i); + break; + } + } + } + this->endInsertRows(); + this->View->resizeRowsToContents(); +} + +void pqOutputWindowModel::setView(QTableView* view) +{ + Q_ASSERT(this->View == NULL); + this->View = view; + QStyle* style = this->View->style(); + // WARNING: the order has to match pqOutputWindow::MessageType + // error + this->Internals->Icons.push_back( + style->standardIcon(QStyle::SP_MessageBoxCritical)); + // warning; warning looks similar with error (also red), so we use a different + // icon + this->Internals->Icons.push_back( + QIcon(":/pqWidgets/Icons/warning.png")); + // debug + this->Internals->Icons.push_back( + style->standardIcon(QStyle::SP_MessageBoxInformation)); +} diff --git a/Qt/Core/pqOutputWindowModel.h b/Qt/Core/pqOutputWindowModel.h new file mode 100644 index 00000000000..fdea9d05f36 --- /dev/null +++ b/Qt/Core/pqOutputWindowModel.h @@ -0,0 +1,91 @@ +/*========================================================================= + + Program: ParaView + Module: pqOutputWindow.h + + Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. + All rights reserved. + + ParaView is a free software; you can redistribute it and/or modify it + under the terms of the ParaView license version 1.2. + + See License_v1.2.txt for the full ParaView license. + A copy of this license can be obtained by contacting + Kitware Inc. + 28 Corporate Drive + Clifton Park, NY 12065 + USA + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=========================================================================*/ + +#ifndef _pqOutputWindowModel_h +#define _pqOutputWindowModel_h + +#include "pqCoreModule.h" +#include + +class QTableView; + +struct MessageT +{ + MessageT(int type, int count, const QString& location, + const QString& message) : + Type(type), Count(count), Location(location), Message(message) + { + } + int Type; // pqOutputWindow::MessageType + int Count; + QString Location; + QString Message; +}; + +/// This is a model for the pqOutputWindow table that shows collated and +/// abbreviated messages. +class PQCORE_EXPORT pqOutputWindowModel : public QAbstractTableModel +{ + Q_OBJECT +public: + pqOutputWindowModel(QObject *parent, const QList& messages); + ~pqOutputWindowModel(); + int rowCount(const QModelIndex &parent = QModelIndex()) const ; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + virtual Qt::ItemFlags flags(const QModelIndex & index) const; + virtual bool setData(const QModelIndex & index, const QVariant & value, + int role = Qt::EditRole); + + void setView(QTableView* view); + + /// Appends the last message to the table + void appendLastRow(); + /// clears the table + void clear(); + /// Shows in the table only messages that match the 'show' array. + /// 'show' tells us if a pqOutputArray::MessageType element should be shown + /// or not + void ShowMessages(bool* show); + void expandRow(int r); + void contractRow(int r); + +private: + const QList& Messages; + QList Rows; // element is index in Messages, + // when an element is expanded, the index is duplicated + QTableView* View; + struct pqInternals; + QScopedPointer Internals; +}; + +#endif // !_pqOutputWindowModel_h diff --git a/Qt/Core/pqProgressManager.cxx b/Qt/Core/pqProgressManager.cxx index 9625259921a..0af069785a9 100644 --- a/Qt/Core/pqProgressManager.cxx +++ b/Qt/Core/pqProgressManager.cxx @@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "pqApplicationCore.h" #include "pqCoreUtilities.h" +#include "pqOutputWindow.h" #include "pqServer.h" #include "pqServerManagerModel.h" #include "vtkCommand.h" @@ -269,8 +270,27 @@ void pqProgressManager::onProgress(vtkObject* caller) //----------------------------------------------------------------------------- void pqProgressManager::onMessage(vtkObject* caller) { - vtkPVProgressHandler* handler = vtkPVProgressHandler::SafeDownCast(caller); QString text = handler->GetLastMessage(); - vtkOutputWindow::GetInstance()->DisplayText(text.toStdString().c_str()); + if (text.startsWith("ERROR: ")) + { + vtkOutputWindow::GetInstance()->DisplayErrorText(text.toStdString().c_str()); + } + else if (text.startsWith("Warning: ")) + { + vtkOutputWindow::GetInstance()->DisplayWarningText(text.toStdString().c_str()); + } + else if (text.startsWith("Generic Warning: ")) + { + vtkOutputWindow::GetInstance()->DisplayGenericWarningText( + text.toStdString().c_str()); + } + else if (text.startsWith("Debug : ")) + { + vtkOutputWindow::GetInstance()->DisplayText(text.toStdString().c_str()); + } + else + { + vtkOutputWindow::GetInstance()->DisplayText(text.toStdString().c_str()); + } } diff --git a/Qt/Core/pqXYBagChartView.h b/Qt/Core/pqXYBagChartView.h index 79de6e2311a..1481349b419 100644 --- a/Qt/Core/pqXYBagChartView.h +++ b/Qt/Core/pqXYBagChartView.h @@ -46,7 +46,7 @@ class PQCORE_EXPORT pqXYBagChartView : public pqContextView public: static QString XYBagChartViewType() { return "XYBagChartView"; } /// Currently theis chart view is not supporting selection. - virtual bool supportsSelection() const { return false; } + virtual bool supportsSelection() const { return true; } public: pqXYBagChartView(const QString& group, diff --git a/Qt/Core/pqXYFunctionalBagChartView.h b/Qt/Core/pqXYFunctionalBagChartView.h index b47d238d0fe..12d1ac34ce7 100644 --- a/Qt/Core/pqXYFunctionalBagChartView.h +++ b/Qt/Core/pqXYFunctionalBagChartView.h @@ -45,8 +45,8 @@ class PQCORE_EXPORT pqXYFunctionalBagChartView : public pqContextView public: static QString XYFunctionalBagChartViewType() { return "XYFunctionalBagChartView"; } - /// Currently this chart view is not supporting selection. - virtual bool supportsSelection() const { return false; } + + virtual bool supportsSelection() const { return true; } public: pqXYFunctionalBagChartView(const QString& group, diff --git a/Testing/Data/Baseline/FunctionalBagPlots.png.md5 b/Testing/Data/Baseline/FunctionalBagPlots.png.md5 new file mode 100644 index 00000000000..9ac16a19242 --- /dev/null +++ b/Testing/Data/Baseline/FunctionalBagPlots.png.md5 @@ -0,0 +1 @@ +e3b550fa617f04e40cb38ca20e37ef2d diff --git a/Testing/Data/Baseline/FunctionalBagPlots_1.png.md5 b/Testing/Data/Baseline/FunctionalBagPlots_1.png.md5 new file mode 100644 index 00000000000..cd57cad4b39 --- /dev/null +++ b/Testing/Data/Baseline/FunctionalBagPlots_1.png.md5 @@ -0,0 +1 @@ +ee7efb5ca0693d9309c0052b4385b695 diff --git a/Testing/Data/Baseline/LineChartSelection1.png.md5 b/Testing/Data/Baseline/LineChartSelection1.png.md5 index 0652d770f1d..3f82c8cb608 100644 --- a/Testing/Data/Baseline/LineChartSelection1.png.md5 +++ b/Testing/Data/Baseline/LineChartSelection1.png.md5 @@ -1 +1 @@ -a373dd787ae057aeebefc557ce9b5b9d +2bcb04151d0b41f26320c65224acb64b diff --git a/Testing/Data/Baseline/LineChartSelection2.png.md5 b/Testing/Data/Baseline/LineChartSelection2.png.md5 index 30fb64d1001..cdb94c70ea1 100644 --- a/Testing/Data/Baseline/LineChartSelection2.png.md5 +++ b/Testing/Data/Baseline/LineChartSelection2.png.md5 @@ -1 +1 @@ -4d0ee333986c32aa924ccd4455dbf38c +71c044930b4349c2cb16fadb3eee691b diff --git a/Testing/Data/Baseline/LineChartSelection3.png.md5 b/Testing/Data/Baseline/LineChartSelection3.png.md5 index dcae1db0dd1..d06fe4603b5 100644 --- a/Testing/Data/Baseline/LineChartSelection3.png.md5 +++ b/Testing/Data/Baseline/LineChartSelection3.png.md5 @@ -1 +1 @@ -784332c7a9ac00db0f09a9ddd1699ac7 +3428936e8938c29be750a86695f0e8d7 diff --git a/Testing/Data/Baseline/LineChartSelection4.png.md5 b/Testing/Data/Baseline/LineChartSelection4.png.md5 index 2e7d70cf006..cf0e310fd6b 100644 --- a/Testing/Data/Baseline/LineChartSelection4.png.md5 +++ b/Testing/Data/Baseline/LineChartSelection4.png.md5 @@ -1 +1 @@ -e43704add25f18c4f176c24928ac77a9 +cede4da73a890873cb3a619e194b2574 diff --git a/Testing/Data/sineWaves.csv.md5 b/Testing/Data/sineWaves.csv.md5 new file mode 100644 index 00000000000..409055a04c8 --- /dev/null +++ b/Testing/Data/sineWaves.csv.md5 @@ -0,0 +1 @@ +13cae8b045a921b934eefc8dc40b8611 diff --git a/Utilities/TestDriver/vtkSMTestDriver.cxx b/Utilities/TestDriver/vtkSMTestDriver.cxx index 4194cca8779..076bc21afa0 100644 --- a/Utilities/TestDriver/vtkSMTestDriver.cxx +++ b/Utilities/TestDriver/vtkSMTestDriver.cxx @@ -390,7 +390,7 @@ vtkSMTestDriver::CreateCommandLine(std::vector& commandLine, } } - if(this->PVSSHFlags.size() && (type == SERVER || type == DATA_SERVER)) + if(!this->PVSSHFlags.empty() && (type == SERVER || type == DATA_SERVER)) { { // First add the ssh command: diff --git a/VTK b/VTK index 539e5c947a3..e5339d97a0d 160000 --- a/VTK +++ b/VTK @@ -1 +1 @@ -Subproject commit 539e5c947a3b3e570ef4357a12edb153826b2fa7 +Subproject commit e5339d97a0df6a831b6929a3eeec2a2c77ed0345 diff --git a/Web/Applications/TestApp/www/pvwebTestFunctions.js b/Web/Applications/TestApp/www/pvwebTestFunctions.js index 6079b8e2d0f..dc709d5d2d6 100644 --- a/Web/Applications/TestApp/www/pvwebTestFunctions.js +++ b/Web/Applications/TestApp/www/pvwebTestFunctions.js @@ -1165,7 +1165,7 @@ function ParaViewWebTestFunctions(connection) { protocolProxyAvailableTests: function(testName, resultCallback) { var s = connection.session, expectedFilters = ["Slice", "Warp By Scalar", "Clip", "Cell Data To Point Data", "Calculator", "Transform", "Extract CTH Parts", "Reflect", "Stream Tracer", "Threshold", "Contour"], - expectedSources = ["Box", "Cylinder", "Sphere", "Plane", "Cone", "Annotate Time", "Wavelet"]; + expectedSources = ["Annotate Time", "Cone", "Sphere", "Text", "Wavelet"]; function findMissingElements(expected, actual) { var missing = []; diff --git a/Web/Applications/Visualizer/server/pv_web_visualizer.py b/Web/Applications/Visualizer/server/pv_web_visualizer.py index 7810288a7c6..27cf4a56c64 100644 --- a/Web/Applications/Visualizer/server/pv_web_visualizer.py +++ b/Web/Applications/Visualizer/server/pv_web_visualizer.py @@ -56,6 +56,10 @@ This option is useful when running in mpi mode and you want pvservers to connect to this pvpython application. + --save-data-dir + Server directory under which all data will be saved. Data, state, and + screenshots can be saved to relative paths under this directory. + Any ParaViewWeb executable script comes with a set of standard arguments that can be overriden if need be:: --port 8080 @@ -115,6 +119,7 @@ class _VisualizerServer(pv_wamp.PVServerProtocol): colorPalette = None proxies = None allReaders = True + saveDataDir = os.getcwd() @staticmethod def add_arguments(parser): @@ -131,25 +136,32 @@ def add_arguments(parser): parser.add_argument("--plugins", default="", help="List of fully qualified path names to plugin objects to load", dest="plugins") parser.add_argument("--proxies", default=None, help="Path to a file with json text containing filters to load", dest="proxies") parser.add_argument("--no-auto-readers", help="If provided, disables ability to use non-configured readers", action="store_true", dest="no_auto_readers") + parser.add_argument("--save-data-dir", default='', help="Server directory under which all data will be saved", dest="saveDataDir") @staticmethod def configure(args): - _VisualizerServer.authKey = args.authKey - _VisualizerServer.dataDir = args.path - _VisualizerServer.dsHost = args.dsHost - _VisualizerServer.dsPort = args.dsPort - _VisualizerServer.rsHost = args.rsHost - _VisualizerServer.rsPort = args.rsPort - _VisualizerServer.rcPort = args.reverseConnectPort - _VisualizerServer.excludeRegex = args.exclude - _VisualizerServer.groupRegex = args.group - _VisualizerServer.plugins = args.plugins - _VisualizerServer.proxies = args.proxies - _VisualizerServer.colorPalette = args.palettes - _VisualizerServer.allReaders = not args.no_auto_readers + _VisualizerServer.authKey = args.authKey + _VisualizerServer.dataDir = args.path + _VisualizerServer.dsHost = args.dsHost + _VisualizerServer.dsPort = args.dsPort + _VisualizerServer.rsHost = args.rsHost + _VisualizerServer.rsPort = args.rsPort + _VisualizerServer.rcPort = args.reverseConnectPort + _VisualizerServer.excludeRegex = args.exclude + _VisualizerServer.groupRegex = args.group + _VisualizerServer.plugins = args.plugins + _VisualizerServer.proxies = args.proxies + _VisualizerServer.colorPalette = args.palettes + _VisualizerServer.allReaders = not args.no_auto_readers + + # If no save directory is provided, default it to the data directory + if args.saveDataDir == '': + _VisualizerServer.saveDataDir = _VisualizerServer.dataDir + else: + _VisualizerServer.saveDataDir = args.saveDataDir if args.file: - _VisualizerServer.fileToLoad = args.path + '/' + args.file + _VisualizerServer.fileToLoad = args.path + '/' + args.file def initialize(self): # Bring used components @@ -167,6 +179,7 @@ def initialize(self): self.registerVtkWebProtocol(pv_protocols.ParaViewWebSelectionHandler()) self.registerVtkWebProtocol(pv_protocols.ParaViewWebWidgetManager()) self.registerVtkWebProtocol(pv_protocols.ParaViewWebKeyValuePairStore()) + self.registerVtkWebProtocol(pv_protocols.ParaViewWebSaveData(baseSavePath=_VisualizerServer.saveDataDir)) # Update authentication key to use self.updateSecret(_VisualizerServer.authKey) diff --git a/Web/Applications/Visualizer/www/index.html b/Web/Applications/Visualizer/www/index.html index b054fc303d8..9ce5f6ca6bc 100644 --- a/Web/Applications/Visualizer/www/index.html +++ b/Web/Applications/Visualizer/www/index.html @@ -29,10 +29,7 @@ class='vtk-icon-doc-text clickable padding inspector-selector' data-type='files' data-toggle='tooltip' data-placement='bottom' title='Show File List'> - - + class='vtk-icon-plus clickable padding inspector-selector' data-type='sources' data-toggle='tooltip' data-placement='bottom' title='Show Sources/Filters'> @@ -40,6 +37,9 @@ + + @@ -75,9 +75,7 @@
-
-
-
+
@@ -87,7 +85,10 @@
- +
+
+ +
+ +
+
+

+
@@ -119,6 +180,7 @@ sessionManagerURL: vtkWeb.properties.sessionManagerURL, application: "visualizer" }, + reallyStop = true, stop = vtkWeb.NoOp, start = function(connection) { $('.app-wait-start-page').remove(); @@ -126,19 +188,19 @@ pv.initializeVisualizer( connection.session, - '.pv-viewport', '.pv-pipeline', '.pv-proxy-editor', '.pv-files', '.pv-source-list', '.pv-filter-list', '.pv-data-info', '.pv-global-settings-editor'); + '.pv-viewport', '.pv-pipeline', '.pv-proxy-editor', '.pv-files', '.pv-source-list', + '.pv-filter-list', '.pv-data-info', '.pv-global-settings-editor', '.pv-savedata-options'); $('[data-toggle="tooltip"]').tooltip({container: 'body'}); // Update stop method to use the connection stop = function() { - connection.session.call('application.exit'); + if (reallyStop === true) { + connection.session.call('application.exit'); + } } }; - // Pass any url parameters to the launcher - vtkWeb.udpateConnectionFromURL(config); - // Try to launch the Viz process vtkWeb.smartConnect(config, start, function(code,reason){ console.log(reason); diff --git a/Web/Applications/Visualizer/www/main.css b/Web/Applications/Visualizer/www/main.css index 75137cf6619..17114ec908f 100644 --- a/Web/Applications/Visualizer/www/main.css +++ b/Web/Applications/Visualizer/www/main.css @@ -4,6 +4,19 @@ .fix-height { position: relative; top: 0; left: 0; } .pv-time-input { position: relative; top: 2px; width: 80px; border: solid 1px white; background: none; padding: 2px 10px; } +/* ---- Sources/Filters Icons ---- */ + +.pv-source-list ul, .pv-filter-list ul { + margin-bottom: 0; +} +.pvActionList li:before { + font-family: "fontello"; + width: 16px; + display: inline-block; +} +.pv-source-list li:before { content: '\e94e'; } +.pv-filter-list li:before { content: '\e81c'; } + /* ---- Font - colors - Cursor ----- */ .clickable { cursor: pointer; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } @@ -58,6 +71,10 @@ select.pv-form-height { font-size: 12px; } .dl-horizontal dd { margin-left: 80px; } .dl-horizontal dt { width: 60px; } +/* ---- Save Data Panel ---- */ +.inspector-container .active-panel-btn { border-radius: 15px; } +.label-spacing { margin-top: 15px; margin-bottom: 5px;} + /* ---- Information Tab ---- */ .pv-data-info dl { margin-bottom: 0; } diff --git a/Web/Applications/Visualizer/www/main.js b/Web/Applications/Visualizer/www/main.js index 9eac52d97dd..a67d7799c96 100644 --- a/Web/Applications/Visualizer/www/main.js +++ b/Web/Applications/Visualizer/www/main.js @@ -5,12 +5,16 @@ proxyEditor, settingsEditor, rvSettingsProxyId = null, + saveOptionsEditor, + defaultSaveFilenames = { 'data': 'server-data/savedData.vtk', 'state': 'server-state/savedState.pvsm', 'screen': 'server-images/savedScreen.png' }, + currentSaveType = 'state', infoManager, busyElement = $('.busy').hide(), notBusyElement = $('.not-busy').show(), busyCount = 0, paletteNameList = [], pipelineDataModel = { metadata: null, source: null, representation: null, view: null, sources: []}, + activeProxyId = 0, module = {}, vcrPlayStatus = false, pipelineLoadedCallBack = null, @@ -26,6 +30,8 @@ activeProxy(arg.id); } pipeline.trigger('pipeline-reload'); + viewport.resetViewId(); + viewport.invalidateScene(); workDone(); } @@ -205,6 +211,12 @@ viewport.invalidateScene(); } else if(propName === 'Stats') { viewport.showStatistics(value === 1); + } else if(propName === 'CloseBehavior') { + if(value === 1) { + reallyStop = true; + } else { + reallyStop = false; + } } }); } @@ -333,7 +345,8 @@ // ======================================================================== function createViewportView(viewportSelector) { - $(viewportSelector).empty(); + $(viewportSelector).empty() + .bind('captured-screenshot-ready', onScreenshotCaptured); viewport = vtkWeb.createViewport({session: session}); viewport.bind(viewportSelector); } @@ -377,6 +390,7 @@ function onPipelineDataChange(event) { // { active: active_proxy_id, view: view_id, sources: proxy_list } + activeProxyId = event.active; // Update data model pipelineDataModel.sources = event.sources; @@ -605,25 +619,30 @@ function onNewProxyLoaded() { if(pipelineDataModel.metadata && pipelineDataModel.source && pipelineDataModel.representation && pipelineDataModel.view) { - var props = [].concat( - "+Color Management", - extractRepresentation(pipelineDataModel.representation.properties), - "ColorByPanel", - "_Color Management", + var colorBy = pipelineDataModel.representation.colorBy, + props = [].concat( "+Source", pipelineDataModel.source.properties, '_Source', "-Representation", pipelineDataModel.representation.properties, '_Representation', "-View", pipelineDataModel.view.properties, "_View" ), ui = [].concat( - "+Color Management", - extractRepresentation(pipelineDataModel.representation.ui), - "ColorByPanel", - "_Color Management", "+Source", pipelineDataModel.source.ui, '_Source', "-Representation", pipelineDataModel.representation.ui, '_Representation', "-View", pipelineDataModel.view.ui, "_View" ); + if (!$.isEmptyObject(colorBy) && colorBy.hasOwnProperty('array')) { + props = [].concat("+Color Management", + extractRepresentation(pipelineDataModel.representation.properties), + "ColorByPanel", + "_Color Management", + props); + ui = [].concat("+Color Management", + extractRepresentation(pipelineDataModel.representation.ui), + "ColorByPanel", + "_Color Management", + ui); + } try { proxyEditor.proxyEditor(pipelineDataModel.metadata.name, @@ -633,7 +652,7 @@ ui, pipelineDataModel.source.data.arrays, paletteNameList, - pipelineDataModel.representation.colorBy); + colorBy); $('.inspector-container').scrollTop(0); } catch(err) { console.log(err); @@ -707,6 +726,78 @@ } } + // ======================================================================== + // Panel for saving data, state, and screenshots + // ======================================================================== + + function createSaveOptionsPanel(saveSelector) { + saveOptionsEditor = $(saveSelector); + + $('.active-panel-btn').click(setActiveSaveProperties); + $('.save-data-button').click(saveDataClicked); + $('.screenshot-reset-size-btn').click(updateSaveScreenshotDimensions); + $('.screenshot-grab-image-btn').click(viewport.captureScreenImage); + + $('.screenshot-pixel-width').val(500); + $('.screenshot-pixel-height').val(500); + + // To begin with, we select the "Save State" panel + $('.active-panel-btn[data-action=screen]').trigger('click'); + } + + function onScreenshotCaptured(event) { + var imgElt = $('.captured-screenshot-image'); + imgElt.attr('src', event.imageData); + imgElt.removeClass('hidden'); + } + + function updateSaveScreenshotDimensions() { + var viewportElt = $('.pv-viewport'); + $('.screenshot-pixel-width').val(viewportElt.width()); + $('.screenshot-pixel-height').val(viewportElt.height()); + } + + function saveDataClicked(event) { + var filename = $('.save-data-filename').val(), + saveOptions = {}; + + if (currentSaveType === 'state') { + // No special options yet + } else if (currentSaveType === 'data') { + if (activeProxyId !== '0') { + saveOptions['proxyId'] = activeProxyId; + } + } else if (currentSaveType === 'screen') { + console.log("Going to save screenshot (" + filename + ")"); + saveOptions.size = [ $('.screenshot-pixel-width').val(), $('.screenshot-pixel-height').val() ]; + } + + defaultSaveFilenames[currentSaveType] = filename; + + startWorking() + session.call('pv.data.save', [filename, saveOptions]).then(function(saveResult) { + workDone(); + }, workDone); + } + + function setActiveSaveProperties(event) { + var target_container = $(event.target) + action = target_container.attr('data-action'); + + //$('.active-panel-btn').toggleClass('active'); + $('.active-panel-btn').removeClass('active'); + target_container.addClass('active'); + + if (action === 'screen') { + $('.screenshot-save-only').show(); + } else { + $('.screenshot-save-only').hide(); + } + + $('.save-data-filename').val(defaultSaveFilenames[action]); + currentSaveType = action; + } + // ======================================================================== // File management (browse + open) // ======================================================================== @@ -760,14 +851,14 @@ // Main - Visualizer Setup // ======================================================================== - function initializeVisualizer(session_, viewportSelector, pipelineSelector, proxyEditorSelector, fileSelector, sourceSelector, filterSelector, dataInfoSelector, settingsSelector) { + function initializeVisualizer(session_, viewportSelector, pipelineSelector, proxyEditorSelector, fileSelector, + sourceSelector, filterSelector, dataInfoSelector, settingsSelector, saveOptsSelector) { session = session_; // Initialize data and DOM behavior updatePaletteNames(); addScrollBehavior(); addDefaultButtonsBehavior(); - addFixHeightBehavior(); addTimeAnimationButtonsBehavior(); addPreferencePanelBehavior(); @@ -780,11 +871,15 @@ createProxyEditorView(proxyEditorSelector); createDataInformationPanel(dataInfoSelector); createGlobalSettingsPanel(settingsSelector); + createSaveOptionsPanel(saveOptsSelector); // Set initial state $('.need-input-source').hide(); proxyEditor.empty(); activePipelineInspector(); + + // Make sure everything is properly sized + addFixHeightBehavior(); }; // ---------------------------------------------------------------------- diff --git a/Web/Python/defaultProxies.json b/Web/Python/defaultProxies.json index c5536d931ff..3835e836a57 100644 --- a/Web/Python/defaultProxies.json +++ b/Web/Python/defaultProxies.json @@ -1,11 +1,9 @@ { "sources": [ { "name": "AnnotateTime", "label": "Annotate Time" }, - { "name": "Box" }, { "name": "Cone" }, - { "name": "Cylinder" }, - { "name": "Plane" }, { "name": "Sphere" }, + { "name": "Text" }, { "name": "Wavelet" } ], @@ -14,7 +12,9 @@ { "name": "CellDatatoPointData", "label": "Cell Data To Point Data" }, { "name": "Clip" }, { "name": "Contour" }, + { "name": "D3" }, { "name": "ExtractCTHParts", "label": "Extract CTH Parts" }, + { "name": "ProcessIdScalars", "label": "Process ID Scalars" }, { "name": "Reflect" }, { "name": "Slice" }, { "name": "StreamTracer", "label": "Stream Tracer" }, @@ -23,6 +23,7 @@ { "name": "Tube" }, { "name": "Ribbon" }, { "name": "WarpByScalar", "label": "Warp By Scalar" }, + { "name": "WarpByVector", "label": "Warp By Vector" }, { "name": "ExtractBlock", "label": "Extract Blocks" } ], diff --git a/Web/Python/paraview/web/protocols.py b/Web/Python/paraview/web/protocols.py index 5ed85f2dc1c..553ce5f8862 100644 --- a/Web/Python/paraview/web/protocols.py +++ b/Web/Python/paraview/web/protocols.py @@ -1289,6 +1289,15 @@ def open(self, relativePath): # Get file extension and look for configured reader idx = fileToLoad[0].rfind('.') extension = fileToLoad[0][idx+1:] + + # Check if we were asked to load a state file + if extension == 'pvsm': + simple.LoadState(fileToLoad[0]) + simple.Render() + simple.ResetCamera() + + return { 'success': True } + readerName = None if extension in self.readerFactoryMap: readerName = self.readerFactoryMap[extension][0] @@ -1317,7 +1326,7 @@ def open(self, relativePath): simple.Render() simple.ResetCamera() - return { "id": reader.GetGlobalIDAsString() } + return { 'success': True, 'id': reader.GetGlobalIDAsString() } @exportRpc("pv.proxy.manager.get") def get(self, proxyId): @@ -1719,6 +1728,88 @@ def retrieveKeyPair(self, key): return None +# ============================================================================= +# +# Save Data Protocol +# +# ============================================================================= + +class ParaViewWebSaveData(ParaViewWebProtocol): + + def __init__(self, baseSavePath=''): + super(ParaViewWebSaveData, self).__init__() + self.baseSavePath = baseSavePath + + self.imageExtensions = [ 'jpg', 'png' ] + self.dataExtensions = [ 'vtk', 'ex2' ] + self.stateExtensions = [ 'pvsm' ] + + # RpcName: saveData => 'pv.data.save' + @exportRpc("pv.data.save") + def saveData(self, filePath, options=None): + """ + Save some data on the server side. Can save data from a proxy, a + screenshot, or else the current state. Options may be different + depending on the type of data to be save. Saving a screenshot + can take an optional size array indicating the desired width and + height of the saved image. Saving data can take an optional proxy + id specifying which filter or source to save output from. + + options = { + 'proxyId': '426', + 'size': [ , ] + } + + """ + + # make sure file path exists + fullPath = os.path.join(self.baseSavePath, filePath) + if not os.path.exists(os.path.dirname(fullPath)): + os.makedirs(os.path.dirname(fullPath)) + + # Get file extension and look for configured reader + idx = filePath.rfind('.') + extension = filePath[idx+1:] + + # Now find out what kind of save it is, and do it + if extension in self.imageExtensions: + if options and 'size' in options: + # Get the active view + v = self.getView(-1) + + # Keep track of current size + cw = v.ViewSize[0] + ch = v.ViewSize[1] + + # Resize to desired screenshot size + v.ViewSize = [ int(str(options['size'][0])), int(str(options['size'][1])) ] + simple.Render() + + # Save actual screenshot + simple.SaveScreenshot(fullPath) + + # Put the size back the way we found it + v.ViewSize = [cw, ch] + simple.Render() + else: + simple.SaveScreenshot(fullPath) + elif extension in self.dataExtensions: + proxy = None + if options and 'proxyId' in options: + proxyId = str(options['proxyId']) + proxy = self.mapIdToProxy(proxyId) + simple.SaveData(fullPath, proxy) + elif extension in self.stateExtensions: + # simple.SaveState(fullPath) # FIXME: Fixed after 4.3.1 + servermanager.SaveState(fullPath) + else: + msg = 'ERROR: Could not recognize type of data to save from filename: %s' % filePath + print msg + return { 'success': False, 'message': msg } + + return { 'success': True } + + # ============================================================================= # # Filter list diff --git a/Web/Python/paraview/web/webgl.py b/Web/Python/paraview/web/webgl.py index 0d76ca3e524..8b654e043ef 100644 --- a/Web/Python/paraview/web/webgl.py +++ b/Web/Python/paraview/web/webgl.py @@ -1,8 +1,7 @@ r""" - This module provide classes to handle Rest API for WebGL piece request. + This module provides classes to handle Rest API for WebGL piece request. - This module need more work to be truly available. - Right now it is left here for further work but you should not expect to work as is. + This module is now deprecated. """ from twisted.web import server, resource @@ -11,6 +10,7 @@ from paraview import simple from paraview.web import helper +from vtkParaViewWebCorePython import vtkPVWebApplication import exceptions import base64 diff --git a/Web/Widgets/Pipeline/paraview.ui.proxy.editor.js b/Web/Widgets/Pipeline/paraview.ui.proxy.editor.js index 5f57fdeac56..c65a533bc25 100644 --- a/Web/Widgets/Pipeline/paraview.ui.proxy.editor.js +++ b/Web/Widgets/Pipeline/paraview.ui.proxy.editor.js @@ -16,8 +16,8 @@ TEMPLATE_END_GROUP = "
", TEMPLATE_COLOR_BY_PANEL = "
" + "" + + "Color" + + "" + "" + "
" + "
" + @@ -348,7 +348,7 @@ activeArrayStr = (colorByInfo.mode === 'array') ? colorByInfo.array.slice(0,2).join(':') : 'solid', activeArrayComp = (colorByInfo.mode === 'array') ? colorByInfo.array[2].toString() : '0', activePalette = 'FIXME not yet available', - wantColorManagement = !$.isEmptyObject(colorByInfo), + wantColorManagement = !$.isEmptyObject(colorByInfo) && colorByInfo.hasOwnProperty('array'), colorToolsDisabled = false, scalarOpacityEditorInitialized = false; @@ -553,8 +553,6 @@ proxyId: proxyId }); } - } else { - $('[data-action=toggle-scalarbar]', me).hide(); } // Annotate properties with dependencies with 'has-dependency' class diff --git a/Wrapping/Python/paraview/simple.py b/Wrapping/Python/paraview/simple.py index 50f269884eb..c5283101341 100644 --- a/Wrapping/Python/paraview/simple.py +++ b/Wrapping/Python/paraview/simple.py @@ -324,7 +324,7 @@ def LoadState(filename, connection=None): # ----------------------------------------------------------------------------- def SaveState(filename): - servermanager.SaveXMLState(filename) + servermanager.SaveState(filename) #============================================================================== # Representation methods