[Paraview-developers] DoubleVectorProperty (Slider) range set at run time

Mathieu Westphal mathieu.westphal at kitware.com
Thu Mar 29 22:33:43 EDT 2018


Hi Pascal

Nice work, thanks for sharing.

There is no "pqIntSliderWidget" in ParaView yet, so no, it is not possible.
MRs are welcome, so if you want to contribute, please head to
https://gitlab.kitware.com/paraview/paraview/
It would also be possible to implement it in a plugin.

best,

Mathieu Westphal

On Thu, Mar 29, 2018 at 5:03 PM, Pascal S. Meysonnat <
p.meysonnat at aia.rwth-aachen.de> wrote:

> On 03/29/2018 04:45 AM, Mathieu Westphal wrote:
>
> Hello Pascal,
>
> First, i would suggest identifying a widget in ParaView that behave the
> way you would like your widget to behave, then take a look into this widget
> XML for inspiration.
>
> There may be a way to do what you want to do, but you will need to
> precise, where do these "at run-time min and max" values come from ?
>
> Also what do you mean by increment ? There is no such concept of increment
> in ParaView slider based widgets.
>
> Best regards,
>
> Mathieu Westphal
>
> On Wed, Mar 28, 2018 at 9:15 PM, Pascal Meysonnat <p.meysonnat at aia.rwth-
> aachen.de> wrote:
>
>> Dear all,
>>
>> I am currently developing a new plugin for our in-house solver and would
>> like to have a slider to select certain values which are only known at run
>> time. I have seen the property panel configuration for such a case to look
>> similar to:
>>
>>  <DoubleVectorProperty
>>          Name="Values"
>>          command="SetValues"
>>          number_of_elements="1"
>>          default_values="1">
>>          panel_widget="int_range">
>>        <ArrayRangeDomain name="range">
>>          <RequiredProperties>
>>            <Property function="Input"
>>                      name="Input" />
>>          </RequiredProperties>
>>        </ArrayRangeDomain>
>>      </DoubleVectorProperty>
>>
>> I am not fully sure on how to set the range properly at the run time.
>> Let’s for example say i know at run time the range of the slider should be
>> 1…8. How can i set the range properly and how can I set the increment? Is
>> there some small example I can may be have a look at?
>>
>> Thank you very much for your help,
>>
>> Regards,
>>
>> Pascal
>>
>> --
>> Dr.-Ing. Pascal S. Meysonnat
>>
>> Chair of Fluid Mechanics and Institute of Aerodynamics
>> RWTH Aachen University
>> Wüllnerstraße 5a
>> <https://maps.google.com/?q=W%C3%BCllnerstra%C3%9Fe+5a+%0D%0A+++++++++++++++++++++++++++++D-52062+Aachen+%0D%0A+++++++++++++++++++++++++++++Germany&entry=gmail&source=g>
>> D-52062 Aachen
>> <https://maps.google.com/?q=W%C3%BCllnerstra%C3%9Fe+5a+%0D%0A+++++++++++++++++++++++++++++D-52062+Aachen+%0D%0A+++++++++++++++++++++++++++++Germany&entry=gmail&source=g>
>> Germany
>> <https://maps.google.com/?q=W%C3%BCllnerstra%C3%9Fe+5a+%0D%0A+++++++++++++++++++++++++++++D-52062+Aachen+%0D%0A+++++++++++++++++++++++++++++Germany&entry=gmail&source=g>
>>
>>
>>
>> _______________________________________________
>> 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:
>> https://public.kitware.com/mailman/listinfo/paraview-developers
>>
>>
> Dear Mathieu,
>
> I finally managed to get it work in the end, except for one special
> question which remains open. Here is the solution.
>
> In the xml file I hat to use the function RangeInfo (see below):
>
>  <DoubleVectorProperty name="LevelRange"
>         command="GetLevelRange"
>         information_only="1"
>         number_of_elements="2"
>         default_values="-1 -10">
>        <SimpleDoubleInformationHelper />
>       </DoubleVectorProperty>
>
>      <DoubleVectorProperty
>          name="MaxLevelToShow"
>          command="SetMaxLevelToShow"
>          information_property="LevelRange"
>          number_of_elements="2"
>          animateable="1"
>          default_values="0 0"
>          panel_widget="double_range">
>        <DoubleRangeDomain name="range" >
>           <RequiredProperties>
>               <Property name="LevelRange" function="RangeInfo"/>
>           </RequiredProperties>
>         </DoubleRangeDomain>
>      </DoubleVectorProperty>
>
> and in the *.h file of the reader, the Macro had to be set
>
> vtkGetVector2Macro(LevelRange, int);
>
> as well as
>
> int LevelRange[2];
>
> Finished! Now I can read the values into LevelRange from the
> RequestInformation and the sliders appear correctly. There is just one
> final thing which is missing. I have integer values and I would like the
> sliders to be rather of an integer type than being of double type, i.e., i
> would like them do change in full integer values? Is there a way to achieve
> this?
>
> Best Regards
>
> Pascal Meysonnat
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview-developers/attachments/20180330/41232a29/attachment-0001.html>


More information about the Paraview-developers mailing list