[Paraview-developers] Selecting blocks from drop down list

Jorge Bañuls jorgebanuls at gmail.com
Fri Jul 15 11:31:57 EDT 2016


I've tried to implement the property in this way:

      <IntVectorProperty clean_command="RemoveAllIndices"
                         command="AddIndex"
                         name="BlockIndices"
                         number_of_elements_per_command="1"
                         panel_visibility="default"
                         repeat_command="1">
        <CompositeTreeDomain mode="all"
                             name="tree">
          <RequiredProperties>
            <Property function="Input"
                      name="Input" />
          </RequiredProperties>
        </CompositeTreeDomain>
        <Documentation></Documentation>
      </IntVectorProperty>

but I get the following error:

ERROR: In
M:\b\paraview\src\paraview\ParaViewCore\ServerImplementation\Core\vtkPVSessionCore.cxx,
line 390

vtkPVSessionCore (00000000035C2B60): Object type:
vtkPythonProgrammableFilter, could not find requested method:
"RemoveAllIndices"

or the method was called with incorrect arguments.


while processing

Message 0 = Invoke

Argument 0 = vtk_object_pointer {vtkPythonProgrammableFilter
(000000000B5222A0)}

Argument 1 = string_value {RemoveAllIndices}




ERROR: In
M:\b\paraview\src\paraview\ParaViewCore\ServerImplementation\Core\vtkPVSessionCore.cxx,
line 391

vtkPVSessionCore (00000000035C2B60): Aborting execution for debugging
purposes.



ERROR: In
M:\b\paraview\src\paraview\ParaViewCore\ServerImplementation\Core\vtkSIProxy.cxx,
line 134

vtkSISourceProxy (000000000B4FDA70): Error pushing property state:
BlockIndices


if I omit clean_command="RemoveAllIndices", then the error appears for
command="AddIndex". I've tried to use other commands, such as SetParameter
or AddParameter, but no combination seems to work.


On 15 July 2016 at 12:27, Andy Bauer <andy.bauer at kitware.com> wrote:

> In ./ParaViewCore/ServerManager/SMApplication/Resources/filters.xml in the
> source code there's the following  section which gives the options and GUI
> layout:
>     <SourceProxy class="vtkExtractBlock"
>                  label="Extract Block"
>                  name="ExtractBlock">
>       <Documentation long_help="This filter extracts a range of blocks
> from a multiblock dataset."
>                      short_help="Extract block.">This filter extracts a
> range
>                      of groups from a multiblock dataset</Documentation>
>       <InputProperty command="SetInputConnection"
>                      name="Input">
>         <ProxyGroupDomain name="groups">
>           <Group name="sources" />
>           <Group name="filters" />
>         </ProxyGroupDomain>
>         <DataTypeDomain name="input_type">
>           <DataType value="vtkMultiBlockDataSet" />
>         </DataTypeDomain>
>         <Documentation>This property specifies the input to the Extract
> Group
>         filter.</Documentation>
>       </InputProperty>
>       <IntVectorProperty clean_command="RemoveAllIndices"
>                          command="AddIndex"
>                          name="BlockIndices"
>                          number_of_elements_per_command="1"
>                          panel_visibility="default"
>                          repeat_command="1">
>         <CompositeTreeDomain mode="all"
>                              name="tree">
>           <RequiredProperties>
>             <Property function="Input"
>                       name="Input" />
>           </RequiredProperties>
>         </CompositeTreeDomain>
>         <Hints>
>           <WidgetHeight number_of_rows="20" />
>         </Hints>
>         <Documentation>This property lists the ids of the blocks to extract
>         from the input multiblock dataset.</Documentation>
>       </IntVectorProperty>
>       <IntVectorProperty command="SetPruneOutput"
>                          default_values="1"
>                          name="PruneOutput"
>                          number_of_elements="1">
>         <BooleanDomain name="bool" />
>         <Documentation>When set, the output mutliblock dataset will be
> pruned
>         to remove empty nodes. On by default.</Documentation>
>       </IntVectorProperty>
>       <IntVectorProperty command="SetMaintainStructure"
>                          default_values="0"
>                          name="MaintainStructure"
>                          number_of_elements="1">
>         <BooleanDomain name="bool" />
>         <Documentation>This is used only when PruneOutput is ON. By
> default,
>         when pruning the output i.e. remove empty blocks, if node has only
> 1
>         non-null child block, then that node is removed. To preserve these
>         parent nodes, set this flag to true.</Documentation>
>       </IntVectorProperty>
>       <!-- End ExtractBlock -->
>     </SourceProxy>
>
> Creating something similar for you may work. If you search the code for
> things like vtkSMIntVectorProperty.cxx/h you should find information on how
> the corresponding IntVectorProperty.
>
> On Fri, Jul 15, 2016 at 7:18 AM, Jorge Bañuls <jorgebanuls at gmail.com>
> wrote:
>
>> Hi Andy,
>>
>> Indeed, the vtkExtractBlock filter is what I'm using in my script to
>> extract the blocks, which are currently specified by the user in the
>> properties panel as a string with the name of the block(s). Now that you
>> mention it though, it could be useful to see how this filter creates the
>> checklist. Is there a way to access the code behind this filter?
>>
>> Thanks a lot for your help,
>>
>> Jorge Bañuls
>>
>> On 15 July 2016 at 12:06, Andy Bauer <andy.bauer at kitware.com> wrote:
>>
>>> Have you looked at the Extract Blocks filter? That  may already be doing
>>> what you need and if not, it at least shows how to check the boxes for
>>> blocks that you want.
>>>
>>> On Fri, Jul 15, 2016 at 6:53 AM, Jorge Bañuls <jorgebanuls at gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm developing a filter for Paraview and I need to be able to select
>>>> blocks from the properties panel (the input is a vtkMultiBlockDataSet). The
>>>> approach I'm using right now is to write the name of the block(s) and then
>>>> process that string within the script, but I would like to be able to check
>>>> the blocks I need from a list. I've seen many examples of how to do this,
>>>> but only for variables arrays (e.g. the list displays the cell arrays
>>>> existing in the input). Any ideas on how to apply this to display and
>>>> select the blocks?
>>>>
>>>> Thanks in advance for your help,
>>>>
>>>> Jorge Bañuls
>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Search the list archives at:
>>>> http://markmail.org/search/?q=Paraview-developers
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://public.kitware.com/mailman/listinfo/paraview-developers
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160715/7825ae58/attachment.html>


More information about the Paraview-developers mailing list