[Paraview-developers] Setting slider range and value

Björn Peeters b.peeters at aia.rwth-aachen.de
Mon Jun 20 02:27:31 EDT 2016


Hi,

to replace a textbox I want to use a slider with a variable range.
The following code (adapted from SciberQuestToolKitSMFilters.xml) sets the
range to 1-101 but also replaces the default value 10 with 51 (center of
range). Using a fixed range shows 10. Can I set the default value as well as
a variable range or just one of them ?

.h:
vtkGetVector2Macro(NoDomainsRange, int);
int NoDomainsRange[2] = {1,101};

.xml:
<IntVectorProperty
    name="NoDomainsRange"
    command="GetNoDomainsRange"
    information_only="1">
<IntVectorProperty
    name="NoDomainsSlider"
    command="SetNoDomains"
    number_of_elements="1"
    default_values="10"
    information_property="NoDomainsRange">
    <IntRangeDomain name="range" >
       <RequiredProperties>
          <Property name="NoDomainsRange" function="Range"/>
       </RequiredProperties>
    </IntRangeDomain>
</IntVectorProperty>


And is there a way to prevent the entering of numbers outside of the
range in the textbox?


Best regards,
Björn



-- 
Björn Peeters

Chair of Fluid Mechanics and Institute of Aerodynamics
RWTH Aachen University
Wüllnerstraße 5a, 52062 Aachen, Germany


More information about the Paraview-developers mailing list