[Paraview] Commands for Source Plugin

Jérôme jerome.velut at gmail.com
Thu Jul 8 08:14:33 EDT 2010


Hi,
First of all, your public virtual function is called 'SetNuberOfXBin'
whereas the XML try to
find SetNumberOfXBins. If this is a copy/paste from your real code, you would
have to check your syntax.

Second, the XML describes an IntegerVectorProperty with 10 elements, thus
I expected to find a function in your VTK class of the form:
   SetNumberOfBins( int, int, int, int, int, int, int, int, int, int );

For clarity purpose (I don't know how mandatory it is), I would then declare
the default values as default_values="1 1 1 1 1 1 1 1 1 1 1".

Really, I don't understand what you are trying to do. Usually, a SetNumberOf...
is described as
                <IntegerVectorProperty name="NumberOfXBins"
                                                   command="SetNumberOfXBins"
                                                   number_of_elements="1"
                                                   default_values="1">
                   <IntRangeDomain name="range" min="0">
                </IntegerVectorProperty>

And your VTK class should implement a public function
    void SetNumberOfXBins( int n );
The better being to use a vtkSetMacro for a basic accessor method. But you may
have some additional processing when setting the value, making vtkSetMacro
unsufficient : in this case, don't forget to call Modified( ) in your
Set method unless
the pipeline won't update accordingly to your expectations.

HTH
Jerome

2010/7/8  <owen.arnold at stfc.ac.uk>:
> As part of a source plugin I am developing, I would like to provide gui
> input parameters. Many of the sources in paraview already provide this, such
> as the Sphere source, which allows properties like radius to be adjusted
> manually.
>
>
>
> I have included the IntegerVectorProperty xml fragment (see below), which I
> believe should enable such an option and have provided a corresponding
> public listener method (also below) on my vtkRebinningSource, which is
> derived from vtkPolyDataAlgorithm. When I select the plugin from the sources
> menu in paraview, I get the error message:
>
>
>
> ERROR: In
> ..\..\Paraview_source\Paraview-3.8.0-RC2\Servers\Commmon\vtkProcessModule.cxx,
> line 1066
>
> ....
>
> : Object type: vtkRebinningSource, could not find requested method:
> "SetNumberOfXBins" or the method was called with incorrect arguments.
>
>
>
> while processing
>
> Message 0 = Invoke
>
> ...
>
>
>
> Presumably, I have not registered the event listening method correctly.
> While this is simple to do in raw vtk, I haven’t found any description of
> how to do this in the paraview documentation. Can anyone provide me with
> guidance of how I might do this for my source plugin?
>
>
>
> Thanks in advance,
>
>
>
> Owen
>
>
>
> <ServerManagerConfiguration>
>
>   <!-- Begin RebinningSource -->
>
>   <ProxyGroup name="sources">
>
>     <SourceProxy name="RebinningSource" class="vtkRebinningSource">
>
>                 <IntegerVectorProperty name="NumberOfXBins"
> command="SetNumberOfXBins" number_of_elements="10" default_values="1">
>
>                 </IntegerVectorProperty>
>
>     </SourceProxy>
>
>   </ProxyGroup>
>
>   <!-- End RebinningSource -->
>
> </ServerManagerConfiguration>
>
>
>
> public:
>
> virtual void SetNuberOfXBins(vtkObject * caller, unsigned long eventId,
> void* callData);
>
>
>
> --
> Scanned by iCritical.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list