2/18/2024 0 Comments Paraview pluginsTypedef boost::property_map_value::type Point_3 Namespace PMP = CGAL::Polygon_mesh_processing VtkStandardNewMacro(vtkIsotropicRemeshingFilter) # include "vtkIsotropicRemeshingFilter.h " Void operator=( const vtkIsotropicRemeshingFilter&) needed but not implemented vtkIsotropicRemeshingFilter( const vtkIsotropicRemeshingFilter&) Private: // Data set by the UI and used by the algorithm double Length int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) Computes the bbox's diagonal length to set the default target edge length. Protected: vtkIsotropicRemeshingFilter() int FillOutputPortInformation( int, vtkInformation *info) override Specifies the type of the output object. Specifies the type of the input objects int FillInputPortInformation( int, vtkInformation *info) override int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override Pipeline functions: // Performs the isotropic remeshing algorithm and fills the output object here. Communicate with the UI vtkSetMacro(Length, double) Prints the values of the specific data void PrintSelf(ostream& os, vtkIndent indent) override VtkTypeMacro(vtkIsotropicRemeshingFilter, vtkGeometryFilter) Public: // VTK requirements static vtkIsotropicRemeshingFilter* New() ![]() # include "vtkGeometryFilter.h " // Inherit from the desired filterĬlass vtkIsotropicRemeshingFilter : public vtkGeometryFilter # define vtkIsotropicRemeshingFilter_h // Gives access to macros for communication with the UI This is where we specify the type of the output object. This is where we specify the type of the object that we expect as input. In our case, we run CGAL's isotropic remeshing algorithm. This is where the input is acquired, the main algorithm is performed, and the output is filled. Before VTK 5, Executeinformation() was the standard, and some algorithms used for the transition have kept it this way, so you should check the documentation of the base class that you have chosen before you write this function, as it might actually never be called. Note: In some algorithms, this function is replaced by ExecuteInformation(). In our case, this is where we compute the default target edge length. This function is called before Update() and provides information that might be needed from the input. In this function, we do all possible light-weight computations, such as computing the bounding box of the input data, for example. For our plugin, this is where the vtkPolyData object that will hold the remeshed data is constructed,Īnd it is not needed because the class vtkGeometryFilter already implements it (it returns an empty vtkPolyData). This function is used to create the output object. In our case, the filter must implement the following methods to interact with the pipeline: In the case of our isotropic remeshing plugin, our input data is a vtkPolyData, and so we derive our filter class from the class vtkGeometryFilter. Most of the time, we want to interact with VTK data structures. A Paraview plugin is the association between a filter of this pipeline and an XML file used to create a UI element. ![]() Now that you have built Paraview, and assuming you already have a ready-to-use version of CGAL (see this helper page otherwise), you are ready to start writing your plugin.Ī few files are expected to make a functional plugin, and this comes from the fact that VTK (the underlying software beneath Paraview) is based on a pipeline that we can roughly describe as follows: a source creates a VTK object, which can then serve as input for a filter, which performs its algorithm when its Update() function is called. To do so, go to the source directory, and run: ![]() Note that if you chose to clone the repository, you will also need to update the submodules. You can either directly download the release 5.6, or clone the repository and check out the tag 5.6. Building Paraview from Sourcesįirst, obtain Paraview's sources from the official repository. Furthermore, this example plugin and tutorial is restricted to versions 5.6 or earlier of Paraview due to a change of API. NOTE: Since a Paraview plugin can only be loaded within the same version of Paraview that it was built with, a developer version of Paraview is required. This repository contains all the necessary source files related to the example plugin such that you can compile, run, and tweak it as you desire. The different steps of the process are illustrated using code from a CGAL plugin that can run CGAL's isotropic remeshing algorithm on a triangle mesh given as a vtkPolyData object. This page is a tutorial detailing the creation of a CGAL plugin for the data analysis and visualization software Paraview.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |