[Paraview-developers] Filter Plugin
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Mon Sep 29 08:37:22 EDT 2014
Frank,
ParaView is based on VTK, and relies on VTK to provide the execution
model and data model. Thus, when writing you a new data processing
filter, you're basically going to wrote a VTK filter. The ParaView
plugin infrastructure comes into play to make such a VTK filter
available/accessible in ParaView.
I'd suggesting starting with a existing VTK filter that closely
matches what you're doing e.g. vtkMarchingCubes [1].
[1] http://www.vtk.org/doc/nightly/html/classvtkImageMarchingCubes.html
On Sun, Sep 28, 2014 at 10:28 PM, Frank TT <frank.tt at einseinself.org> wrote:
> Hi,
>
>
> I want to write my own filter plugin.
>
> I'm i little confused, how to do. I read already the 'how to'[1], had a
> look at the example plugins and the PV plugins and searched the ML
> archive.
>
> I'm trying to implement a algorithm that works on loaded volume data and
> creates a suface data. What I wrote below [2].
>
> Now I'm not sure how to access the marked data set from the pipeline
> browser, manipulate the data and then write the new output (with load
> and display).
>
> Can anyone give me some hints? Or is there a plugin I have to see?
>
>
> Greetings
> Frank
>
>
> ### ### ### ### ### ### ###
> //marchingCubes.h
>
> #ifndef __marchingCubes_h
> #define __marchingCubes_h
>
> //#include <vtkSmartPointer.h>
> #include <vtkImageData.h>
>
>
> #include "vtkElevationFilter.h"
> //#include "vtkImageAlgorithm.h"
> //#include "vtkAlgorithm.h"
>
> class VTK_EXPORT marchingCubes : public vtkElevationFilter
> {
> public:
> static marchingCubes* New();
> vtkTypeMacro(marchingCubes, vtkElevationFilter);
> void PrintSelf(ostream& os, vtkIndent indent);
>
> protected:
> marchingCubes();
> ~marchingCubes();
>
> void setIsoValue(double isoValue);
> virtual void Execute();
>
> private:
> marchingCubes(const marchingCubes&); // Not implemented.
> void operator=(const marchingCubes&); // Not implemented.
> double isoValue;
> };
>
> #endif
>
> [1] www.paraview.org/Wiki/ParaView/Plugin_HowTo
>
> [2]
> ### ### ### ### ### ### ###
> //marchingCubes.h
>
> #ifndef __marchingCubes_h
> #define __marchingCubes_h
>
> #include "vtkElevationFilter.h"
> //#include "vtkImageAlgorithm.h"
> //#include "vtkAlgorithm.h"
>
> class VTK_EXPORT marchingCubes : public vtkElevationFilter
> {
> public:
> static marchingCubes* New();
> vtkTypeMacro(marchingCubes, vtkElevationFilter);
> void PrintSelf(ostream& os, vtkIndent indent);
>
> void setIsoValue(double pFromGUI);
>
> protected:
> marchingCubes();
> ~marchingCubes();
>
> private:
> marchingCubes(const marchingCubes&); // Not implemented.
> void operator=(const marchingCubes&); // Not implemented.
> };
>
> #endif
>
> ### ### ### ### ### ### ###
> //marchingCubes.cxx
>
> #include "marchingCubes.h"
>
> #include "vtkObjectFactory.h"
> #include <iostream>
>
> vtkStandardNewMacro(marchingCubes);
>
> //----------------------------------------------------------------------------
> marchingCubes::marchingCubes()
> {
> }
>
> //----------------------------------------------------------------------------
> marchingCubes::~marchingCubes()
> {
> }
>
> //----------------------------------------------------------------------------
> void marchingCubes::PrintSelf(ostream& os, vtkIndent indent)
> {
> this->Superclass::PrintSelf(os,indent);
> }
>
> //----------------------------------------------------------------------------
> // From server manager xml file. Does no output to console.
> void marchingCubes::setIsoValue(double isoValue)
> {
> std:cout<<"iso value:" << (char)isoValue;
> }
>
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
More information about the Paraview-developers
mailing list