### Run Server Manager Remote Connection Example Source: https://github.com/kitware/paraview/blob/master/Examples/CustomApplications/ServerManagerRemoteConnection/README.md To run this example, first start a pvserver. Then, execute the compiled example, providing the server URL using the --url argument. ```bash ./ServerManagerRemoteConnectionExample --url=cs://host:port ``` -------------------------------- ### Basic CMake Setup for ParaView Plugin Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/Autostart/CMakeLists.txt Initializes CMake, sets the project name, and finds the required ParaView package. This is a standard starting point for ParaView plugin development. ```cmake cmake_minimum_required(VERSION 3.8) project(Autostart) find_package(ParaView REQUIRED) ``` -------------------------------- ### Basic CMake Setup for ParaView Project Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/ComplexPluginArchitecture/CMakeLists.txt Initializes CMake version, sets the project name, and finds the ParaView package. This is a standard starting point for ParaView plugin development. ```cmake cmake_minimum_required(VERSION 3.8) project(ComplexPluginArchitecture) ``` ```cmake find_package(ParaView REQUIRED) ``` -------------------------------- ### Install XML Files Source: https://github.com/kitware/paraview/blob/master/Clients/ParaView/CMakeLists.txt Installs the application's XML configuration files to the specified development destination. ```cmake install( FILES ${xmls} DESTINATION "${paraview_xml_destination}" COMPONENT "development") ``` -------------------------------- ### Run Example Binary with Python Script Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/README.md General command to run an example binary with a sample Python script. Ensure ParaView is built with Catalyst and Python support. ```sh ./ ``` -------------------------------- ### Run Developer Setup Script Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/git/develop.md Execute the setup script to prepare the ParaView work tree and create Git aliases. This script configures a 'gitlab' remote pointing to your fork. ```bash ./Utilities/SetupForDevelopment.sh ``` -------------------------------- ### Run CxxFullExample with Sample Script Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/README.md Specific example of running the CxxFullExample binary with its associated Python script for pipeline execution. ```sh ./CxxFullExample/CxxFullExample .../CxxFullExample/SampleScripts/feslicescript.py ``` -------------------------------- ### Install Homebrew and Dependencies on macOS Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Installs Homebrew, sets up environment variables, and installs necessary build dependencies using Homebrew. ```zsh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" ``` ```zsh brew install open-mpi cmake mesa tbb ninja gdal qt5 ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/SMMyProxy/CMakeLists.txt Initializes a CMake project and sets the minimum required version. This is standard for all CMake projects. ```cmake cmake_minimum_required(VERSION 3.8) project(SMMyProxy) ``` -------------------------------- ### Dynamic Pipeline Registration Example Source: https://github.com/kitware/paraview/blob/master/Documentation/release/dev/add-catalyst-dynamic-pipeline-registration.md This YAML example demonstrates how to register and execute pipelines dynamically at execute time. It shows how to select an already registered pipeline and how to register new pipelines on-the-fly with specific arguments. ```yaml catalyst: state: timestep: 100 time: 0.5 pipelines: - "existing_pipe" # already registered, select to run - name: "slice1" # new dynamic registration filename: "slice.py" args: - "--x_cut=0.25" - name: "slice2" # another instance of slice.py filename: "slice.py" args: - "--x_cut=0.75" ``` -------------------------------- ### Install ParaView with Variants and Dependencies using Spack Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Install ParaView with specific build variants and dependencies, such as enabling OSMesa and using MPICH for MPI. This command demonstrates a complex installation scenario. ```bash # install similar to any other spack package # e.g. following command installs osmesa-capable ParaView # with mpich > spack install paraview+osmesa^mesa~glx^mpich ``` -------------------------------- ### Set up Project and Find ParaView Source: https://github.com/kitware/paraview/blob/master/Examples/CustomApplications/Demo1/CMakeLists.txt Initializes the CMake build system and finds the ParaView package. Ensure ParaView is installed and discoverable by CMake. ```cmake cmake_minimum_required(VERSION 3.8) project(Demo1) ``` ```cmake find_package(ParaView REQUIRED) ``` -------------------------------- ### NVPipe Decoding Example Source: https://github.com/kitware/paraview/blob/master/ThirdParty/NvPipe/vtknvpipe/README.md Shows how to create a decoder, receive compressed data, and decode it into an RGB frame. The decoder must be destroyed after use. ```c nvpipe* dec = nvpipe_create_decoder(NVPIPE_H264_NV); size_t width=1920, height=1080; size_t imgsz = width * height * 3; uint8_t* rgb = malloc(imgsz); void* strm = malloc(max_N); while(you_have_more_frames) { uint32_t N = 0; recv(socket, &N, sizeof(uin32_t), ...); recv(socket, strm, from_network_byte_order(N), ...); nvpipe_decode(dec, strm,N, rgb, width, height); use_frame(rgb, width, height); // blit, save; whatever. } nvpipe_destroy(dec); // destroy the decoder when finished ``` -------------------------------- ### Building and Installing the ParaView Plugin Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/Autostart/CMakeLists.txt Builds the ParaView plugin and installs it to the specified runtime and library destinations. This command ensures the plugin is correctly packaged and placed for ParaView to find. ```cmake paraview_plugin_build( RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}" PLUGINS ${plugins}) ``` -------------------------------- ### CentOS Environment Setup Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Sets up environment variables for building ParaView on CentOS 7, aliasing ninja and adding OpenMPI to the PATH. ```bash alias ninja=ninja-build export PATH=$PATH:/usr/lib64/openmpi/bin/ ``` -------------------------------- ### Build Main Executable Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxMultiChannelInputExample/CMakeLists.txt Defines the main executable for the example. It links against the Catalyst adaptor library if available, otherwise it links against MPI. ```cmake add_executable(CxxMultiChannelInputExample FEDataStructures.cxx FEDataStructures.h FEDriver.cxx) if (TARGET CxxMultiChannelInputExampleAdaptor) target_link_libraries(CxxMultiChannelInputExample PRIVATE CxxMultiChannelInputExampleAdaptor VTK::mpi) else () target_link_libraries(CxxMultiChannelInputExample PRIVATE MPI::MPI_C) endif () ``` -------------------------------- ### Define Main Executable Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxOverlappingAMRExample/CMakeLists.txt Defines the main executable for the example and links it with the adaptor library. ```cmake add_executable(CxxOverlappingAMRExample FEDriver.cxx) target_link_libraries(CxxOverlappingAMRExample PRIVATE CxxOverlappingAMRExampleAdaptor) ``` -------------------------------- ### Install Ubuntu/Debian Dependencies Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Installs necessary development tools and libraries for building ParaView on Ubuntu 22.04 LTS or Debian 12. ```bash sudo apt-get install git cmake build-essential libgl1-mesa-dev libxt-dev libqt5x11extras5-dev libqt5help5 qttools5-dev qtxmlpatterns5-dev-tools libqt5svg5-dev python3-dev python3-numpy libopenmpi-dev libtbb-dev ninja-build qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools ``` -------------------------------- ### Start ParaView with Virtual Environment Source: https://github.com/kitware/paraview/blob/master/Plugins/XArrayCFReader/Help.txt Launch ParaView using the specified executable, which will utilize the Python environment you created and configured. ```bash paraview --venv DIR/.venv ``` -------------------------------- ### Install ArchLinux Dependencies Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Installs necessary development tools and libraries for building ParaView on ArchLinux. ```bash sudo pacman -S base-devel ninja openmpi tbb qt python python-numpy cmake ``` -------------------------------- ### XML Plugin Configuration File Example Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/PluginHowto.md Defines plugins to be loaded by ParaView. Supports absolute and relative paths for plugin libraries. ```xml ``` -------------------------------- ### Install NvPipe Library and Headers Source: https://github.com/kitware/paraview/blob/master/ThirdParty/NvPipe/vtknvpipe/CMakeLists.txt Installs the NVPIPE target library, export files, and header files to their designated locations based on CMake installation prefixes and components. ```cmake install(TARGETS ${NVPIPE} EXPORT nvpipeTargets DESTINATION ${NvPipe_PREFIX} LIBRARY DESTINATION lib COMPONENT shlib ) install(FILES ${PROJECT_SOURCE_DIR}/nvpipe.h ${PROJECT_SOURCE_DIR}/mangle_nvpipe.h ${PROJECT_BINARY_DIR}/config.nvp.h DESTINATION include ) install(FILES "${project_config}" DESTINATION lib/cmake/${NVPIPE}) install(EXPORT nvpipeTargets DESTINATION lib/cmake/${NVPIPE} COMPONENT dev) install(EXPORT nvpipeTargets DESTINATION lib/cmake/${NVPIPE}) ``` -------------------------------- ### Install AppData XML for Linux Source: https://github.com/kitware/paraview/blob/master/Clients/ParaView/CMakeLists.txt Installs the AppData XML file for ParaView, providing metadata for desktop environments on Linux. ```cmake install( FILES org.paraview.ParaView.appdata.xml DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo" COMPONENT runtime) endif () ``` -------------------------------- ### Install Ubuntu/Debian Dependencies (Older) Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Installs necessary development tools and libraries for building ParaView on Ubuntu 18.04 LTS or Debian 10. ```bash sudo apt-get install git cmake build-essential libgl1-mesa-dev libxt-dev qt5-default libqt5x11extras5-dev libqt5help5 qttools5-dev qtxmlpatterns5-dev-tools libqt5svg5-dev python3-dev python3-numpy libopenmpi-dev libtbb-dev ninja-build ``` -------------------------------- ### Install Xarray and Dependencies Source: https://github.com/kitware/paraview/blob/master/Plugins/XArrayCFReader/Help.txt Install the necessary Python packages, including xarray and its dependencies, into the activated virtual environment. Ensure package versions match those used by ParaView. ```bash source .venv/bin/activate uv pip install xarray cftime cfgrib zarr h5netcdf "numpy==1.26.4" "pandas==2.0.3" "netcdf4==1.6.5" deactivate ``` -------------------------------- ### Install Application Icons for Linux Source: https://github.com/kitware/paraview/blob/master/Clients/ParaView/CMakeLists.txt Installs ParaView application icons in various standard sizes for Linux desktop environments. ```cmake foreach (iconsize IN ITEMS 22x22 32x32 96x96) install( FILES "pvIcon-${iconsize}.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${iconsize}/apps" RENAME paraview.png COMPONENT runtime) endforeach () ``` -------------------------------- ### NVPipe Encoding Example Source: https://github.com/kitware/paraview/blob/master/ThirdParty/NvPipe/vtknvpipe/README.md Demonstrates how to create an encoder, encode frames, and send compressed data over a socket. Ensure the encoder is destroyed when finished. ```c const size_t width=..., height=...; // input image size. const uint8_t* rgba = ...; // your image data. size_t osize = ...; // number of bytes in 'output'. void* output = malloc(max_osize); // place for the compressed stream. // First create our encoder. const size_t f_m = 4; // "quality". Generally in [1,5]. const size_t fps = 30; const uint64_t bitrate = width*height * fps*f_m*0.07; nvpipe* enc = nvpipe_create_encoder(NVPIPE_H264_NV, bitrate); while(you_have_more_frames) { nvpipe_encode(enc, rgba, width*height*4, output,&osize, width, height, NVPIPE_RGBA); // Send the frame size and compressed stream to the consuming side. uint32_t size = to_network_byte_order_zu(osize); send(socket, &size, sizeof(uint32_t), ...); send(socket, output, osize, ...); } // Be sure to destroy the encoder when done. nvpipe_destroy(enc); ``` -------------------------------- ### Build and Install Gmsh Library Source: https://github.com/kitware/paraview/blob/master/Plugins/GmshReader/README.md After configuring Gmsh with CMake, build and install the library using 'make'. The '-j 8' flag can be adjusted based on your system's core count for faster compilation. ```bash make -j 8 install ``` -------------------------------- ### Complete Plugin Configuration XML Schema Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/PluginHowto.md This is a comprehensive example of a plugin configuration file, illustrating the structure for defining plugins, their filenames, loading behavior, and associated XML files for delayed loading. ```xml ``` -------------------------------- ### Basic CMake Setup for PropertyWidgets Plugin Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/PropertyWidgets/CMakeLists.txt Configures the minimum CMake version, project name, and finds the ParaView package. Sets build options for shared libraries and enables testing. ```cmake cmake_minimum_required(VERSION 3.8) project(PropertyWidgets) find_package(ParaView REQUIRED) option(BUILD_SHARED_LIBS "Build shared libraries" ON) enable_testing() ``` -------------------------------- ### Basic CMake Configuration for ParaView Plugin Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/AddPQProxy/CMakeLists.txt Sets up the minimum CMake version, project name, and finds the ParaView package. This is the foundational setup for any ParaView plugin. ```cmake cmake_minimum_required(VERSION 3.12) project(AddPQProxy) ``` ```cmake find_package(ParaView REQUIRED) ``` -------------------------------- ### ParaView Internal .plugins File Example Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/PluginHowto.md Configures plugins for ParaView, specifying whether they should be auto-loaded. This file is used by the Plugin Manager. ```xml ``` -------------------------------- ### Basic CMakeLists.txt for ParaView Plugin Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/PluginHowto.md This is the starting code for a CMakeLists.txt file when developing a ParaView plugin. It sets up the necessary build environment. ```cmake cmake( ) ``` -------------------------------- ### Basic Catalyst Python Script Setup Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/CatalystPythonScriptV2.md This is a basic Python script that can be used with Catalyst. It sets up a visualization pipeline and uses `registrationName` to link data producers to simulation channels. ```python print_info("end '%s'", __name__) ``` -------------------------------- ### Basic CMake Configuration for ParaView Plugin Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/ContextMenu/CMakeLists.txt Sets up the minimum CMake version, project name, and finds the ParaView package. This is the foundational setup for any ParaView plugin project. ```cmake cmake_minimum_required(VERSION 3.12) project(ContextMenu) ``` ```cmake find_package(ParaView REQUIRED) ``` -------------------------------- ### Create Wavelet Source and Slice Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/CatalystPythonScriptV2.md This script demonstrates creating a Wavelet source and applying a Slice filter using the paraview.simple API. It's a basic example of defining a visualization pipeline. ```python # filename: sample1.py from paraview.simple import * from paraview import print_info # print start marker print_info("begin '%s'", __name__) wavelet1 = Wavelet(registrationName='Wavelet1') # create a new 'Slice' slice1 = Slice(registrationName='Slice1', Input=wavelet1) slice1.SliceType = 'Plane' slice1.SliceType.Normal = [0, 0, 1] ``` -------------------------------- ### Build Caching Example Executable CMake Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/TemporalCacheExample/CMakeLists.txt Defines the CachingExample executable. It links against the CachingExampleAdaptor library if it was built, otherwise, it finds ParaView and links necessary VTK and MPI components. ```cmake if (TARGET CachingExampleAdaptor) add_executable(CachingExample FEDriver.cxx) target_link_libraries(CachingExample PRIVATE CachingExampleAdaptor VTK::mpi) else () find_package(ParaView REQUIRED) add_executable(CachingExample FEDriver.cxx FEDataStructures.cxx FEDataStructures.h) target_link_libraries(CachingExample PRIVATE VTK::CommonSystem VTK::CommonCore MPI::MPI_C) target_compile_definitions(CachingExample PUBLIC ${mpi_definitions}) endif () ``` -------------------------------- ### Install ParaView using Spack Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md This command installs ParaView using Spack. Refer to Spack documentation for customizing the installation with specific versions or variants. ```bash spack install paraview ``` -------------------------------- ### Configure Main Executable and Link Libraries Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CFullExample/CMakeLists.txt Builds the CFullExample executable and links it with the adaptor library if available, otherwise links directly with MPI. ```cmake add_executable(CFullExample FEDataStructures.c FEDataStructures.h FEDriver.c) if (TARGET CFullExampleAdaptor) target_link_libraries(CFullExample PRIVATE CFullExampleAdaptor VTK::mpi) else () target_link_libraries(CFullExample PRIVATE MPI::MPI_C) endif () ``` -------------------------------- ### Build Main Executable (with Catalyst Adaptor) Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxVTKPipelineExample/CMakeLists.txt Creates the main executable CxxVTKPipelineExample and links it with the Catalyst adaptor library and necessary VTK components. This path is taken when the CxxVTKPipelineExampleAdaptor target exists. ```cmake if (TARGET CxxVTKPipelineExampleAdaptor) add_executable(CxxVTKPipelineExample FEDriver.cxx) target_link_libraries(CxxVTKPipelineExample PRIVATE CxxVTKPipelineExampleAdaptor VTK::mpi VTK::CommonCore) else () add_executable(CxxVTKPipelineExample FEDriver.cxx FEDataStructures.cxx FEDataStructures.h) target_link_libraries(CxxVTKPipelineExample PRIVATE MPI::MPI_C VTK::CommonCore) target_compile_definitions(CxxVTKPipelineExample PUBLIC ${mpi_definitions}) endif () ``` -------------------------------- ### Configure Demo0 Application Build Source: https://github.com/kitware/paraview/blob/master/Examples/CustomApplications/Demo0/CMakeLists.txt This snippet sets up the build for the DemoApp0 executable, linking it with Paraview core libraries and Qt Widgets. Ensure Paraview is built with PARAVIEW_USE_QT enabled. ```cmake cmake_minimum_required(VERSION 3.8) project(Demo0) find_package(ParaView REQUIRED) if (NOT PARAVIEW_USE_QT) message(STATUS "Skipping example: ${PROJECT_NAME} example requires PARAVIEW_USE_QT " "to be enabled. Please rebuild ParaView (or point to a different build of " "Paraview) with PARAVIEW_USE_QT set to TRUE") return () endif() include(GNUInstallDirs) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") find_package("Qt${PARAVIEW_QT_MAJOR_VERSION}" REQUIRED COMPONENTS Widgets) add_executable(DemoApp0 DemoApp0.cxx) target_link_libraries(DemoApp0 PRIVATE ParaView::pqCore "Qt${PARAVIEW_QT_MAJOR_VERSION}::Widgets") ``` -------------------------------- ### Python Module Copying and Installation Source: https://github.com/kitware/paraview/blob/master/Plugins/ParFlow/CMakeLists.txt Handles copying Python modules to the binary directory and installing them, with conditional arguments for CMake version compatibility. ```cmake if (PARAVIEW_USE_PYTHON) set(_paraview_python_depends_args) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.27") list(APPEND _paraview_python_depends_args DEPENDS_EXPLICIT_ONLY) endif () set(python_copied_modules) foreach (python_file IN LISTS python_modules) set(output_python_file "${CMAKE_BINARY_DIR}/${PARAVIEW_PYTHON_SITE_PACKAGES_SUFFIX}/${python_file}") add_custom_command( OUTPUT "${output_python_file}" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${python_file}" COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/${python_file}" "${output_python_file}" COMMENT "Copying ${python_file} to the binary directory" ${_paraview_python_depends_args}) get_filename_component(python_file_directory "${python_file}" DIRECTORY) install( FILES "${python_file}" DESTINATION "${PARAVIEW_PYTHON_SITE_PACKAGES_SUFFIX}/${python_file_directory}" COMPONENT "python" ) list(APPEND python_copied_modules "${output_python_file}") endforeach () add_custom_target(parflow_python_copy ALL DEPENDS ${python_copied_modules} ) endif() ``` -------------------------------- ### Install CentOS Dependencies Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Installs necessary development tools and libraries for building ParaView on CentOS 7. CMake version 3.12 or higher is required. ```bash sudo yum install python3-devel openmpi-devel mesa-libGL-devel libX11-devel libXt-devel qt5-qtbase-devel qt5-qtx11extras-devel qt5-qttools-devel qt5-qtxmlpatterns-devel tbb-devel ninja-build git ``` -------------------------------- ### Build Catalyst Caching Example Adaptor Library CMake Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/TemporalCacheExample/CMakeLists.txt Conditionally builds the CachingExampleAdaptor library if USE_CATALYST is enabled. This library provides the core functionality for the Catalyst example. ```cmake if (USE_CATALYST) add_library(CachingExampleAdaptor FEAdaptor.cxx FEAdaptor.h FEDataStructures.cxx FEDataStructures.h) target_link_libraries(CachingExampleAdaptor INTERFACE VTK::PythonUsed PUBLIC ParaView::PythonCatalyst ParaView::RemotingServerManager VTK::CommonCore VTK::CommonDataModel VTK::CommonSystem VTK::FiltersGeneral VTK::FiltersHybrid VTK::IOXML MPI::MPI_C) target_compile_definitions(CachingExampleAdaptor PUBLIC ${mpi_definitions}) endif () ``` -------------------------------- ### Displaying wavelet_miniapp help message Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/CatalystPythonScriptV2.md View the command-line options for the wavelet_miniapp by running it with the --help flag. This shows available arguments for customization. ```bash > ./bin/pvbatch -m paraview.demos.wavelet_miniapp --help ``` -------------------------------- ### Configure PythonQt Build with CMake Source: https://github.com/kitware/paraview/blob/master/Plugins/PythonQtPlugin/README.md Create a build directory and configure the PythonQt build using CMake. Recommended settings are provided for building shared libraries and wrapping specific Qt modules. ```bash mkdir build cd build cmake ../PythonQt ``` -------------------------------- ### Add Test to Start DataProber Server Source: https://github.com/kitware/paraview/blob/master/Web/Python/Testing/CMakeLists.txt Configures a CTest to start the DataProber server using 'pvpython'. This test is conditional on the 'wslink' module being found. It specifies the port, host, and a timeout for the server process. ```cmake if (wslink_found) add_test(NAME pvweb-StartTest COMMAND "$" -m paraview.web.test_server --port 9739 --host 0.0.0.0 --timeout 1) endif () ``` -------------------------------- ### Configure and Build ParaView on Windows Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Configures the ParaView build using CMake with Ninja and then compiles the project. Assumes VS2019 x64 Native Tools Command Prompt is used. ```sh cd C:\pv\pvb cmake -GNinja -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_SMP_IMPLEMENTATION_TYPE=STDThread -DCMAKE_BUILD_TYPE=Release ..\pv ninja ``` -------------------------------- ### Example Merge Request Title Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/git/develop.md A concise one-line summary for a merge request title. ```text Wrapping: Add Java 1.x support ``` -------------------------------- ### Prepare Style Arguments Source: https://github.com/kitware/paraview/blob/master/Clients/ParaView/CMakeLists.txt Prepares arguments for setting the default GUI style if one is defined. ```cmake set(style_args) if (default_style) list(APPEND style_args DEFAULT_STYLE "${default_style}") endif () ``` -------------------------------- ### C++ Code Formatting - Braces Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/git/guidelines.md Example of correct brace placement for code blocks. ```c++ if () { ...; } ``` -------------------------------- ### Build Main Executable (without Catalyst Adaptor) Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxVTKPipelineExample/CMakeLists.txt Creates the main executable CxxVTKPipelineExample and links it with MPI and VTK components. This path is taken when the CxxVTKPipelineExampleAdaptor target does not exist, typically when USE_CATALYST is false. ```cmake else () add_executable(CxxVTKPipelineExample FEDriver.cxx FEDataStructures.cxx FEDataStructures.h) target_link_libraries(CxxVTKPipelineExample PRIVATE MPI::MPI_C VTK::CommonCore) target_compile_definitions(CxxVTKPipelineExample PUBLIC ${mpi_definitions}) ``` -------------------------------- ### Set XML Destination Path Source: https://github.com/kitware/paraview/blob/master/Clients/ParaView/CMakeLists.txt Defines the installation path for XML files, including a version suffix. ```cmake set(paraview_xml_destination "${CMAKE_INSTALL_DATAROOTDIR}/paraview${paraview_version_suffix}/xmls") ``` -------------------------------- ### Conditional Build Check Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/MPISubCommunicatorExample/CMakeLists.txt Skips the build if USE_CATALYST is not defined. Ensures the example is only built when Catalyst support is enabled. ```cmake if (NOT USE_CATALYST) message(STATUS "Skipping MPISubCommunicatorExample because `USE_CATALYST` is not set.") return () endif () ``` -------------------------------- ### Define CxxGhostCellsExample Executable Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxGhostCellsExample/CMakeLists.txt Defines the CxxGhostCellsExample executable and lists its source files. This is the main target for the C++ example. ```cmake add_executable(CxxGhostCellsExample FEDataStructures.cxx FEDataStructures.h FEDriver.cxx) ``` -------------------------------- ### Initialize Viewer and Sliders Source: https://github.com/kitware/paraview/blob/master/ThirdParty/cinemasci/paraview/tpl/cinemasci/viewers/cinema_simple.html Sets up the image size slider and creates interactive sliders for each data key. Updates the query and displayed images when slider values change. ```javascript function doneLoading(results, values) { var imageSizeSlider = d3.select("#imageSize") .property("value", (100/dataSets.length)-1) .on("input", function() { images.forEach(function(item, index) { item.img.style("width","" + imageSizeSlider.node().value + "%"); item.img.attr("height", null); }); }); dataResults = results; dataValues = values; var keys = Object.keys(values); keys.forEach(function(key, index) { var sliderDiv = d3.select("#sliderContainer").append("div"); sliderDiv.append("div") .html(key) .style("padding", "5px"); var slider = sliderDiv.append("div") .append("input") .attr("type","range") .attr("min", "0") .attr("max", values[key].length - 1) .property("value", "0") .style("float", "left"); var sliderText = sliderDiv.append("input") .attr("type","text") .attr("value", values[key][0]) .style("width", "40px") .on("input", function() { query[key] = this.value; var index = values[key].indexOf(this.value); slider.property("value", index); updateResults(); }); slider.on("input", function() { var val = values[key][+this.value]; sliderText.property("value", val); query[key] = val; updateResults(); }); query[key] = values[key][0]; }); dataResults.forEach(function(result, index) { var imgSrcKey = getLookupKey(result.keys, query); var img = d3.select("#imageArea").append("img") .attr("class", "cinemaImage") .attr("src", EMPTY_IMAGE_PATH) .style("width","" + imageSizeSlider.node().value + "%") .on("load", function() { if (this.src != EMPTY_IMAGE_PATH) { images[index].height = this.height; } }) .on("error", function() { this.src=EMPTY_IMAGE_PATH; this.height = images[index].height; }); images.push({img: img}); if (imgSrcKey in result.lookup) { var imgSrc = dataSets[index] + "/" + result.lookup[imgSrcKey]["FILE"]; images[index].img.attr("src", imgSrc); } else { images[index].img.attr("src", EMPTY_IMAGE_PATH); } }); } ``` -------------------------------- ### Define Plugin Modules Source: https://github.com/kitware/paraview/blob/master/Plugins/LegacyGhostCellsGenerator/CMakeLists.txt Defines the core modules for the LegacyGhostCellsGenerator plugin. This is a standard CMakeLists.txt setup for ParaView plugins. ```cmake set(modules LegacyGhostCellsGeneratorFilters) set(module_files "${CMAKE_CURRENT_SOURCE_DIR}/Filters/vtk.module") ``` -------------------------------- ### Build Main Executable (without Adaptor) Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxPVSMPipelineExample/CMakeLists.txt Builds the CxxPVSMPipelineExample executable when the Catalyst adaptor library is not available. This path is taken if USE_CATALYST is not defined or fails. ```cmake else () add_executable(CxxPVSMPipelineExample FEDriver.cxx FEDataStructures.cxx FEDataStructures.h) target_link_libraries(CxxPVSMPipelineExample PRIVATE MPI::MPI_C) target_compile_definitions(CxxPVSMPipelineExample PUBLIC ${mpi_definitions}) endif () ``` -------------------------------- ### Find Qt Package Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/DockWidgetCustomProxy/Plugin/ParaViewPlugin/CMakeLists.txt Finds the required Qt package for the plugin. Ensure Qt is installed and configured correctly for CMake. ```cmake find_package("Qt${PARAVIEW_QT_MAJOR_VERSION}" REQUIRED COMPONENTS Widgets) ``` -------------------------------- ### Show Proxy Documentation in Panel Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/ProxyHints.md Controls which part of the proxy's documentation is displayed in a panel. Use 'description' for the default, 'short_help', or 'long_help'. ```xml Some text that will be shown in the label. ... ``` -------------------------------- ### Streamlined Pipeline Creation and Rendering Source: https://github.com/kitware/paraview/blob/master/Utilities/Sphinx/config/quick-start.rst Create a cone, apply a shrink filter, show it, and render using the active object and simplified paraview.simple functions. Imports are included. ```pycon >>> from paraview.simple import * # Create a cone and assign it as the active object >>> Cone() # Set a property of the active object >>> SetProperties(Resolution=32) # Apply the shrink filter to the active object # Shrink is now active >>> Shrink() # Show shrink >>> Show() # Render the active view >>> Render() ``` -------------------------------- ### Conditional Build Check for Catalyst Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxGhostCellsExample/CMakeLists.txt This snippet checks if `USE_CATALYST` is defined. If not, it prints a message and skips the rest of the configuration for this example. ```cmake if (NOT USE_CATALYST) message(STATUS "Skipping CxxHyperTreeGridExample because `USE_CATALYST` is not set.") return () endif () ``` -------------------------------- ### Build and Run Tests Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/git/develop.md After configuring the build, compile the project and run tests using `ctest`. The `-VV` flag provides verbose output, and `-R` filters tests by name. ```bash cmake . && cmake --build . ctest -VV -R yourTest ``` -------------------------------- ### Build Main Executable (with Adaptor) Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxPVSMPipelineExample/CMakeLists.txt Builds the CxxPVSMPipelineExample executable, linking against the adaptor library if it was successfully built. This is the primary executable when Catalyst is enabled. ```cmake if (TARGET CxxPVSMPipelineExampleAdaptor) add_executable(CxxPVSMPipelineExample FEDriver.cxx) target_link_libraries(CxxPVSMPipelineExample PRIVATE CxxPVSMPipelineExampleAdaptor VTK::mpi) else () add_executable(CxxPVSMPipelineExample FEDriver.cxx FEDataStructures.cxx FEDataStructures.h) target_link_libraries(CxxPVSMPipelineExample PRIVATE MPI::MPI_C) target_compile_definitions(CxxPVSMPipelineExample PUBLIC ${mpi_definitions}) endif () ``` -------------------------------- ### Configure and Build ParaView Source: https://github.com/kitware/paraview/blob/master/Documentation/dev/build.md Create a build directory and configure the build using CMake. The Ninja generator is recommended for faster builds. This command assumes you are in the 'build' directory. ```sh mkdir -p paraview/build cd paraview/build ccmake ../path/to/paraview/source # -GNinja may be added to use the Ninja generator ``` -------------------------------- ### Add Client Tests for Autostart Plugin Source: https://github.com/kitware/paraview/blob/master/Examples/Plugins/Autostart/Plugin/Testing/CMakeLists.txt Use this CMake command to add client-side tests for a plugin. Specify the plugin name, its path, and the test scripts to execute. ```cmake if (TARGET ParaView::paraview) set (TestAutostart_USES_DIRECT_DATA ON) paraview_add_client_tests( LOAD_PLUGIN Autostart PLUGIN_PATH $ TEST_SCRIPTS TestAutostart.xml) endif() ``` -------------------------------- ### Conditional Build for Qt Support Source: https://github.com/kitware/paraview/blob/master/Examples/CustomApplications/Demo1/CMakeLists.txt Checks if ParaView was built with Qt support. If not, it prints a message and exits the build configuration for this example. ```cmake if (NOT PARAVIEW_USE_QT) message(STATUS "Skipping example: ${PROJECT_NAME} example requires PARAVIEW_USE_QT " "to be enabled. Please rebuild ParaView (or point to a different build of " "ParaView) with PARAVIEW_USE_QT set to TRUE") return () endif() ``` -------------------------------- ### Add Test Case Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxVTKPipelineExample/CMakeLists.txt Configures a test case for the CxxVTKPipelineExample if testing is enabled. This allows for automated verification of the example's functionality. ```cmake if (BUILD_TESTING) add_test(NAME CxxVTKPipelineExampleTest COMMAND CxxVTKPipelineExample 10 output) endif() ``` -------------------------------- ### Define CxxSOADataArrayExample Executable Source: https://github.com/kitware/paraview/blob/master/Examples/Catalyst/CxxSOADataArrayExample/CMakeLists.txt Defines the main CxxSOADataArrayExample executable. It links against the CxxSOADataArrayExampleAdaptor library if it exists, otherwise it links against MPI. ```cmake add_executable(CxxSOADataArrayExample FEDataStructures.cxx FEDataStructures.h FEDriver.cxx) if (TARGET CxxSOADataArrayExampleAdaptor) target_link_libraries(CxxSOADataArrayExample PRIVATE CxxSOADataArrayExampleAdaptor VTK::mpi) else () target_link_libraries(CxxSOADataArrayExample PRIVATE MPI::MPI_C) endif () ``` -------------------------------- ### File Driver MiniApp Help Source: https://github.com/kitware/paraview/blob/master/Utilities/Doxygen/pages/CatalystPythonScriptV2.md Displays the help message for the `filedriver_miniapp`, outlining its command-line arguments for Catalyst script execution and file globbing. ```bash > ./bin/pvbatch -m paraview.demos.filedriver_miniapp --help usage: filedriver_miniapp.py [-h] -s SCRIPT [--script-version SCRIPT_VERSION] [-d DELAY] [-c CHANNEL] -g GLOB File-based MiniApp for Catalyst testing optional arguments: -h, --help show this help message and exit -s SCRIPT, --script SCRIPT path(s) to the Catalyst script(s) to use for in situ processing. Can be a .py file or a Python package zip or directory --script-version SCRIPT_VERSION choose Catalyst analysis script version explicitly, otherwise it will be determined automatically. When specifying multiple scripts, this setting applies to all scripts. -d DELAY, --delay DELAY delay (in seconds) between timesteps (default: 0.0) -c CHANNEL, --channel CHANNEL Catalyst channel name (default: input) -g GLOB, --glob GLOB Pattern to use to locate input filenames. ```