[Paraview-developers] apply a filter to only a selected block

Felipe Bordeu felipe.bordeu at ec-nantes.fr
Wed Aug 27 10:03:48 EDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm writing a filter to apply a filter(for example a cut, or clip ) to
only a selected block of a vtkMultiBlockData.

So I start reading the implementation of the vtkExtractBlock and
vtkPVGlyphFilter (because I what to select interactively the filter to
apply in the same way we can choose the type of glyph).

Now the problematic point. This is the  part of the xml to select the
filter to apply (in the same way as the glyph filter) :


<InputProperty command="SetalgoToApply"
               label="Filter To Apply"
                name="Source">

    <ProxyGroupDomain name="groups">
        <Group name="filters" />
    </ProxyGroupDomain>

    <DataTypeDomain name="input_type" composite_data_supported="1">
        <DataType value="vtkDataObject" />
    </DataTypeDomain>

    <ProxyListDomain name="proxy_list">
        <Proxy group="filters" name="Cut" />
        <!-- More filter here -->
    </ProxyListDomain>
</InputProperty>

The interface is generated correctly in paraview.
In the code a receive the algorithm with this function

vtkfiltertest::vtkSetMacro(algoToApply, vtkAlgorithmOutput*);


But I don't know how to set the input to the algorithm.

I tried this (vtkDataSet* tmpinput  is a pointer to some data, )

void vtkfiltertest::SetalgoToApply (vtkAlgorithmOutput* _arg) {
   if (this->algoToApply != _arg) {
     this->algoToApply = _arg;
     this->algoToApply->GetProducer()->SetInputDataObject(0,tmpinput);
     this->Modified();
   }
}

and also in
vtkfiltertest::RequestInformation(){
...
this->algoToApply->GetProducer()->SetInputDataObject(0,tmpinput);
..
}

but in paraview when I create the vtkfiltertest (click in the menu) I
get this:

ERROR: In
/Big/fbordeu/sources/ParaView4/VTK/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx,
line 710
vtkPVCompositeDataPipeline (0x7845e80): Input port 0 of algorithm
vtkPVMetaSliceDataSet(0x783d880) has 0 connections but is not optional.

Is this possible of I'm asking to much???

Thanks.
- -- 
Felipe Bordeu Weldt
Ingénieur de Recherche
- -------------------------------------
Tél. : 33 (0)2 40 37 16 57
Fax. : 33 (0)2 40 74 74 06
Felipe.Bordeu at ec-nantes.fr
Institut GeM - UMR CNRS 6183
École Centrale Nantes
1 Rue de La Noë, 44321 Nantes, FRANCE
- -------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJT/eUzAAoJEE/fMfNgU9/DW1MH/2Fe2fW+7lgISDrO5o5DTnRV
koyJmwSXu+Bx4JRmSLlwIZRUTQ1AfFNE/YGnPZi2db8jmoWrgEs4RS/xwS1873zj
cDRD9NX44PRYS4p4IBYmDmmAucny8IaeB9sDBLhsC0SxJNHiaIzJxYlFvprxZh8h
saRXjR0J3sUp3vGDCKrPui9JfOpZ/IT70hpKI4WPg71TiAftEiuc9wQtPZIbNawE
nzR4ZudhdHG0LY3ipCy0/faTuPkdgqmuXKtsLxIhfQHyKHjhXluw7iKvsg02Wal+
bpA1XvaIJq9tlagXBEHhpN+KnO3yERG3Agi8o4b8j5ke+/pNoupEDzvjTYAQZYY=
=TtDg
-----END PGP SIGNATURE-----


More information about the Paraview-developers mailing list