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

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Aug 28 12:49:18 EDT 2014


Maybe go the custom filter route instead. You cannot have a choice of
filters to chose from a comb-box, in that case. But you can  create a
ExtractBlock+Filter version of every filter you're interested in.
Something similar to how we deal with file-series readers, for
example.



On Thu, Aug 28, 2014 at 12:04 PM, Felipe Bordeu
<felipe.bordeu at ec-nantes.fr> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thanks,
>
> It works, but (I know there is always a but)...
>
> 1) Paraview (at the creation of my mainfilter) calls RequestInformation
> on all the internal filters available, and because they don't have
> connections, I get plenty of :
>
> ERROR: In
> /Big/fbordeu/sources/ParaView4/VTK/Common/ExecutionModel/vtkExecutive.cxx,
> line 783
> vtkPVCompositeDataPipeline (0x686f5b0): Algorithm
> vtkPVArrayCalculator(0x6875210) returned failure for request:
> vtkInformation (0x686dde0)
>
> ERROR: In
> /Big/fbordeu/sources/ParaView4/VTK/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx,
> line 710
> vtkPVCompositeDataPipeline (0x6940a30): Input port 0 of algorithm
> vtkPVMetaClipDataSet(0x6921660) has 0 connections but is not optional.
>
>
> ERROR: In
> /Big/fbordeu/sources/ParaView4/VTK/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx,
> line 710
> vtkPVCompositeDataPipeline (0x6969450): Input port 0 of algorithm
> vtkThreshold(0x696f170) has 0 connections but is not optional.
>
>
> ERROR: In
> /Big/fbordeu/sources/ParaView4/VTK/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx,
> line 710
> vtkPVCompositeDataPipeline (0x6977740): Input port 0 of algorithm
> vtkDataSetSurfaceFilter(0x697f540) has 0 connections but is not optional.
>
> 2) The panels of filters with custom widget are not generated correctly
> (the case of the calculator filter).
>
> 3) Because of the filters don't have information about the input, the 3D
> widget are not plot in the renderview ( the plane of the clip filter)
>
> I know I'm trying to do something tricky, but we do this kind of
> operation often (extract a block apply a filter, extract another block
> apply a filter, extract all the remaining block, and then do  "append
> datasets" to recover a multi-block structure). And even with this we
> lost the original structure of the multi-block.
>
> the point 2 and tree are not that important (we can set the data from
> the panel, and for the calculator we still have the function field)
>
> Felipe
>
> ps: in the attachement there is an image of the filter
>
> Le 28/08/2014 16:30, Utkarsh Ayachit a écrit :
>> I am not sure I'd recommend anyone to do this :), but since you're
>> experimenting .. here's something to try:
>>
>> Don't do the SetInputDataObject() in RequestInformation, try passing
>> the output of ExtractBlock to the input in RequestData() instead.
>>
>> Utkarsh
>>
>> On Wed, Aug 27, 2014 at 10:03 AM, Felipe Bordeu
>> <felipe.bordeu at ec-nantes.fr> wrote:
>> 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.
>>> _______________________________________________
>>> Paraview-developers mailing list
>>> Paraview-developers at paraview.org
>>> http://public.kitware.com/mailman/listinfo/paraview-developers
>
> - --
> 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/1MLAAoJEE/fMfNgU9/D4RIH/iWwW2KqkzTEnuFu7fTEMTNs
> yraqs/bTO8YLqsWkx5k2bnzT7zu1aCEzaWLFncZIrVVNJXdiY9o/XnO7g9Dqi/Rb
> pHgqkdwTaC9XTFSfbl0P55QsdlIcURE/5hue3WvoVE2PGjiWHf282zeTytuj++Vw
> jvSgpLLJVvW3b4BWssgtAb7o8BVdy5YoHf+gqdfi5pIgYsGtpBv60VcdCjTmIrSx
> RNii9eLHmBRYWqahyIuvvOej4H8Yb94n6PcK/Wd+pJS/JaFf872GDLHXaglj77zw
> EJYrT19WvFEW3rpLZLsi+ccLCXvk0Y67EEiHdpHNpDxQPu9fy4MmEie9I74gJ4o=
> =NYLZ
> -----END PGP SIGNATURE-----


More information about the Paraview-developers mailing list