...
 
Commits (71)
......@@ -58,7 +58,7 @@ paraview_client_add(
BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/MacOSXBundleInfo.plist.in"
APPLICATION_ICON "${CMAKE_CURRENT_SOURCE_DIR}/pvIcon.ico"
SOURCES ${sources}
PLUGINS_TARGETS paraview_plugins
PLUGINS_TARGETS ParaView::paraview_plugins
APPLICATION_XMLS ${xmls})
find_package(Qt5 REQUIRED QUIET COMPONENTS Widgets)
......
......@@ -209,6 +209,7 @@
<Proxy group="filters" name="FFTSelectionOverTime" />
<Proxy group="filters" name="GaussianSplatter"/>
<Proxy group="filters" name="GenerateIdScalars"/>
<Proxy group="filters" name="GenerateGlobalIds"/>
<Proxy group="filters" name="GhostCellsGenerator" />
<Proxy group="filters" name="Glyph" />
<Proxy group="filters" name="NewGlyph" />
......
e80b6fc32fa82cf69edd82f45e525cbd810f19c0f86811bdb144fe728a2de036035f0b18a1a94b4ae386627ec53985dc5b43c3d295fcdbeeba68c66e0916b621
d552d90a0c67097ef57cd16f1004d0cb5722b45b0cea0a2ee51230caa7ae26f4e973e122564b7dc899a58c63bd950a7656c9c79115e287ca0c18e667cf4f1631
389cbc1c5cebfadebc8391d6515b10c9221c4318d14d837bc7ef8bf0c4e10370ac9030947e9be0eab59905ecbebfbe372117fd78245c1bd84590890b9a8a9101
dbfe6eca654faffbe381beacccec4ce629c25e491c1a61d2ebe653592d61af33607c95ea64e618fc1510f96791ceeb111882a6750597f88b53c48360ff5c0847
b3e13840820de279a296360239ebca5390d0131c419dcbbb91d544422aa19bc21e11d974296495890b147e2cc6a39ff7ca07d8fab81a6d5a6eea90293e9be179
......@@ -70,7 +70,7 @@ smtesting.ProcessCommandLineArguments()
RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).
imageFile = os.path.splitext(os.path.basename(smtesting.StateXMLFileName))[0]
SaveScreenshot('%s/../../%s.png' % (smtesting.TempDir, imageFile))
SaveScreenshot('%s/%s.png' % (smtesting.TempDir, imageFile))
if not smtesting.DoRegressionTesting(renderView1.SMProxy):
raise smtesting.TestError('Test failed')
......@@ -207,8 +207,10 @@ ExternalData_Expand_Arguments(ParaViewData _
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridAxisCut.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridAxisReflection.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridCellCenters.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridContour.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridDepthLimiter.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridPlaneCutter.png}"
#"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridThreshold.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridThreshold-DepthOne.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/HyperTreeGridThreshold-DepthTwo.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/ImportCinema.png}"
......@@ -393,6 +395,7 @@ ExternalData_Expand_Arguments(ParaViewData _
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/UseDataPartitions3.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/UseDataPartitions4.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/VolumeCellSelection.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/VolumeCrop.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/VolumeNoMapScalars.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/XYChart_ChangeParameters.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/XYChart_Default.png}"
......@@ -460,10 +463,12 @@ SET (TESTS_WITH_INLINE_COMPARES
FileSeries.xml
#HyperTreeGridAxisClip.xml
#HyperTreeGridAxisCut.xml
#HyperTreeGridAxisReflection.xml
#HyperTreeGridCellCenters.xml
#HyperTreeGridContour.xml
HyperTreeGridAxisReflection.xml
HyperTreeGridCellCenters.xml
HyperTreeGridContour.xml
HyperTreeGridDepthLimiter.xml
#HyperTreeGridPlaneCutter.xml
#HyperTreeGridThreshold.xml
LightAddRemove.xml
LineChartSelection.xml
LoadStateMultiView.xml
......@@ -494,17 +499,6 @@ SET (TESTS_WITH_INLINE_COMPARES
XYHistogram.xml
)
# These tests do not work in parallel due to issues with
# partitioned vtkHyperTreeGrids. When those issues are fixed
# these tests should be enabled in parallel again by adding
# them back to TESTS_WITH_INLINE_COMPARES
SET (HTG_TESTS_WITH_INLINE_COMPARES
HyperTreeGridDepthLimiter.xml
HyperTreeGridThreshold.xml
)
paraview_add_client_tests(
TEST_SCRIPTS ${HTG_TESTS_WITH_INLINE_COMPARES}
)
if(NOT APPLE)
# Workaround to avoid testing failures on high-res Retina displays on Macs
......@@ -853,6 +847,7 @@ list(APPEND TESTS_WITH_BASELINES
UnstructuredOutline.xml
UniformInverseTransformSamplingGlyph.xml
VectorComponentHistogram.xml
VolumeCrop.xml
VolumeRenderingWithContour.xml
VolumeReprTwoIndepComp.xml
VariableSelector.xml
......@@ -1255,6 +1250,7 @@ set (LoadSaveStateVolume_FORCE_SERIAL TRUE)
set(LoadSaveStateVolume_DISABLE_CRS TRUE)
set(SeparatedColorMapOpacity_DISABLE_CRS TRUE)
set(VolumeReprTwoIndepComp_DISABLE_CRS TRUE)
set(VolumeCrop_DISABLE_CRS TRUE)
# Set properties for CTH tests
set(CTHAMRContour_DISABLE_CS TRUE)
......
......@@ -18,4 +18,10 @@
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/OnlyReportSelectionStatistics/CheckBox" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/MainControlsToolbar/actionAutoApply" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/SeriesTable" command="setCurrent" arguments="0.0" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/SeriesTable" command="setCheckState" arguments="0.0,2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseWheel" arguments="-120,0,0,87,220" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/MarkerSize" command="set_double" arguments="1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/MarkerSize" command="set_double" arguments="10" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/MarkerStyleList" command="activated" arguments="Square" />
</pqevents>
......@@ -8,4 +8,8 @@
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/CentralWidgetFrame/EmptyView/scrollArea/qt_scrollarea_viewport/widgetFoo/ConvertActionsFrame/XYPointChartView" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,11,4,/0:0/0:1" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,11,4,/0:0/0:1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/SeriesTable" command="setCurrent" arguments="0.2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/SeriesTable" command="setCurrent" arguments="6.2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/MarkerSize" command="set_double" arguments="1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/MarkerSize" command="set_double" arguments="10" />
</pqevents>
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
<pqevent object="pqClientMainWindow/menubar/menuSources/Alphabetical" command="activate" arguments="RTAnalyticSource" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/ViewFrame/ProxyPanel/OrientationAxesVisibility/CheckBox" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/representationToolbar/displayRepresentation/comboBox" command="activated" arguments="Volume" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/UseCropping/CheckBox" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/InteractiveBox/scaleX" command="set_string" arguments="0.5" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/InteractiveBox/translateX" command="set_string" arguments="0.2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/InteractiveBox/scaleY" command="set_string" arguments="0.8" />
</pqevents>
......@@ -43,7 +43,7 @@
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/SeriesTable" command="setCheckState" arguments="11.0,2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/SeriesTable" command="setCurrent" arguments="11.0" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/SeriesTable" command="setCheckState" arguments="11.0,2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/Thickness" command="set_int" arguments="3" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/Thickness" command="set_double" arguments="3" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/Thickness" command="key" arguments="16777221" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/SeriesEditor/StyleList" command="set_string" arguments="Dash" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/CompositeDataSetIndex/TreeWidget" command="setCheckState" arguments="0.0.1.0,2" />
......
......@@ -280,7 +280,7 @@ IDI_ICON1 ICON \"${_paraview_client_APPLICATION_ICON}\"\n")
set(CMAKE_AUTORCC 1)
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/paraview-find-package-helpers.cmake" OPTIONAL)
include("${_ParaViewClient_cmake_dir}/paraview-find-package-helpers.cmake" OPTIONAL)
find_package(Qt5 REQUIRED QUIET COMPONENTS Core Widgets)
# CMake 3.13 started using Qt5's version variables to detect what version
......@@ -311,10 +311,11 @@ IDI_ICON1 ICON \"${_paraview_client_APPLICATION_ICON}\"\n")
if (_paraview_client_PLUGINS_TARGETS)
set(_paraview_client_have_plugins 1)
foreach (_paraview_client_plugin_target IN LISTS _paraview_client_PLUGINS_TARGETS)
string(REPLACE "::" "_" _paraview_client_plugin_target_safe "${_paraview_client_plugin_target}")
string(APPEND _paraview_client_plugins_includes
"#include \"${_paraview_client_plugin_target}.h\"\n")
"#include \"${_paraview_client_plugin_target_safe}.h\"\n")
string(APPEND _paraview_client_plugins_calls
" ${_paraview_client_plugin_target}_initialize();\n")
" ${_paraview_client_plugin_target_safe}_initialize();\n")
endforeach ()
endif ()
......@@ -377,6 +378,24 @@ IDI_ICON1 ICON \"${_paraview_client_APPLICATION_ICON}\"\n")
target_link_libraries("${_paraview_client_NAME}"
PRIVATE
${_paraview_client_PLUGINS_TARGETS})
set(_paraview_client_binary_destination
"${_paraview_client_RUNTIME_DESTINATION}")
set(_paraview_client_conf_destination
"${_paraview_client_binary_destination}")
if (APPLE)
set(_paraview_client_binary_destination
"${_paraview_client_RUNTIME_DESTINATION}/${_paraview_client_NAME}.app/Contents/Resources")
set(_paraview_client_conf_destination
"${_paraview_client_BUNDLE_DESTINATION}/${_paraview_client_NAME}.app/Contents/Resources")
endif ()
paraview_plugin_write_conf(
NAME "${_paraview_client_NAME}"
PLUGINS_TARGETS ${_paraview_client_PLUGINS_TARGETS}
BUILD_DESTINATION "${_paraview_client_binary_destination}"
INSTALL_DESTINATION "${_paraview_client_conf_destination}"
COMPONENT "runtime")
endif ()
set(_paraview_client_export)
......@@ -389,7 +408,8 @@ IDI_ICON1 ICON \"${_paraview_client_APPLICATION_ICON}\"\n")
TARGETS "${_paraview_client_NAME}"
${_paraview_client_export}
${_paraview_client_bundle_args}
RUNTIME DESTINATION "${_paraview_client_RUNTIME_DESTINATION}")
RUNTIME DESTINATION "${_paraview_client_RUNTIME_DESTINATION}"
COMPONENT "runtime")
if (APPLE)
if (DEFINED _paraview_client_BUNDLE_ICON)
......@@ -486,9 +506,11 @@ function (paraview_client_documentation)
"The `XMLS` argument is required.")
endif ()
include("${_ParaViewClient_cmake_dir}/paraview-find-package-helpers.cmake" OPTIONAL)
find_program(qt_xmlpatterns_executable
NAMES xmlpatterns-qt5 xmlpatterns
HINTS "${Qt5_DIR}/../../../bin"
"${Qt5_DIR}/../../../libexec/qt5/bin"
DOC "Path to xmlpatterns")
mark_as_advanced(qt_xmlpatterns_executable)
......@@ -764,6 +786,7 @@ function (paraview_client_generate_help)
"*.*")
endif ()
include("${_ParaViewClient_cmake_dir}/paraview-find-package-helpers.cmake" OPTIONAL)
find_package(Qt5 QUIET REQUIRED COMPONENTS Help)
set(_paraview_client_help_copy_sources)
......
......@@ -8,7 +8,6 @@ function (_paraview_package_append_variables)
string(APPEND _paraview_package_variables
"if (NOT DEFINED \"${var}\")
set(\"${var}\" \"${${var}}\")
list(APPEND _paraview_find_package_variables \"${var}\")
elseif (NOT ${var})
set(\"${var}\" \"${${var}}\")
endif ()
......
This diff is collapsed.
......@@ -49,16 +49,12 @@ unset(_paraview_use_external_vtk)
include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-vtk-module-properties.cmake")
set(_paraview_find_package_variables)
include("${CMAKE_CURRENT_LIST_DIR}/paraview-find-package-helpers.cmake" OPTIONAL)
include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-vtk-module-find-packages.cmake")
foreach (_paraview_find_package_variable IN LISTS _paraview_find_package_variables)
unset("${_paraview_find_package_variable}")
endforeach ()
unset(_paraview_find_package_variable)
unset(_paraview_find_package_variables)
include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}Plugins-paraview_plugins-targets-depends.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}Plugins-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}Plugins-paraview-plugin-properties.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/ParaViewClient.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/ParaViewPlugin.cmake")
......
......@@ -115,6 +115,8 @@ pq@_paraview_client_NAME@Initializer::Status pq@_paraview_client_NAME@Initialize
}
#endif
vtkPVPluginTracker::GetInstance()->LoadPluginConfigurationXMLs("@_paraview_client_NAME@");
// Create main window.
this->MainWindow = new @_paraview_client_MAIN_WINDOW_CLASS@();
......
......@@ -544,6 +544,7 @@ list(APPEND paraview_requested_modules
ParaView::VTKExtensionsPoints
ParaView::WrapClientServer
VTK::FiltersFlowPaths
VTK::FiltersTexture
VTK::FiltersVerdict
VTK::IOAMR
VTK::IOAsynchronous # needed for cinema, but no harm adding always.
......@@ -897,11 +898,16 @@ vtk_module_json(
OUTPUT "paraview-modules.json")
paraview_plugin_build(
HEADERS_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/paraview${paraview_version_suffix}"
RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY_SUBDIRECTORY "paraview${paraview_version_suffix}/plugins"
PLUGINS_FILE_NAME ".plugins"
TARGET paraview_plugins
CMAKE_DESTINATION "${paraview_cmake_destination}"
PLUGINS_FILE_NAME "paraview.plugins.xml"
TARGET ParaView::paraview_plugins
INSTALL_EXPORT ParaViewPlugins
TARGET_COMPONENT "development"
PLUGINS_COMPONENT "plugins"
PLUGINS ${paraview_plugins})
set(CMAKE_INSTALL_RPATH
......
......@@ -40,8 +40,6 @@ args = parser.parse_args()
result = 0
print("----------------------------------------------------------")
print("Running CinemaExportCheck")
......@@ -54,9 +52,7 @@ if ((args.interactive != None) and (args.batch != None)):
# - Create a baseline data.csv that we know works and check against that?
else:
print(" ERROR: incorrect number of arguments")
result = 1
exit(1)
print("Completed CinemaExportCheck")
print("----------------------------------------------------------")
exit(result)
......@@ -95,7 +95,7 @@ if(USE_MPI)
message("${CINEMA_DATABASE_TESTER}")
execute_process_with_echo(COMMAND
${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_NUMPROCS} ${MPIEXEC_PREFLAGS}
${PVPBATCH_EXECUTABLE}
${PVBATCH_EXECUTABLE}
${CINEMA_DATABASE_TESTER}
--interactive ${COPROCESSING_TEST_DIR}/cinema/interactive/${TEST_NAME}.cdb
--batch ${COPROCESSING_TEST_DIR}/cinema/batch/${TEST_NAME}.cdb
......
......@@ -46,6 +46,20 @@ if (UNIX AND NOT APPLE)
"${_paraview_client_origin_rpath}")
endif()
# A plugin configuration file is required if either the GUI
# application is not built (the configuration file is provided
# there if so) or we're on macOS where the configuration file is
# then stored under the bundle for the application. Instead,
# provide our own configuration file instead.
if (APPLE OR NOT PARAVIEW_BUILD_QT_GUI)
paraview_plugin_write_conf(
NAME "paraview"
PLUGINS_TARGETS ParaView::paraview_plugins
BUILD_DESTINATION "${CMAKE_INSTALL_BINDIR}"
INSTALL_DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT "runtime")
endif ()
include("${CMAKE_CURRENT_SOURCE_DIR}/ParaViewCommandLineExecutables.cmake")
set(paraview_tools)
......
......@@ -21,7 +21,7 @@ function (paraview_add_executable name)
target_link_libraries("${name}"
PRIVATE
paraview_plugins)
ParaView::paraview_plugins)
if (PARAVIEW_ENABLE_PYTHON)
target_compile_definitions("${name}"
......
......@@ -21,6 +21,7 @@ void vtkPVInitializePythonModules();
#include "vtkInitializationHelper.h"
#include "vtkLogger.h"
#include "vtkMultiProcessController.h"
#include "vtkPVPluginTracker.h"
#include "vtkPVPythonOptions.h"
#include "vtkProcessModule.h"
#include "vtkPythonInterpreter.h"
......@@ -85,6 +86,8 @@ int Run(int processType, int argc, char* argv[])
// empty when BUILD_SHARED_LIBS is ON.
vtkPVInitializePythonModules();
vtkPVPluginTracker::GetInstance()->LoadPluginConfigurationXMLs("paraview");
int ret_val = 0;
if (pm->GetSymmetricMPIMode() == false && pm->GetPartitionId() > 0)
{
......
......@@ -17,6 +17,7 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkInitializationHelper.h"
#include "vtkMultiProcessController.h"
#include "vtkNetworkAccessManager.h"
#include "vtkPVPluginTracker.h"
#include "vtkPVServerOptions.h"
#include "vtkPVSessionServer.h"
#include "vtkProcessModule.h"
......@@ -25,7 +26,7 @@ PURPOSE. See the above copyright notice for more information.
#include "pvpythonmodules.h"
#endif
#include "paraview_plugins.h"
#include "ParaView_paraview_plugins.h"
static bool RealMain(int argc, char* argv[], vtkProcessModule::ProcessTypes type)
{
......@@ -51,7 +52,9 @@ static bool RealMain(int argc, char* argv[], vtkProcessModule::ProcessTypes type
#endif
// load static plugins
paraview_plugins_initialize();
ParaView_paraview_plugins_initialize();
vtkPVPluginTracker::GetInstance()->LoadPluginConfigurationXMLs("paraview");
vtkProcessModule* pm = vtkProcessModule::GetProcessModule();
vtkMultiProcessController* controller = pm->GetGlobalController();
......
# Adding expansion depth for tree view in xml
If a filter uses a tree widget (ArrayListDomain, ArraySelectionDomain, EnumerationDomain, CompositeTreeDomain), the default
expansion depth can now be controlled with a specific hint.
0 is the minimal expansion depth, only root node is expanded. -1 means expandAll.
<IntVectorProperty command="..." name="...">
<CompositeTreeDomain mode="all" name="tree">
<RequiredProperties>
<Property function="Input" name="Input" />
</RequiredProperties>
</CompositeTreeDomain>
<Hints>
<!-- This tag sets the height of the CompositeTreeDomain -->
<Expansion depth="3" />
</Hints>
</IntVectorProperty>
# Generating global point and cell ids
Newly added **Generate Global Ids** filter can be used to generate global
point and cell ids for any dataset. The filter also flags duplicate points
using appropriate ghost point flags.
# Plugin location properties
* Multiple static plugin search functions may now be registered. The
`vtkPVPluginTracker::SetStaticPluginSearchFunction` is deprecated in
preference for `vtkPVPluginTracker::RegisterStaticPluginSearchFunction`.
# Volume rendering cropping
It is now possible to volume-render only a volume of interest (VOI) of a 3D image data without\
applying a filter. A set of new properties and interactive box widget allows setting the\
axis-aligned VOI region.
......@@ -83,13 +83,23 @@ set(built_shared 0)
if (BUILD_SHARED_LIBS)
set(built_shared 1)
endif ()
set_property(SOURCE
vtkPVPluginLoader.cxx
vtkPVPluginTracker.cxx
APPEND
set_property(SOURCE vtkPVPluginLoader.cxx APPEND
PROPERTY
COMPILE_DEFINITIONS "BUILD_SHARED_LIBS=${built_shared}")
if (WIN32)
set(libdir_relpath ".")
else ()
file(RELATIVE_PATH libdir_relpath
"/prefix/${_vtk_build_RUNTIME_DESTINATION}"
"/prefix/${_vtk_build_LIBRARY_DESTINATION}")
endif ()
set_property(SOURCE vtkPVPluginTracker.cxx APPEND
PROPERTY
COMPILE_DEFINITIONS
"PARAVIEW_RELATIVE_LIBPATH=\"${libdir_relpath}\""
"PARAVIEW_SUBDIR=\"paraview${paraview_version_suffix}/plugins\"")
if (TARGET VTK::PythonInterpreter)
# TODO: Split these into a separate module so that there isn't a public
# optional dependency.
......
......@@ -134,7 +134,7 @@ public:
vtkGetMacro(NumberOfEdges, vtkTypeInt64);
vtkGetMacro(NumberOfLeaves, vtkTypeInt64);
vtkGetMacro(MemorySize, int);
vtkGetMacro(PolygonCount, int);
vtkGetMacro(PolygonCount, vtkIdType);
vtkGetMacro(NumberOfDataSets, int);
vtkGetVector6Macro(Bounds, double);
//@}
......
......@@ -203,20 +203,18 @@ vtkPVPluginLoaderCleaner* vtkPVPluginLoaderCleaner::LibCleaner = NULL;
//=============================================================================
using VectorOfCallbacks = std::vector<vtkPVPluginLoader::PluginLoaderCallback>;
static VectorOfCallbacks* RegisteredPluginLoaderCallbacks = nullptr;
static int nifty_counter = 0;
static vtkAtomicInt64 nifty_counter = 0;
vtkPVPluginLoaderCleanerInitializer::vtkPVPluginLoaderCleanerInitializer()
{
if (nifty_counter == 0)
if (nifty_counter++ == 0)
{
::RegisteredPluginLoaderCallbacks = new VectorOfCallbacks();
}
nifty_counter++;
}
vtkPVPluginLoaderCleanerInitializer::~vtkPVPluginLoaderCleanerInitializer()
{
nifty_counter--;
if (nifty_counter == 0)
if (--nifty_counter == 0)
{
vtkPVPluginLoaderCleaner::FinalizeInstance();
delete ::RegisteredPluginLoaderCallbacks;
......
......@@ -33,6 +33,7 @@
#include "vtkVersion.h"
#include <assert.h>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
......@@ -80,16 +81,17 @@ std::string vtkGetPluginFileNameFromName(const std::string& pluginname)
#endif
}
using VectorOfSearchFunctions = std::vector<vtkPluginSearchFunction>;
static VectorOfSearchFunctions RegisteredPluginSearchFunctions;
/**
* Locate a plugin library or a config file anchored at standard locations
* for locating plugins.
*/
std::string vtkLocatePluginOrConfigFile(
const char* plugin, bool isPlugin, vtkPluginSearchFunction searchFunction)
std::string vtkLocatePluginOrConfigFile(const char* plugin, const char* hint, bool isPlugin)
{
vtkVLogScopeF(PARAVIEW_LOG_PLUGIN_VERBOSITY(), "looking for plugin '%s'", plugin);
(void)searchFunction;
auto pm = vtkProcessModule::GetProcessModule();
// Make sure we can get the options before going further
if (pm == NULL)
......@@ -98,45 +100,29 @@ std::string vtkLocatePluginOrConfigFile(
return std::string();
}
#if !BUILD_SHARED_LIBS
bool debug_plugin = vtksys::SystemTools::GetEnv("PV_PLUGIN_DEBUG") != NULL;
// First search in the static lookup tables.
if (isPlugin)
{
if (searchFunction && searchFunction(plugin))
{
vtkVLogF(PARAVIEW_LOG_PLUGIN_VERBOSITY(),
"looking for static plugin since `BUILD_SHARED_LIBS` is OFF -- success!");
return plugin;
}
else
for (auto searchFunction : RegisteredPluginSearchFunctions)
{
vtkVLogF(PARAVIEW_LOG_PLUGIN_VERBOSITY(),
"looking for static plugin since `BUILD_SHARED_LIBS` is OFF -- failed!");
if (searchFunction && searchFunction(plugin))
{
vtkVLogF(PARAVIEW_LOG_PLUGIN_VERBOSITY(), "found plugin linked in statically!");
return plugin;
}
}
}
#endif
const std::string exe_dir = pm->GetSelfDir();
const std::string vtklib = vtkGetLibraryPathForSymbol(GetVTKVersion);
vtkVLogF(PARAVIEW_LOG_PLUGIN_VERBOSITY(), "VTK libraries location is '%s'", vtklib.c_str());
std::vector<std::string> prefixes = {
#if BUILD_SHARED_LIBS
std::string("paraview-" PARAVIEW_VERSION "/plugins/") + plugin,
std::string("paraview-" PARAVIEW_VERSION "/plugins/"),
#else
// for static builds, we need to add "lib"
std::string("lib/paraview-" PARAVIEW_VERSION "/plugins/") + plugin,
std::string("lib/paraview-" PARAVIEW_VERSION "/plugins/"),
#endif
std::string(PARAVIEW_RELATIVE_LIBPATH "/" PARAVIEW_SUBDIR "/") + plugin,
std::string(PARAVIEW_RELATIVE_LIBPATH "/" PARAVIEW_SUBDIR "/"),
// .app bundles
#if defined(__APPLE__)
// needed for Apps
std::string("Plugins/") + plugin,
std::string("Plugins/"),
#elif defined(_WIN32)
std::string("plugins/") + plugin,
std::string("plugins/"),
std::string("../Plugins/") + plugin,
std::string("../Plugins/"),
#endif
std::string()
};
......@@ -146,6 +132,16 @@ std::string vtkLocatePluginOrConfigFile(
vtkNew<vtkPResourceFileLocator> locator;
locator->SetLogVerbosity(PARAVIEW_LOG_PLUGIN_VERBOSITY());
if (hint && *hint)
{
const std::string hintdir = vtksys::SystemTools::GetFilenamePath(hint);
auto path = locator->Locate(hintdir + "/" + plugin, landmark);
if (!path.empty())
{
return path + "/" + landmark;
}
}
// First try the test plugin path, if it exists.
vtkPVOptions* options = pm->GetOptions();
if (options && options->GetTestPluginPath() && strlen(options->GetTestPluginPath()) > 0)
......@@ -158,17 +154,6 @@ std::string vtkLocatePluginOrConfigFile(
}
}
// Now, try the prefixes we so carefully put together.
if (!vtklib.empty())
{
vtkVLogF(PARAVIEW_LOG_PLUGIN_VERBOSITY(), "check various prefixes relative to VTK libraries");
auto pluginpath =
locator->Locate(vtksys::SystemTools::GetFilenamePath(vtklib), prefixes, landmark);
if (!pluginpath.empty())
{
return pluginpath + "/" + landmark;
}
}
if (!exe_dir.empty())
{
vtkVLogF(PARAVIEW_LOG_PLUGIN_VERBOSITY(),
......@@ -227,8 +212,6 @@ public:
}
};
vtkPluginSearchFunction vtkPVPluginTracker::StaticPluginSearchFunction = 0;
vtkStandardNewMacro(vtkPVPluginTracker);
//----------------------------------------------------------------------------
vtkPVPluginTracker::vtkPVPluginTracker()
......@@ -258,32 +241,73 @@ vtkPVPluginTracker* vtkPVPluginTracker::GetInstance()
vtkPVPluginTracker* mgr = vtkPVPluginTracker::New();
Instance = mgr;
mgr->FastDelete();
}
return Instance;
}
vtkVLogF(PARAVIEW_LOG_PLUGIN_VERBOSITY(),
"Locate and load distributed plugin list when creating vtkPVPluginTracker.");
// Locate ".plugins" file and process it.
// This will setup the distributed-list of plugins. Also it will load any
// auto-load plugins.
std::string _plugins =
vtkLocatePluginOrConfigFile(".plugins", false, StaticPluginSearchFunction);
if (!_plugins.empty())
//----------------------------------------------------------------------------
void vtkPVPluginTracker::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
void vtkPVPluginTracker::LoadPluginConfigurationXMLs(const char* appname)
{
if (!appname || !*appname)
{
return;
}
auto pm = vtkProcessModule::GetProcessModule();
if (!pm)
{
return;
}
const std::string exe_dir = pm->GetSelfDir();
if (!exe_dir.empty())
{
#if defined(__APPLE__)
// Try it as a bundle.
{
mgr->LoadPluginConfigurationXML(_plugins.c_str());
auto conf = exe_dir + "/../Resources/" + appname + ".conf";
if (vtksys::SystemTools::FileExists(conf))
{
this->LoadPluginConfigurationXMLConf(exe_dir, conf);
return;
}
}
else
#endif
// Load it from beside the executable.
{
vtkVLogF(
PARAVIEW_LOG_PLUGIN_VERBOSITY(), "Could not find `.plugins` file for distributed plugins.");
auto conf = exe_dir + "/" + appname + ".conf";
if (vtksys::SystemTools::FileExists(conf))
{
this->LoadPluginConfigurationXMLConf(exe_dir, conf);
return;
}
}
}
return Instance;
}
//----------------------------------------------------------------------------
void vtkPVPluginTracker::PrintSelf(ostream& os, vtkIndent indent)
void vtkPVPluginTracker::LoadPluginConfigurationXMLConf(
std::string const& exe_dir, std::string const& conf)
{
this->Superclass::PrintSelf(os, indent);
std::ifstream fin(conf.c_str());
std::string line;
// TODO: Replace with a JSON parser.
while (std::getline(fin, line))
{
if (!vtksys::SystemTools::FileIsFullPath(line))
{
line = exe_dir + "/" + line;
}
this->LoadPluginConfigurationXML(line.c_str(), false);
}
}
//----------------------------------------------------------------------------
......@@ -307,7 +331,7 @@ void vtkPVPluginTracker::LoadPluginConfigurationXML(const char* filename, bool f
}
vtkVLogF(PARAVIEW_LOG_PLUGIN_VERBOSITY(), "Loading plugin configuration xml `%s`.", filename);
this->LoadPluginConfigurationXML(parser->GetRootElement(), forceLoad);
this->LoadPluginConfigurationXMLHinted(parser->GetRootElement(), filename, forceLoad);
}
//----------------------------------------------------------------------------
......@@ -327,6 +351,13 @@ void vtkPVPluginTracker::LoadPluginConfigurationXMLFromString(
//----------------------------------------------------------------------------
void vtkPVPluginTracker::LoadPluginConfigurationXML(vtkPVXMLElement* root, bool forceLoad)
{
this->LoadPluginConfigurationXMLHinted(root, nullptr, forceLoad);
}
//----------------------------------------------------------------------------
void vtkPVPluginTracker::LoadPluginConfigurationXMLHinted(
vtkPVXMLElement* root, char const* hint, bool forceLoad)
{
if (root == NULL)
{
......@@ -364,8 +395,7 @@ void vtkPVPluginTracker::LoadPluginConfigurationXML(vtkPVXMLElement* root, bool
}
else
{
plugin_filename =
vtkLocatePluginOrConfigFile(name.c_str(), true, StaticPluginSearchFunction);
plugin_filename = vtkLocatePluginOrConfigFile(name.c_str(), hint, true);
}
if (plugin_filename.empty())
{
......@@ -374,8 +404,7 @@ void vtkPVPluginTracker::LoadPluginConfigurationXML(vtkPVXMLElement* root, bool
if (required)
{
vtkErrorMacro("Failed to locate required plugin: "
<< name.c_str() << "\n"
"Application may not work exactly as expected.");
<< name << "\nApplication may not work exactly as expected.");
}
vtkVLogF(
PARAVIEW_LOG_PLUGIN_VERBOSITY(), "Failed to locate file plugin `%s`", name.c_str());
......@@ -547,11 +576,18 @@ bool vtkPVPluginTracker::GetPluginAutoLoad(unsigned int index)
return (*this->PluginsList)[index].AutoLoad;
}
//-----------------------------------------------------------------------------
void vtkPVPluginTracker::RegisterStaticPluginSearchFunction(vtkPluginSearchFunction function)
{
RegisteredPluginSearchFunctions.push_back(function);
}
#ifndef VTK_LEGACY_REMOVE
//-----------------------------------------------------------------------------
void vtkPVPluginTracker::SetStaticPluginSearchFunction(vtkPluginSearchFunction function)
{
if (!StaticPluginSearchFunction)
{
StaticPluginSearchFunction = function;
}
VTK_LEGACY_BODY(vtkPVPluginTracker::SetStaticPluginSearchFunction, "ParaView 5.7");
vtkPVPluginTracker::RegisterStaticPluginSearchFunction(function);
}
#endif
......@@ -74,17 +74,18 @@ public:
* form:
* @code
* <Plugins>
* <Plugin name="[plugin name]" filename="[optional file name] auto_load="[bool]" />
* <Plugin name="[plugin name]" filename="[optional file name]" auto_load="[bool]" />
* ...
* </Plugins>
* @endcode
* This method will process the XML, locate the plugin shared library and
* either load the plugin or call RegisterAvailablePlugin based on the status
* of the auto_load flag. auto_load flag is optional and is 0 by default.
* filaname is also optional, if not provided this method will look in
* filename is also optional, if not provided this method will look in
* different place to find the plugin, eg. paraview lib dir. It will NOT look
* in PV_PLUGIN_PATH.
*/
void LoadPluginConfigurationXMLs(const char* appname);
void LoadPluginConfigurationXML(const char* filename, bool forceLoad = false);
void LoadPluginConfigurationXML(vtkPVXMLElement*, bool forceLoad = false);
void LoadPluginConfigurationXMLFromString(const char* xmlcontents, bool forceLoad = false);
......@@ -116,7 +117,10 @@ public:
/**
* Sets the function used to load static plugins.
*/
static void SetStaticPluginSearchFunction(vtkPluginSearchFunction function);
static void RegisterStaticPluginSearchFunction(vtkPluginSearchFunction function);
#ifndef VTK_LEGACY_REMOVE
static VTK_LEGACY(void SetStaticPluginSearchFunction(vtkPluginSearchFunction function));
#endif
protected:
vtkPVPluginTracker();
......@@ -129,7 +133,8 @@ private:
class vtkPluginsList;
vtkPluginsList* PluginsList;
static vtkPluginSearchFunction StaticPluginSearchFunction;
void LoadPluginConfigurationXMLConf(std::string const& exe_dir, std::string const& conf);
void LoadPluginConfigurationXMLHinted(vtkPVXMLElement*, const char* hint, bool forceLoad);
};
#endif
......
......@@ -343,6 +343,16 @@ void vtkImageVolumeRepresentation::UpdateMapperParameters()
// this is necessary since volume mappers don't like empty arrays.
this->Actor->SetVisibility(colorArrayName != NULL && colorArrayName[0] != 0);
if (this->VolumeMapper->GetCropping())
{
double planes[6];
for (int i = 0; i < 6; i++)
{
planes[i] = this->CroppingOrigin[i / 2] + this->DataBounds[i] * this->CroppingScale[i / 2];
}
this->VolumeMapper->SetCroppingRegionPlanes(planes);
}
if (this->Property)
{
if (this->MapScalars)
......@@ -382,6 +392,10 @@ void vtkImageVolumeRepresentation::UpdateMapperParameters()
void vtkImageVolumeRepresentation::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "Cropping Origin: " << this->CroppingOrigin[0] << ", " << this->CroppingOrigin[1]
<< ", " << this->CroppingOrigin[2] << endl;
os << indent << "Cropping Scale: " << this->CroppingScale[0] << ", " << this->CroppingScale[1]
<< ", " << this->CroppingScale[2] << endl;
}
//***************************************************************************
......@@ -509,6 +523,12 @@ void vtkImageVolumeRepresentation::SetShowIsosurfaces(int show)
show ? vtkVolumeMapper::ISOSURFACE_BLEND : vtkVolumeMapper::COMPOSITE_BLEND);
}
//----------------------------------------------------------------------------
void vtkImageVolumeRepresentation::SetCropping(int crop)
{
this->VolumeMapper->SetCropping(crop != 0);
}
//----------------------------------------------------------------------------
void vtkImageVolumeRepresentation::SetIsosurfaceValue(int i, double value)
{
......
......@@ -109,6 +109,23 @@ public:
// Forwarded to vtkSmartVolumeMapper.
void SetRequestedRenderMode(int);
void SetShowIsosurfaces(int);
void SetCropping(int);
//@{
/**
* Get/Set the cropping origin.
*/
vtkSetVector3Macro(CroppingOrigin, double);
vtkGetVector3Macro(CroppingOrigin, double);
//@}
//@{
/**
* Get/Set the cropping scale.
*/
vtkSetVector3Macro(CroppingScale, double);
vtkGetVector3Macro(CroppingScale, double);
//@}
/**
* Provides access to the actor used by this representation.
......@@ -163,7 +180,6 @@ protected:
vtkOutlineSource* OutlineSource;
vtkPolyDataMapper* OutlineMapper;
;
unsigned long DataSize;
double DataBounds[6];
......@@ -178,6 +194,9 @@ protected:
bool MapScalars;
bool MultiComponentsMapping;
double CroppingOrigin[3] = { 0, 0, 0 };
double CroppingScale[3] = { 1, 1, 1 };
private:
vtkImageVolumeRepresentation(const vtkImageVolumeRepresentation&) = delete;
void operator=(const vtkImageVolumeRepresentation&) = delete;
......
......@@ -167,7 +167,7 @@ void vtkXYChartRepresentation::SetSeriesVisibility(const char* seriesname, bool
}
//----------------------------------------------------------------------------
void vtkXYChartRepresentation::SetLineThickness(const char* seriesname, int value)
void vtkXYChartRepresentation::SetLineThickness(const char* seriesname, double value)
{
assert(seriesname != NULL);
this->Internals->LineThicknesses[seriesname] = value;
......@@ -222,6 +222,14 @@ void vtkXYChartRepresentation::SetMarkerStyle(const char* seriesname, int style)
this->Modified();
}
//----------------------------------------------------------------------------
void vtkXYChartRepresentation::SetMarkerSize(const char* seriesname, double value)
{
assert(seriesname != NULL);
this->Internals->MarkerSizes[seriesname] = value;
this->Modified();
}
//----------------------------------------------------------------------------
void vtkXYChartRepresentation::SetLabel(const char* seriesname, const char* label)
{
......@@ -282,6 +290,13 @@ void vtkXYChartRepresentation::ClearMarkerStyles()
this->Modified();
}
//----------------------------------------------------------------------------
void vtkXYChartRepresentation::ClearMarkerSizes()
{
this->Internals->MarkerSizes.clear();
this->Modified();
}
//----------------------------------------------------------------------------
void vtkXYChartRepresentation::ClearLabels()
{
......
......@@ -107,11 +107,12 @@ public:
* Set/Clear the properties for Y series/columns.
*/
void SetSeriesVisibility(const char* seriesname, bool visible);
void SetLineThickness(const char* name, int value);
void SetLineThickness(const char* name, double value);
void SetLineStyle(const char* name, int value);
void SetColor(const char* name, double r, double g, double b);
void SetAxisCorner(const char* name, int corner);
void SetMarkerStyle(const char* name, int style);
void SetMarkerSize(const char* name, double value);
void SetLabel(const char* name, const char* label);
void SetUseColorMapping(const char* name, bool useColorMapping);
void SetLookupTable(const char* name, vtkScalarsToColors* lut);
......@@ -123,6 +124,7 @@ public:
void ClearLineStyles();
void ClearColors();
void ClearAxisCorners();
void ClearMarkerSizes();
void ClearMarkerStyles();
void ClearLabels();
......
......@@ -201,6 +201,7 @@ public:
std::map<std::string, vtkColor3d> Colors;
std::map<std::string, int> AxisCorners;
std::map<std::string, int> MarkerStyles;
std::map<std::string, double> MarkerSizes;
std::map<std::string, std::string> Labels;
std::map<std::string, bool> UseColorMapping;
std::map<std::string, vtkScalarsToColors*> Lut;
......@@ -442,6 +443,8 @@ protected:
{
plotPoints->SetMarkerStyle(this->GetSeriesParameter(self, tableName, columnName, role,
this->MarkerStyles, static_cast<int>(vtkPlotPoints::NONE)));
plotPoints->SetMarkerSize(
this->GetSeriesParameter(self, tableName, columnName, role, this->MarkerSizes, 1.0));
// the vtkValidPointMask array is used by some filters (like plot
// over line) to indicate invalid points. this instructs the line
// plot to not render those points
......
......@@ -21,6 +21,8 @@
#include "vtkSISourceProxy.h"
#include "vtkSMMessage.h"
#include <vtksys/SystemTools.hxx>
#include <assert.h>
#include <string>
#include <vector>
......@@ -161,8 +163,33 @@ bool vtkSIStringVectorProperty::ReadXMLAttributes(vtkSIProxy* proxy, vtkPVXMLEle
}
this->ElementTypes->resize(number_of_elements_per_command, STRING);
element->GetVectorAttribute(
"element_types", number_of_elements_per_command, &(*this->ElementTypes)[0]);
const std::map<std::string, int> elementTypesStrMap = { { std::string("int"), INT },
{ std::string("double"), DOUBLE }, { std::string("str"), STRING } };
// This fails if attributes are strings
// In this case, we treat them by their name
if (!element->GetVectorAttribute(
"element_types", number_of_elements_per_command, &(*this->ElementTypes)[0]) &&
element->GetAttribute("element_types") != nullptr)
{
std::string element_types = element->GetAttribute("element_types");
std::vector<std::string> parts = vtksys::SystemTools::SplitString(element_types, ' ');
if (parts.size() == this->ElementTypes->size())
{
for (std::size_t i = 0; i < parts.size(); ++i)
{
auto element_iter = elementTypesStrMap.find(parts[i]);
if (element_iter == elementTypesStrMap.end())
{
vtkGenericWarningMacro("Element type " << parts[i] << " does not exists");
}
else
{
(*this->ElementTypes)[i] = element_iter->second;
}
}
}
}
vtkVectorOfStrings values;
bool hasDefaultValues = false;
if (number_of_elements > 0)
......
......@@ -59,17 +59,6 @@ vtkSIPVRepresentationProxy::~vtkSIPVRepresentationProxy()
//----------------------------------------------------------------------------
bool vtkSIPVRepresentationProxy::ReadXMLAttributes(vtkPVXMLElement* element)
{
vtkPVCompositeRepresentation* pvrepresentation =
vtkPVCompositeRepresentation::SafeDownCast(this->GetVTKObject());
// Pass on the selection-representation
if (vtkSIProxy* siProxy = this->GetSubSIProxy("SelectionRepresentation"))
{
vtkSelectionRepresentation* selection =
vtkSelectionRepresentation::SafeDownCast(siProxy->GetVTKObject());
pvrepresentation->SetSelectionRepresentation(selection);
}
// Update internal data-structures for the types of representations provided
// by this instance.
......@@ -98,8 +87,11 @@ bool vtkSIPVRepresentationProxy::ReadXMLAttributes(vtkPVXMLElement* element)
}
// Add each of the sub-representations to the composite representation.
pvrepresentation->AddRepresentation(
text, vtkPVDataRepresentation::SafeDownCast(subproxy->GetVTKObject()));
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke << this->GetVTKObject() << "AddRepresentation" << text
<< vtkPVDataRepresentation::SafeDownCast(subproxy->GetVTKObject())
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
//// read optional subtype.
const char* sub_text = child->GetAttribute("subtype");
......@@ -123,8 +115,14 @@ bool vtkSIPVRepresentationProxy::ReadXMLAttributes(vtkPVXMLElement* element)
//----------------------------------------------------------------------------
void vtkSIPVRepresentationProxy::OnVTKObjectModified()
{
vtkCompositeRepresentation* repr = vtkCompositeRepresentation::SafeDownCast(this->GetVTKObject());
const char* key = repr->GetActiveRepresentationKey();
const char* key;
{
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke << this->GetVTKObject() << "GetActiveRepresentationKey"
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
this->Interpreter->GetLastResult().GetArgument(0, 0, &key);
}
vtkInternals::RepresentationProxiesType::iterator iter = key
? this->Internals->RepresentationProxies.find(key)
: this->Internals->RepresentationProxies.end();
......
......@@ -401,7 +401,7 @@ void vtkSMArrayListDomain::Update(vtkSMProperty*)
vtkSMProperty* fieldDataSelection = this->GetRequiredProperty("FieldDataSelection");
vtkSMInputArrayDomain* iad = this->InputDomainName
? vtkSMInputArrayDomain::SafeDownCast(input->GetDomain(this->InputDomainName))
: vtkSMInputArrayDomain::SafeDownCast(input->FindDomain<vtkSMInputArrayDomain>());
: input->FindDomain<vtkSMInputArrayDomain>();
// we use a set so that the list gets sorted as well as helps us
// avoid duplicates esp. when processing two datainformation objects.
......
......@@ -58,7 +58,7 @@ int vtkSMChartUseIndexForAxisDomain::SetDefaultValues(
const char** known_names = vtkSMChartSeriesListDomain::GetKnownSeriesNames();
for (int cc = 0; known_names[cc] != NULL && value != NULL; cc++)
{
if (strcmp(known_names[cc], value) == 0)
if (strstr(value, known_names[cc]) != nullptr)
{
helper2.Set(0);
return 1;
......
......@@ -20,7 +20,7 @@
*
* vtkSMChartUseIndexForAxisDomain extends vtkSMBooleanDomain to add logic to
* pick an appropriate default e.g. UseIndexForXAxis for bar and line charts
* needs to be set to 0 by default, if the XArrayName is one of the known arrays
* needs to be set to 0 by default, if the XArrayName contains one of the known arrays
* such as "bin_extents", "arc_length", and set to 1 otherwise. This class
* encapsulates that logic.
*
......
......@@ -122,7 +122,15 @@ void vtkSMPVRepresentationProxy::SetPropertyModifiedFlag(const char* name, int f
}
else
{
vtkSMPropertyHelper(selectionRepr, "Input").Set(esProxy);
int port = 0;
if (vtkPVXMLElement* hints = selectionRepr->GetHints()
? selectionRepr->GetHints()->FindNestedElementByName("ConnectToPortIndex")
: nullptr)
{
hints->GetScalarAttribute("value", &port);
}
vtkSMPropertyHelper(selectionRepr, "Input").Set(esProxy, port);
selectionRepr->UpdateVTKObjects();
}
}
......
......@@ -409,6 +409,7 @@
<ExposedProperties>
<Property name="PlaceWidget" />
<Property name="Visibility" />
<Property name="DirectionalLine"/>
<Property name="HandlePositions" />
<Property name="HandlePositionsInfo" />
<Property name="Closed" />
......@@ -857,6 +858,12 @@
number_of_elements="1">
<BooleanDomain name="bool" />
</IntVectorProperty>
<IntVectorProperty command="SetDirectionalLine"
default_values="1"
name="DirectionalLine"
number_of_elements="1">
<BooleanDomain name="bool" />