[Paraview] Information Only Property Parameters

Brian Panneton brian.panneton at gmail.com
Thu Mar 24 16:00:08 EDT 2011


I was able to get it working by using SetElement and setting the currentText
retreived from the widget. Then I called UpdateProperty on the first
combobox. Next I called UpdatePropertyInformation on the second combobox.
For the order issue, I just ended up renaming them so they followed the
order I needed.

Thanks,
Brian Panneton

On Thu, Mar 24, 2011 at 9:47 AM, Sebastien Jourdain <
sebastien.jourdain at kitware.com> wrote:

> Hi Brian,
>
> I'm not sure to understand your UI and the way the things are.
> It might be overkill, but if you want to express those dependency, you
> can create your own domain based on what it is filled so far so at
> start only TypeList will be available, then "TypeList + DataTypeList"
> and then "TypeList + DataTypeList + DataList"
> Other than that, I don't know if it is possible to change the order...
>
> Seb
>
>
> On Thu, Mar 24, 2011 at 9:32 AM, Brian Panneton
> <brian.panneton at gmail.com> wrote:
> > I will attempt that and see if it corrects the issue. I have also noticed
> > that when I start up the plugin and open a file, the order of my combobox
> > population is wrong, and I can't seem to be able to change it.
> >
> > On load, I want it to populate in this order: TypeList, DataTypeList,
> > DataList
> > But it seems to always go in alphabetical order. This causes an issue
> > because DataList depends on what is selected in DataTypeList which
> depends
> > on TypeList. If either DataList or DataTypeList is run first it defaults
> to
> > none.
> >
> > Is there a way to make them load data in order?
> >
> > On Wed, Mar 23, 2011 at 2:23 PM, Sebastien Jourdain
> > <sebastien.jourdain at kitware.com> wrote:
> >>
> >> Who is supposed to change the property cbType ?
> >> I bet it get updated after that call, therefore, you should update
> >> with the correct value before you update the information property.
> >> To make sure you get the right value, print the combobox value so you
> >> know which value is pushed to the server before the update information
> >> property.
> >>
> >> Seb
> >>
> >> did you tried to print the combobox index when the slot get called ?
> >> Another thing could be to set yourself the value in the property at that
> >> time.
> >>
> >> On Wed, Mar 23, 2011 at 1:55 PM, Brian Panneton
> >> <brian.panneton at gmail.com> wrote:
> >> > This XML is of two comboboxes, where the first depends on the second's
> >> > selection.
> >> > XML:
> >> >             <StringVectorProperty
> >> >                 name="DataTypeList"
> >> >                 command="GetReaderDataTypeList"
> >> >                 information_only="1">
> >> >                 <StringArrayHelper />
> >> >             </StringVectorProperty>
> >> >             <StringVectorProperty
> >> >                 name="cbDataType"
> >> >                 command="SetReaderDataType"
> >> >                 immediate_update="1"
> >> >                 number_of_elements="1">
> >> >                 <StringListDomain name="operation">
> >> >                     <RequiredProperties>
> >> >                         <Property name="DataTypeList"
> >> >                             function="ArraySelection"/>
> >> >                     </RequiredProperties>
> >> >                 </StringListDomain>
> >> >             </StringVectorProperty>
> >> >
> >> >             <StringVectorProperty
> >> >                 name="TypeList"
> >> >                 command="GetReaderTypeList"
> >> >                 information_only="1">
> >> >                 <StringArrayHelper />
> >> >             </StringVectorProperty>
> >> >             <StringVectorProperty
> >> >                 name="cbType"
> >> >                 command="SetReaderType"
> >> >                 immediate_update="1"
> >> >                 number_of_elements="1">
> >> >                 <StringListDomain name="operation">
> >> >                     <RequiredProperties>
> >> >                         <Property name="TypeList"
> >> >                             function="ArraySelection"/>
> >> >                     </RequiredProperties>
> >> >                 </StringListDomain>
> >> >             </StringVectorProperty>
> >> >
> >> >
> >> > When a currentIndexChanged event in cbType occurs, it sends a signal
> to
> >> > the
> >> > typeChanged() slot.
> >> >
> >> > Code:
> >> > void
> >> > myclass::typeChanged()
> >> > {
> >> >     this->proxy()->GetProperty("cbType")->Modified();
> >> >     vtkSMProperty* prop = this->proxy()->GetProperty("DataTypeList");
> >> >     this->proxy()->UpdatePropertyInformation(prop);
> >> > }
> >> >
> >> > What ends up happening is that when I change the combobox for cbType
> >> > from
> >> > index 1 to index 2, typeChanged() is called, but is sending the 1st
> >> > value to
> >> > SetReaderType. It looks like it refeshes but remains index1. Thus, the
> >> > DataTypeList is populated with the same information it had.
> >> >
> >> > When I remove the Modified() line, the combobox for cbType will show
> the
> >> > change from index 1 to index 2, but SetReaderType does not get called.
> >> >
> >> > Any idea why that is happening?
> >> >
> >> > Thanks,
> >> >
> >> > Brian
> >> >
> >> >
> >> > On Wed, Mar 23, 2011 at 12:15 PM, Sebastien Jourdain
> >> > <sebastien.jourdain at kitware.com> wrote:
> >> >>
> >> >> Hi Brian,
> >> >>
> >> >> could you send the (part of) XML proxy definition and the piece of
> >> >> code you are calling to that proxy to make that push...
> >> >> So I could be sure that both side are corrects.
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Seb
> >> >>
> >> >> On Wed, Mar 23, 2011 at 11:32 AM, Brian Panneton
> >> >> <brian.panneton at gmail.com> wrote:
> >> >> > Okay, my attempt to push the variable to the server using
> >> >> > immediate_update="1" seems to not update the server variable when I
> >> >> > change
> >> >> > my current index of a combobox. I also tried to call Modified() on
> >> >> > the
> >> >> > currentIndexChanged event, but it seems to ignore the changes from
> >> >> > the
> >> >> > GUI
> >> >> > and reset the combobox as if I just loaded it.
> >> >> >
> >> >> > How should I be pushing the variable to the server?
> >> >> >
> >> >> >
> >> >> > On Wed, Mar 23, 2011 at 11:11 AM, Sebastien Jourdain
> >> >> > <sebastien.jourdain at kitware.com> wrote:
> >> >> >>
> >> >> >> Unfortunately that's the way you have to do it. Or the other way
> is
> >> >> >> to
> >> >> >> use GatherInformation() but it won't be much better.
> >> >> >>
> >> >> >>
> >> >> >> On Wed, Mar 23, 2011 at 10:23 AM, Brian Panneton
> >> >> >> <brian.panneton at gmail.com> wrote:
> >> >> >> > If I have an information_only property with a command to get a
> >> >> >> > vtkStringArray, is there a way to pass a parameter to the
> fuction?
> >> >> >> > And,
> >> >> >> > can
> >> >> >> > that parameter be from another property? Otherwise, it seems
> that
> >> >> >> > I
> >> >> >> > would
> >> >> >> > need to push the variable to the server in order for it to be
> >> >> >> > available
> >> >> >> > for
> >> >> >> > the command called from the information_only property.
> >> >> >> >
> >> >> >> > Thanks,
> >> >> >> > Brian Panneton
> >> >> >> >
> >> >> >> > _______________________________________________
> >> >> >> > Powered by www.kitware.com
> >> >> >> >
> >> >> >> > Visit other Kitware open-source projects at
> >> >> >> > http://www.kitware.com/opensource/opensource.html
> >> >> >> >
> >> >> >> > Please keep messages on-topic and check the ParaView Wiki at:
> >> >> >> > http://paraview.org/Wiki/ParaView
> >> >> >> >
> >> >> >> > Follow this link to subscribe/unsubscribe:
> >> >> >> > http://www.paraview.org/mailman/listinfo/paraview
> >> >> >> >
> >> >> >> >
> >> >> >
> >> >> >
> >> >
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110324/da61f60e/attachment.htm>


More information about the ParaView mailing list