XML DoubleVectorProperty: four elements?

Hello,

I’m currently using this XML code to create an input with 3 elements:

 <DoubleVectorProperty 
    				name="Vector"
    				command="SetParameter"
    				initial_string="Vector"
    				number_of_elements="3"
    				default_values="0.0 0.0 0.0">
</DoubleVectorProperty>

This works fine with 1, 2 or 3 elements, but fails with 4 or more elements. How can I solve this?

(I know that 4 elements should be possible because the Mandelbrot source has several inputs with multiple elements)

PS: i’m using PV 5.7.0

Thank in advance!

Miguel

Please share the failing code.

Hello,

Please, find in the attached file the XML file of a very basic programmable source that reproduces the problem: when “number_of_elements” is set to 4 (or larger), PV fails and close. Is there any way to create an input vector with 4 or more text boxes?

Thanks again !

Miguel

TEST_DOUBLE_VECTOR_PROPERTY.xml (626 Bytes)

Here is a working one.

      <DoubleVectorProperty command="SetOriginCX"
                            default_values="-1.75 -1.25 0.0 0.0"
                            name="OriginCX"
                            number_of_elements="4">
        <DoubleRangeDomain name="range" />
        <Documentation>The four values of this property indicate (in order) the 
        components of C (real and imaginary) and the components of the initial
        value, X (real and imaginary).</Documentation>
      </DoubleVectorProperty>

Hello Mathieu,

Thanks for your answer.

However, it fails when I include this script into my original script (PV crashes). After some research, I realized that the function that you have provided belongs to the class “vtkImageMandelbrotSource” (https://vtk.org/doc/nightly/html/classvtkImageMandelbrotSource.html) and it creates a Mandelbrot after execution. However, I’m trying to create a Python programmable source which requires the class “vtkPythonProgrammableFilter”. Do you know if there is an equivalent to “SetOriginCX” but valid for the vtkPythonProgrammableFilter class?

Thanks again !

Miguel