Commit 2a926af3 authored by Mathieu Westphal's avatar Mathieu Westphal

Adding OpenTURNS feature

This commits adds multiple OpenTURNS related
features, including
 * A new PARAVIEW_USE_OPENTURNS cmake option to turn on to use these features
 * A dedicated xml for some OpenTURNS filters
 * An extension to the PlotMatrixView for DensityMap capabilities
 * vtkPVHistogramView changes to support the display of OpenTurns filter output in it
 * vtkPVPlotMatrixRepresentation changes to support OpenTURNS features
 * Correction to vtkPVHistogramRepresentation to handle CenterBinAndAroundMax
 * Changes in PlotMatrixRepresentation default values to improve its look and feel
 * Modifications in Chart Management to display automatically line chart in the correct corner
 * Adding a ShowOneRepresentationAtATime xml hint
 * Adding related tests
parent 93845adb
......@@ -202,6 +202,8 @@
<Proxy group="filters" name="MeshQuality" />
<Proxy group="filters" name="OctreeDepthLimit" />
<Proxy group="filters" name="OctreeDepthScalars" />
<Proxy group="filters" name="OTKernelSmoothing" />
<Proxy group="filters" name="OTDensityMap" />
<Proxy group="filters" name="OutlineCornerFilter" />
<Proxy group="filters" name="OutlineFilter" />
<Proxy group="filters" name="ParticlePathLines" />
......
......@@ -172,6 +172,13 @@ if(PARAVIEW_USE_OSPRAY)
${CMAKE_CURRENT_SOURCE_DIR}/OSPRay.xml)
endif()
if(PARAVIEW_USE_OPENTURNS)
list(APPEND TESTS_WITH_BASELINES
${CMAKE_CURRENT_SOURCE_DIR}/HistogramKernelSmoothing.xml)
list(APPEND TESTS_WITH_BASELINES
${CMAKE_CURRENT_SOURCE_DIR}/PlotMatrixViewDensityMaps.xml)
endif()
# hits OSX bug with FileDialog so exclude test on APPLE
if (NOT APPLE)
list (APPEND TESTS_WITH_INLINE_COMPARES
......
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menu_File" />
<pqevent object="pqClientMainWindow/menubar/menu_File" command="activate" arguments="actionFileOpen" />
<pqevent object="pqClientMainWindow/FileOpenDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/vehicle_data.csv" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuFilters" />
<pqevent object="pqClientMainWindow/menubar/menuFilters/Alphabetical" command="activate" arguments="ExtractHistogram" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/CenterBinsAroundMinAndMax/CheckBox" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,90,2,/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,90,2,/0:0/0:0" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuFilters" />
<pqevent object="pqClientMainWindow/menubar/menuFilters/Alphabetical" command="activate" arguments="OTKernelSmoothing" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar/close" command="mousePress" arguments="1,1,0,3,4" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar/close" command="mouseRelease" arguments="1,0,0,3,4" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/CentralWidgetFrame/EmptyView/scrollArea/qt_scrollarea_viewport/widgetFoo/ConvertActionsFrame/XYBarChartView" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,10,9,/0:0/0:0/0:1" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,10,9,/0:0/0:0/0:1" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,11,13,/0:0/0:0/1:1" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,11,13,/0:0/0:0/1:1" />
</pqevents>
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar/menu_File" command="activate" arguments="actionFileOpen" />
<pqevent object="pqClientMainWindow/FileOpenDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/vehicle_data.csv" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar/close" command="mousePress" arguments="1,1,0,6,3" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar/close" command="mouseRelease" arguments="1,0,0,6,3" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_tabbar" command="set_tab_with_text" arguments="Layout #1" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/CentralWidgetFrame/EmptyView/scrollArea/qt_scrollarea_viewport/widgetFoo/ConvertActionsFrame/PlotMatrixView" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,12,9,/0:0/0:1" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,12,9,/0:0/0:1" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="keyEvent" arguments="6,16777250,268435456,,0,1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mousePress" arguments="1,1,0,7,46" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseMove" arguments="1,0,0,-9,166" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseRelease" arguments="1,0,0,-9,166" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ShowScatterPlotDensityMap/CheckBox" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityLineSize/DoubleRangeWidget/Slider" command="set_int" arguments="16" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityLineSize/DoubleRangeWidget/LineEdit" command="set_string" arguments="2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityLineSize/DoubleRangeWidget/LineEdit" command="key" arguments="16777221" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ShowActivePlotDensityMap/CheckBox" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityLineSize/DoubleRangeWidget/LineEdit" command="set_string" arguments="3" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapFirstDecileColor/ColorButton" command="activate" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapFirstDecileColor/ColorButton/1QColorDialog0" command="setChosenColor" arguments="191,40,35" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapFirstDecileColor/ColorButton/1QColorDialog0" command="done" arguments="1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapMedianColor/ColorButton" command="activate" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapMedianColor/ColorButton/1QColorDialog0" command="setChosenColor" arguments="18,191,6" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapMedianColor/ColorButton/1QColorDialog0" command="done" arguments="1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapLastDecileColor/ColorButton" command="activate" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapLastDecileColor/ColorButton/1QColorDialog0" command="setChosenColor" arguments="183,90,191" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ActivePlotDensityMapLastDecileColor/ColorButton/1QColorDialog0" command="done" arguments="1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapFirstDecileColor/ColorButton" command="activate" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapFirstDecileColor/ColorButton/1QColorDialog0" command="setChosenColor" arguments="184,191,54" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapFirstDecileColor/ColorButton/1QColorDialog0" command="done" arguments="1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapMedianColor/ColorButton" command="activate" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapMedianColor/ColorButton/1QColorDialog0" command="setChosenColor" arguments="41,41,191" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapMedianColor/ColorButton/1QColorDialog0" command="done" arguments="1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapLastDecileColor/ColorButton" command="activate" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapLastDecileColor/ColorButton/1QColorDialog0" command="setChosenColor" arguments="191,51,58" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ScatterPlotDensityMapLastDecileColor/ColorButton/1QColorDialog0" command="done" arguments="1" />
</pqevents>
......@@ -205,6 +205,7 @@ option(PARAVIEW_USE_OPENVR "Build ParaView with OpenVR rendering" OFF)
set(VTK_OPENVR_OBJECT_FACTORY OFF
CACHE INTERNAL "ParaView requires the OpenVR factory be disabled" FORCE)
option(PARAVIEW_USE_VISITBRIDGE "Build ParaView with VisIt readers." OFF)
option(PARAVIEW_USE_OPENTURNS "Build ParaView with OpenTURNS filters and density maps" OFF)
# NvPipe requires an NVIDIA GPU.
option(PARAVIEW_ENABLE_NVPIPE
......
......@@ -11,6 +11,9 @@ endif()
if(PARAVIEW_USE_OSPRAY)
list(APPEND __dependencies vtkRenderingOSPRay)
endif()
if(PARAVIEW_USE_OPENTURNS)
list(APPEND __dependencies vtkFiltersOpenTurns)
endif()
vtk_module(vtkPVClientServerCoreRendering
GROUPS
......
......@@ -93,6 +93,22 @@ int vtkPVHistogramChartRepresentation::GetBinCount()
return this->ExtractHistogram->GetBinCount();
}
//----------------------------------------------------------------------------
void vtkPVHistogramChartRepresentation::SetCenterBinsAroundMinAndMax(bool center)
{
if (this->ExtractHistogram->GetCenterBinsAroundMinAndMax() != center)
{
this->ExtractHistogram->SetCenterBinsAroundMinAndMax(center);
this->MarkModified();
}
}
//----------------------------------------------------------------------------
bool vtkPVHistogramChartRepresentation::GetCenterBinsAroundMinAndMax()
{
return this->ExtractHistogram->GetCenterBinsAroundMinAndMax();
}
//----------------------------------------------------------------------------
void vtkPVHistogramChartRepresentation::SetUseCustomBinRanges(bool b)
{
......
......@@ -57,6 +57,16 @@ public:
int GetBinCount();
//@}
//@{
/**
* Get/Set if first and last bins must be centered around the min and max
* data. This is only used when UseCustomBinRanges is set to false.
* Default is false.
*/
void SetCenterBinsAroundMinAndMax(bool);
bool GetCenterBinsAroundMinAndMax();
//@}
//@{
/**
* Get/Set custom bin ranges to use. These are used only when
......
......@@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkAnnotationLink.h"
#include "vtkObjectFactory.h"
#include "vtkPVConfig.h" // for PARAVIEW_USE_OPENTURNS
#include "vtkPVContextView.h"
#include "vtkPlotPoints.h"
#include "vtkScatterPlotMatrix.h"
......@@ -41,6 +42,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkStringArray.h"
#include "vtkTable.h"
#ifdef PARAVIEW_USE_OPENTURNS
#include "vtkOTScatterPlotMatrix.h"
#endif // PARAVIEW_USE_OPENTURNS
#include <set>
#include <string>
#include <utility>
......@@ -90,17 +95,33 @@ public:
}
};
namespace
{
vtkColor4ub MakeColor(double r, double g, double b)
{
return vtkColor4ub(static_cast<unsigned char>(r * 255), static_cast<unsigned char>(g * 255),
static_cast<unsigned char>(b * 255));
}
}
//----------------------------------------------------------------------------
vtkPVPlotMatrixRepresentation::vtkPVPlotMatrixRepresentation()
{
this->Internals = new vtkInternals();
// default colors are black (0, 0, 0)
// default Colors are black (0, 0, 0)
for (int i = 0; i < 3; i++)
{
this->ScatterPlotColor[i] = 0;
this->ActivePlotColor[i] = 0;
this->HistogramColor[i] = 0;
this->ScatterPlotDensityMapFirstDecileColor[i] = 0;
this->ActivePlotDensityMapFirstDecileColor[i] = 0;
this->ScatterPlotDensityMapMedianColor[i] = 0;
this->ActivePlotDensityMapMedianColor[i] = 0;
this->ScatterPlotDensityMapLastDecileColor[i] = 0;
this->ActivePlotDensityMapLastDecileColor[i] = 0;
}
this->ScatterPlotColor[3] = 255;
this->ActivePlotColor[3] = 255;
......@@ -110,6 +131,17 @@ vtkPVPlotMatrixRepresentation::vtkPVPlotMatrixRepresentation()
this->ActivePlotMarkerStyle = vtkPlotPoints::CIRCLE;
this->ScatterPlotMarkerSize = 5.0;
this->ActivePlotMarkerSize = 8.0;
this->ActivePlotDensityMapVisibility = false;
this->ScatterPlotDensityMapVisibility = false;
this->ScatterPlotDensityLineSize = 2.0;
this->ActivePlotDensityLineSize = 3.0;
this->ScatterPlotDensityMapFirstDecileColor[3] = 255;
this->ActivePlotDensityMapFirstDecileColor[3] = 255;
this->ScatterPlotDensityMapMedianColor[3] = 255;
this->ActivePlotDensityMapMedianColor[3] = 255;
this->ScatterPlotDensityMapLastDecileColor[3] = 255;
this->ActivePlotDensityMapLastDecileColor[3] = 255;
}
//----------------------------------------------------------------------------
......@@ -163,6 +195,33 @@ void vtkPVPlotMatrixRepresentation::PrepareForRendering()
plotMatrix->SetPlotMarkerSize(vtkScatterPlotMatrix::SCATTERPLOT, this->ScatterPlotMarkerSize);
plotMatrix->SetPlotMarkerSize(vtkScatterPlotMatrix::ACTIVEPLOT, this->ActivePlotMarkerSize);
#ifdef PARAVIEW_USE_OPENTURNS
vtkOTScatterPlotMatrix* otPlotMatrix = vtkOTScatterPlotMatrix::SafeDownCast(plotMatrix);
if (otPlotMatrix)
{
otPlotMatrix->SetDensityMapVisibility(
vtkScatterPlotMatrix::SCATTERPLOT, this->ScatterPlotDensityMapVisibility);
otPlotMatrix->SetDensityMapVisibility(
vtkScatterPlotMatrix::ACTIVEPLOT, this->ActivePlotDensityMapVisibility);
otPlotMatrix->SetDensityLineSize(
vtkScatterPlotMatrix::SCATTERPLOT, this->ScatterPlotDensityLineSize);
otPlotMatrix->SetDensityLineSize(
vtkScatterPlotMatrix::ACTIVEPLOT, this->ActivePlotDensityLineSize);
otPlotMatrix->SetDensityMapColor(
vtkScatterPlotMatrix::SCATTERPLOT, 0, this->ScatterPlotDensityMapFirstDecileColor);
otPlotMatrix->SetDensityMapColor(
vtkScatterPlotMatrix::ACTIVEPLOT, 0, this->ActivePlotDensityMapFirstDecileColor);
otPlotMatrix->SetDensityMapColor(
vtkScatterPlotMatrix::SCATTERPLOT, 1, this->ScatterPlotDensityMapMedianColor);
otPlotMatrix->SetDensityMapColor(
vtkScatterPlotMatrix::ACTIVEPLOT, 1, this->ActivePlotDensityMapMedianColor);
otPlotMatrix->SetDensityMapColor(
vtkScatterPlotMatrix::SCATTERPLOT, 2, this->ScatterPlotDensityMapLastDecileColor);
otPlotMatrix->SetDensityMapColor(
vtkScatterPlotMatrix::ACTIVEPLOT, 2, this->ActivePlotDensityMapLastDecileColor);
}
#endif // PARAVIEW_USE_OPENTURNS
// vtkPVPlotMatrixRepresentation doesn't support multiblock of tables, so we
// only consider the first vtkTable.
vtkTable* table = this->GetLocalOutput();
......@@ -224,25 +283,21 @@ void vtkPVPlotMatrixRepresentation::ClearSeriesVisibilities()
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetColor(double r, double g, double b)
{
this->ScatterPlotColor = vtkColor4ub(static_cast<unsigned char>(r * 255),
static_cast<unsigned char>(g * 255), static_cast<unsigned char>(b * 255));
this->ScatterPlotColor = MakeColor(r, g, b);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotColor(double r, double g, double b)
{
this->ActivePlotColor = vtkColor4ub(static_cast<unsigned char>(r * 255),
static_cast<unsigned char>(g * 255), static_cast<unsigned char>(b * 255));
this->ActivePlotColor = MakeColor(r, g, b);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetHistogramColor(double r, double g, double b)
{
this->HistogramColor = vtkColor4ub(static_cast<unsigned char>(r * 255),
static_cast<unsigned char>(g * 255), static_cast<unsigned char>(b * 255));
this->HistogramColor = MakeColor(r, g, b);
this->Modified();
}
......@@ -274,6 +329,78 @@ void vtkPVPlotMatrixRepresentation::SetActivePlotMarkerSize(double size)
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetDensityMapVisibility(bool visible)
{
this->ScatterPlotDensityMapVisibility = visible;
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotDensityMapVisibility(bool visible)
{
this->ActivePlotDensityMapVisibility = visible;
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetDensityLineSize(double size)
{
this->ScatterPlotDensityLineSize = size;
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotDensityLineSize(double size)
{
this->ActivePlotDensityLineSize = size;
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetDensityMapFirstDecileColor(double r, double g, double b)
{
this->ScatterPlotDensityMapFirstDecileColor = MakeColor(r, g, b);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotDensityMapFirstDecileColor(
double r, double g, double b)
{
this->ActivePlotDensityMapFirstDecileColor = MakeColor(r, g, b);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetDensityMapMedianColor(double r, double g, double b)
{
this->ScatterPlotDensityMapMedianColor = MakeColor(r, g, b);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotDensityMapMedianColor(double r, double g, double b)
{
this->ActivePlotDensityMapMedianColor = MakeColor(r, g, b);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetDensityMapLastDecileColor(double r, double g, double b)
{
this->ScatterPlotDensityMapLastDecileColor = MakeColor(r, g, b);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotDensityMapLastDecileColor(
double r, double g, double b)
{
this->ActivePlotDensityMapLastDecileColor = MakeColor(r, g, b);
this->Modified();
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -111,6 +111,56 @@ public:
*/
void SetActivePlotMarkerSize(double size);
/**
* Set the scatter plot density map visibility
*/
void SetDensityMapVisibility(bool visible);
/**
* Set the active plot density map visibility
*/
void SetActivePlotDensityMapVisibility(bool visible);
/**
* Sets the line size for the density map in the plot matrix.
*/
void SetDensityLineSize(double size);
/**
* Sets the line size for the density map in the active plot.
*/
void SetActivePlotDensityLineSize(double size);
/**
* Sets the color for the density map first DecileColor in the scatter plots.
*/
void SetDensityMapFirstDecileColor(double r, double g, double b);
/**
* Sets the color for the density map first DecileColor in the scatter plots.
*/
void SetActivePlotDensityMapFirstDecileColor(double r, double g, double b);
/**
* Sets the color for the density map MeanColor in the scatter plots.
*/
void SetDensityMapMedianColor(double r, double g, double b);
/**
* Sets the color for the density map MeanColor in the scatter plots.
*/
void SetActivePlotDensityMapMedianColor(double r, double g, double b);
/**
* Sets the color for the density map last DecileColor in the scatter plots.
*/
void SetDensityMapLastDecileColor(double r, double g, double b);
/**
* Sets the color for the density map last DecileColor in the scatter plots.
*/
void SetActivePlotDensityMapLastDecileColor(double r, double g, double b);
/**
* Returns the scatter plot matrix.
*/
......@@ -150,6 +200,17 @@ private:
int ActivePlotMarkerStyle;
double ScatterPlotMarkerSize;
double ActivePlotMarkerSize;
bool ActivePlotDensityMapVisibility;
bool ScatterPlotDensityMapVisibility;
double ScatterPlotDensityLineSize;
double ActivePlotDensityLineSize;
vtkColor4ub ScatterPlotDensityMapFirstDecileColor;
vtkColor4ub ActivePlotDensityMapFirstDecileColor;
vtkColor4ub ScatterPlotDensityMapMedianColor;
vtkColor4ub ActivePlotDensityMapMedianColor;
vtkColor4ub ScatterPlotDensityMapLastDecileColor;
vtkColor4ub ActivePlotDensityMapLastDecileColor;
};
#endif
......@@ -55,6 +55,7 @@ set (Module_SRCS
vtkSMTesting.cxx
vtkSMTooltipSelectionPipeline.cxx
vtkSMViewExportHelper.cxx
vtkSMXYChartRepresentationInitializationHelper.cxx
)
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
......
/*=========================================================================
Program: ParaView
Module: vtkSMXYChartRepresentationInitializationHelper.cxx
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkSMXYChartRepresentationInitializationHelper.h"
#include "vtkObjectFactory.h"
#include "vtkSMChartSeriesSelectionDomain.h"
#include "vtkSMDomain.h"
#include "vtkSMDomainIterator.h"
#include "vtkSMProperty.h"
#include "vtkSMPropertyHelper.h"
#include "vtkSMProxySelectionModel.h"
#include "vtkSMRepresentationProxy.h"
#include "vtkSMSessionProxyManager.h"
#include "vtkSMViewProxy.h"
#include <cassert>
vtkStandardNewMacro(vtkSMXYChartRepresentationInitializationHelper);
//----------------------------------------------------------------------------
vtkSMXYChartRepresentationInitializationHelper::vtkSMXYChartRepresentationInitializationHelper()
{
}
//----------------------------------------------------------------------------
vtkSMXYChartRepresentationInitializationHelper::~vtkSMXYChartRepresentationInitializationHelper()
{
}
//----------------------------------------------------------------------------
void vtkSMXYChartRepresentationInitializationHelper::PostInitializeProxy(
vtkSMProxy* proxy, vtkPVXMLElement*, unsigned long vtkNotUsed(ts))
{
assert(proxy != NULL);
vtkSMSessionProxyManager* pxm = proxy->GetSessionProxyManager();
vtkSMViewProxy* activeView = NULL;
if (vtkSMProxySelectionModel* viewSM = pxm->GetSelectionModel("ActiveView"))
{
activeView = vtkSMViewProxy::SafeDownCast(viewSM->GetCurrentProxy());
}
vtkSMPropertyHelper input(proxy, "Input");
if (activeView && (!strcmp(activeView->GetXMLName(), "XYBarChartView") ||
!strcmp(activeView->GetXMLName(), "XYHistogramChartView")) &&
input.GetAsProxy())
{
if (vtkSMRepresentationProxy* repr = vtkSMRepresentationProxy::SafeDownCast(proxy))
{
if (!strcmp(repr->GetXMLName(), "XYChartRepresentation") &&
repr->GetProperty("SeriesPlotCorner"))
{
vtkSMProperty* corner = repr->GetProperty("SeriesPlotCorner");
vtkSMChartSeriesSelectionDomain* cornerDomain =
vtkSMChartSeriesSelectionDomain::SafeDownCast(
corner->FindDomain("vtkSMChartSeriesSelectionDomain"));
cornerDomain->SetDefaultValue("2");
}
}
}
}
//----------------------------------------------------------------------------
void vtkSMXYChartRepresentationInitializationHelper::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
/*=========================================================================
Program: ParaView
Module: vtkSMXYChartRepresentationInitializationHelper.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkSMXYChartRepresentationInitializationHelper
* @brief initialization helper for XYChartRepresentation proxy.
*
* vtkSMXYChartRepresentationInitializationHelper is an initialization helper for
* the XYChartRepresentation proxy that change default PlotCorner values
* in case the representation is added to a XYBarCharView.
*/
#ifndef vtkSMXYChartRepresentationInitializationHelper_h
#define vtkSMXYChartRepresentationInitializationHelper_h
#include "vtkPVServerManagerDefaultModule.h" //needed for exports
#include "vtkSMProxyInitializationHelper.h"
class VTKPVSERVERMANAGERDEFAULT_EXPORT vtkSMXYChartRepresentationInitializationHelper
: public vtkSMProxyInitializationHelper
{
public:
static vtkSMXYChartRepresentationInitializationHelper* New();
vtkTypeMacro(vtkSMXYChartRepresentationInitializationHelper, vtkSMProxyInitializationHelper);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
void PostInitializeProxy(vtkSMProxy*, vtkPVXMLElement*, unsigned long) VTK_OVERRIDE;
protected:
vtkSMXYChartRepresentationInitializationHelper();
~vtkSMXYChartRepresentationInitializationHelper() VTK_OVERRIDE;
private:
vtkSMXYChartRepresentationInitializationHelper(
const vtkSMXYChartRepresentationInitializationHelper&) VTK_DELETE_FUNCTION;
void operator=(const vtkSMXYChartRepresentationInitializationHelper&) VTK_DELETE_FUNCTION;
};
#endif
......@@ -96,6 +96,8 @@ public:
}
static bool GetLoadNoChartVariables() { return vtkSMChartSeriesSelectionDomain::LoadNoVariables; }
vtkSetStringMacro(DefaultValue);
protected:
vtkSMChartSeriesSelectionDomain();
~vtkSMChartSeriesSelectionDomain();
......@@ -153,7 +155,6 @@ protected:
* Value used when DefaultMode==VALUE
*/
char* DefaultValue;
vtkSetStringMacro(DefaultValue);
//@}
/**
......
......@@ -744,6 +744,15 @@ bool vtkSMViewProxy::HideOtherRepresentationsIfNeeded(vtkSMProxy* repr)
return false;
}
vtkPVXMLElement* oneRepr =
this->GetHints()->FindNestedElementByName("ShowOneRepresentationAtATime");
const char* reprType = oneRepr->GetAttribute("type");
if (reprType && strcmp(repr->GetXMLName(), reprType))
{
return false;
}
vtkNew<vtkSMParaViewPipelineControllerWithRendering> controller;
bool modified = false;
......@@ -753,7 +762,8 @@ bool vtkSMViewProxy::HideOtherRepresentationsIfNeeded(vtkSMProxy* repr)
vtkSMRepresentationProxy* arepr = vtkSMRepresentationProxy::SafeDownCast(helper.GetAsProxy(cc));
if (arepr && arepr != repr)
{
if (vtkSMPropertyHelper(arepr, "Visibility", /*quiet*/ true).GetAsInt() == 1)
if (vtkSMPropertyHelper(arepr, "Visibility", /*quiet*/ true).GetAsInt() == 1 &&
(!reprType || (reprType && !strcmp(arepr->GetXMLName(), reprType))))
{
controller->Hide(arepr, this);
modified = true;
......
......@@ -140,6 +140,12 @@ if (vtkioadios_index GREATER 0)
list(APPEND requestedResourceFiles
${CMAKE_CURRENT_SOURCE_DIR}/Resources/proxies_adios.xml)
endif()
if (PARAVIEW_USE_OPENTURNS)
list(APPEND requestedResourceFiles
${CMAKE_CURRENT_SOURCE_DIR}/Resources/proxies_openturns.xml)
endif()
#------------------------------------------------------------------------------
if (PARAVIEW_ENABLE_PYTHON)
......
......@@ -11557,6 +11557,23 @@ source.</Documentation>
<Documentation>The value of this property specifies the array component
from which the histogram should be computed.</Documentation>
</IntVectorProperty>
<IntVectorProperty command="SetCenterBinsAroundMinAndMax"
default_values="0"
name="CenterBinsAroundMinAndMax"
number_of_elements="1"
panel_visibility="advanced">
<BooleanDomain name="bool" />
<Documentation>When set to true, first and last bin will be centered
around the minimum and the maximum values of the data.
By default, set to false.</Documentation>
<Hints>
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="UseCustomBinRanges"
value="0" />
<!-- show this widget when UseCustomBinRanges==0 -->
</Hints>
</IntVectorProperty>
<IntVectorProperty command="SetCalculateAverages"
default_values="0"
name="CalculateAverages"
......
......@@ -2819,7 +2819,7 @@
</ContextViewProxy>
<!-- ================================================================== -->
<ContextViewProxy base_proxygroup="internal_views"
base_proxyname="XYChartViewBase"
base_proxyname="XYChartViewBase4Axes"
class="vtkPVXYChartView"
name="XYBarChartView"
label="Bar Chart View"
......@@ -2852,7 +2852,7 @@
</ContextViewProxy>
<!-- ================================================================== -->
<ContextViewProxy base_proxygroup="internal_views"
base_proxyname="XYChartViewBase"
base_proxyname="XYChartViewBase4Axes"