[Paraview-developers] Filter Plugin
Frank TT
frank.tt at einseinself.org
Sun Sep 28 22:28:34 EDT 2014
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;
}
More information about the Paraview-developers
mailing list