[Paraview] custom filter?

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Sep 4 12:07:10 EDT 2008


You may want to take a  look at lookmarks. Since you are interested in 
display properties, that might be better suited for your case. The 
paraview help has details about lookmarks.


Dominik Szczerba wrote:
> Thanks for the detailed explanation.
> 
> This does not seem ti work for transient datasets (it does the job for a given 
> timestep only).
> In addition, display properties can not be stored (opacity, active color 
> scalars etc).
> Or did I overlook something? Or do I need a more recent CVS? (mine is early 
> August)
> 
> Thanks a lot,
> Dominik
> 
> 
> On Thursday 04 September 2008 03:35:54 pm Utkarsh Ayachit wrote:
>> Custom filter mechanism is designed to be used to combine a sub-pipeline
>> into a single filter (or source) (with all the a paramter settings for
>> each of the individual filters/sources) exposing a subset of the
>> parameters to the user.
>>
>> Eg. Here's my pipeline:
>> Sphere -> Shrink --> "Extract Edges"
>>
>> Suppose we want to combine the Shrink-->ExtractEdges into a new custom
>> filter "ShrunkEdges".
>>
>> * Select the Shrink and the Extract Edges filter in the pipeline browser
>> (use Ctrl key for multiple selections).
>> * With the two filters selected, go to Tools menu and choose "Create
>> Custom Filter"
>> * The "Create Custom Filter" wizard will show up.
>> * First give our filter a new name. This name must be unique and if
>> conflicting an error message will be shown. We are calling this one
>> "ShrunkEdges" (step1.png). Then click "Next".
>> * We now choose what are the inputs to the custom filter that the user
>> can set. By default, paraView will find the first filter in the
>> sub-pipeline (in this case "Shrink") and expose it's "Input" property as
>> the input to this custom filter. Since that's exactly what we want here
>> (step2.png), click "Next".
>> * Next we need to choose the outputs from this filter. By default,
>> paraview will choose the last filter in the subpipeline (in this case
>> 'ExtractEdges'. Let's say we want this custom filter to have two
>> outputs, the output after the shrink stage as well as the one after
>> extracting edges. ExtractEdges is already exposed as an output, we now
>> expose the shrink filter as well. Select the "Shrink" in the left-side
>> tree. It's output ports will be shown the "Output Port" combo. Choose
>> the output port (relevant if the filter itself had more than 1 output
>> ports), the assign it some unique name, say "ShrunkOutput" then press
>> "+" to add it to the exposed outputs list (step3.png).  Click "Next".
>> * Next we expose the subset of parameters on this custom filter that the
>> user can change at run-time. Let's say we want to allow the user to
>> change the "Shrink Factor" on the shrink filter. Select the "Shrink"
>> filter in the tree and then select the property to expose in the
>> "Property" combo, assign it some name (or use the default) and the hit
>> "+" to expose it (step4.png). Once all required properties are exposed,
>> click "Finish" to create a definition for the custom filter.
>>
>> The "Custom Filter Manager" will popup showing the newly defined custom
>> filter. The manager is also available under the "Tools" menu. It can be
>> used to remove/export/import custom filters.
>>
>> Close this dialog.
>>
>> Now to instantiate our new custom filter, simply look under the
>> "Filters|Alphabetical" menu, we see our new "ShrunkEdges" filter. Now
>> you can create it simply as if it were a normal filter.
>>
>> Same is true with sources, if no input property is exposed, it's treated
>> as a source and is available under "Sources" menu.
>>
>> Utkarsh
>>
>> Dominik Szczerba wrote:
>>> I have a complicated layout of filters on the left panel. How do I go
>>> about saving them as a filter in PV CVS? (saving state does not work for
>>> transient, fixing number current time steps). I tried 'create a custom
>>> filter' but it is not comprehensive. I clicked around and ended up
>>> nowhere. Any hints are appreciated.
>>> PS. I dd not find anything on wiki, and can again no longer find a search
>>> link to ML archives.
>>>
>>> best regards
> 
> 
> 


More information about the ParaView mailing list