[Paraview] Module Doesn't Get Variable Selection

John Biddiscombe biddisco at cscs.ch
Mon Jul 3 09:14:51 EDT 2006


Kent

I'd just like to mention that we have also noticed that there is a 
problem with filters using multiple scalars. The SetInputArrayToProcess 
call only ever sets index zero on the filter, so if you try to use 
another vector/scalar within a filter it doesn't work.

I should have submitted a bug report some time ago, but never got around 
to it. I suspect the place to look is inside the server code where 
SetInputArrayToProcess is being called (easier said than done of course) 
to find out if it is correctly getting the array index.

NB. I've only tested this rather briefly, so it's possible that some 
other thing is going wrong, but you can verify it doesn't work by 
creating a dataset with random vectors, instantiating a ribbon filter, 
then changing the vector selection on the ribbon filter and seeing that 
the ribbons never change.

I've just typed this in one go from memory, so please forgive if I've 
made errors.

JB



> A new ParaView module I am writing tries to get the user's selection of 
> a variable in "RequestData" with
> 
>   vtkDataArray *D = this->GetInputArrayToProcess( 0, inputVector );
> 
> but D is always a null. The GUI shows a pulldown menu for this selection 
> that shows all of the input object's variables as expected. The GUI 
> definition for this selection is
> 
>      <ArrayMenu
>         id="arrMen"
>         input_menu="inpMen"
>         trace_name="Scalars"
>         property="VariableForDensity"
>         label="Density Scalar"
>         help="Input cell scalar used for point density"
>      />
> 
> and the corresponding piece of the server XML is
> 
>         <StringVectorProperty name="VariableForDensity"
>            command="SetInputArrayToProcess"
>            number_of_elements="5"
>            element_types="0 0 0 0 2"
>         >
>            <ArrayListDomain  name="array_list"
>               attribute_type="Scalars"
>               input_domain_name="input_array1"
>            >
>               <RequiredProperties>
>                  <Property name="Input" function="Input"/>
>               </RequiredProperties>
>            </ArrayListDomain>
>         </StringVectorProperty>
> 
> I've attached the complete XML for the new module. The new module 
> inherits vtkPolyDataAlgorithm. I've been using vtkRibbonFilter as a guide.
> 
> Can anyone suggest where to look for the cause of this problem? Thanks!
> 
> 
> Kent
> Pittsburgh Supercomputing Center
> 
> 
> ------------------------------------------------------------------------
> 
> <ModuleInterfaces>
>    <ServerManagerFile
>       directory="/home/eschenbe/PV/Kits/Cloud"
>       name="cloudSM.xml"
>    />
>    <Module
>        name="Cloud"
>        menu_name="Cloud"
>        root_name="Cloud"
>        module_type="Filter"
>        long_help="Create a cloud of points for each input cell"
>        short_help="Create a cloud of points"
>    >
>       <Filter class="vtkCloud">
>          <Input name="Input" class="vtkDataSet">
>          </Input>
>       </Filter>
>       <InputMenu
>          id="inpMen"
>          trace_name="Input"
>          input_name="Input"
>          property="Input"
>          label="Input"
>          help="Input to this filter"
>       />
>       <ArrayMenu
>          id="arrMen"
>          input_menu="inpMen"
>          trace_name="Scalars"
>          property="VariableForDensity"
>          label="Density Scalar"
>          help="Input cell scalar used for point density"
>       />
>       <ThumbWheel
>          trace_name="MaxPoints"
>          property="MaxPoints"
>          label="Max Points"
>          resolution="1"
>          minimum_value="1"
>          help="Maximum number of output points per input cell"
>       />
>       <MinMax
>          array_menu="arrMen"
>          trace_name="DensityScale"
>          property="DensityScale"
>          min_label="Min Density"
>          max_label="Max Density"
>          min_help="Input value corresponding to 0 points per cell"
>          max_help="Input value corresponding to Max-Points points per cell"
>       />
>       <LabeledToggle
>          trace_name="PointData"
>          property="PointData"
>          label="Point Data"
>          help="Data assigned to output points"
>       />
>       <ArrayMenu
>          input_menu="inpMen"
>          trace_name="VariableForPoints"
>          property="VariableForPoints"
>          label="Point Variable"
>          help="Cell data passed to output points"
>       />
>       <Documentation>
> The Cloud filter places from 0 to N points in each cell of the input data set. The new points will be randomly located in the cell. To calculate N the selected input cell scalar is scaled to 0:1 using the min/max then multiplied by the max number of points. Each output point can be given a random number (0 to 1) or a copy of an input cell variable (scalar or vector). The Cloud filter takes any type of data set, with at least one cell variable, as input; and produces a polygonal data set as output.
>       </Documentation>
>    </Module>
> </ModuleInterfaces>
> 
> 
> ------------------------------------------------------------------------
> 
> <ServerManagerConfiguration>
>    <ProxyGroup name="filters">
>       <SourceProxy name="Cloud" class="vtkCloud">
>          <InputProperty name="Input" command="SetInput">
>             <ProxyGroupDomain name="groups">
>                <Group name="sources"/>
>                <Group name="filters"/>
>             </ProxyGroupDomain>
>             <DataTypeDomain name="input_type">
>                <DataType value="vtkDataSet"/>
>             </DataTypeDomain>
>             <InputArrayDomain
>                name="input_array1"
>                attribute_type="cell"
>                number_of_components="1"
>             />
>             <InputArrayDomain
>                name="input_array2"
>                attribute_type="cell"
>                number_of_components="1"
>             />
>          </InputProperty>
>          <StringVectorProperty 
>             name="VariableForDensity" 
>             command="SetInputArrayToProcess"
>             number_of_elements="5"
>             element_types="0 0 0 0 2"
>          > 
>             <ArrayListDomain
>                name="array_list"
>                attribute_type="Scalars"
>                input_domain_name="input_array1"
>             >
>                <RequiredProperties>
>                   <Property name="Input" function="Input"/>
>                </RequiredProperties>
>             </ArrayListDomain>
>          </StringVectorProperty>
>          <IntVectorProperty
>             name="MaxPoints"
>             command="SetMaxPoints"
>             number_of_elements="1"
>             animateable="1"
>             default_values="1"
>          >
>             <IntRangeDomain name="range" min="0" max="100"/>
>          </IntVectorProperty>
>          <DoubleVectorProperty
>             name="DensityScale" 
>             command="SetDensityScale"
>             number_of_elements="2"
>             default_values="0.0 1.0"
>          >
>             <ArrayRangeDomain name="range">
>                <RequiredProperties>
>                  <Property name="Input" function="Input"/>
>                  <Property name="SelectInputScalars" function="ArraySelection"/>
>                </RequiredProperties>
>             </ArrayRangeDomain>
>          </DoubleVectorProperty>
>          <IntVectorProperty 
>             name="PointData" 
>             command="SetPointData" 
>             number_of_elements="1"
>             default_values="0"
>          > 
>             <IntRangeDomain name="PointDataRange" min="0" max="2"/>
>          </IntVectorProperty>
>          <StringVectorProperty 
>             name="VariableForPoints" 
>             command="SetInputArrayToProcess"
>             number_of_elements="5"
>             element_types="0 0 0 0 2"
>          > 
>             <ArrayListDomain
>                name="array_list"
>                attribute_type="Scalars"
>                input_domain_name="input_array2"
>             >
>                <RequiredProperties>
>                   <Property name="Input" function="Input"/>
>                </RequiredProperties>
>             </ArrayListDomain>
>          </StringVectorProperty>
>       </SourceProxy>
>    </ProxyGroup>
> </ServerManagerConfiguration>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview


-- 
John Biddiscombe,                            email:biddisco @ cscs.ch
http://www.cscs.ch/about/BJohn.php
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82



More information about the ParaView mailing list