[Paraview] How to push a value to the ServerManager so it gets pushed down to the Server

Michael Jackson mike.jackson at bluequartz.net
Tue Dec 15 12:11:42 EST 2009


I am developing both a reader (Server Side only) and a custom GUI to  
go along with the reader for the client side. I have all sorts of  
custom Qt Gui widgets in my Reader Gui Plugin and I was hoping to  
reuse a bunch of code that was already existing.

   I have created some plugins (Server side reader with Client side  
custom gui) for ParaView in the past, but all of those plugins used  
simple QWidgets. Nothing like what I am trying now.

  My code is in a publicly accessible git repo if you want to take a  
look at the code.
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net


On Dec 15, 2009, at 11:59 AM, Nehme Bilal wrote:

> I see. I already had the same kind of problems but am not able to  
> help much because there is no enough details in your message. Am not  
> sure if it's a reader or a filter that you are developing ? are you  
> reading the file on the client side ? server side ? or both ?
>
> 2 potential problems:
> - if you are reading the file on both the server and client side,  
> your plugin will not work when the server is running on different  
> computer because the file will not be accessible to one of them.
>
> - apply your plugin, save the state, delete all objects and reload  
> the state, probably something will go wrong.
>
> if you give more details, I'll probably be able to help.
>
> Nehme
>
> 2009/12/14 Michael Jackson <mike.jackson at bluequartz.net>
> Unfortunately the values that are stored in the QComboBox are read  
> from the data file. The "workaround" that i was able to implement  
> was to create the correct number of QTextEdit widgets and place them  
> in the Gui in QtDesigner. Then in my constructor for my Panel Class,  
> I simply call "setVisible(false)" on each of those QTextEdit widgets  
> so they do not show up in the GUI. I then add in the appropriate  
> logic using Signals/Slots to keep those invisible widgets up to date.
>   Seems kinda of klunky but frankly there is not enough  
> documentation in ParaView to stray from what is in the Wiki. There  
> is mention that I need to implement some sort of "adaptor" for  
> things like this (QRGB to RGB) is used as the example, but no actual  
> implementation details so I, as the programmer, am basically left  
> guessing what to try to implement.
>
>  Thanks for the suggestion though. Keep them coming. Better, yet,  
> would be places in the ParaView source to look for "examples"  
> besides grepping through the sources for key words.
>
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
>
>
> On Dec 12, 2009, at 7:49 PM, Nehme Bilal wrote:
>
> If the elements you want to display in you combobox are always the  
> same, simply use:
>
>   <IntVectorProperty
>     name="ActiveDimension"
>     command="SetActiveDimension"
>     number_of_elements="1"
>     default_values="0">
>        <EnumerationDomain name="enum">
>          <Entry value="1" text="X"/>
>          <Entry value="2" text="Y"/>
>          <Entry value="3" text="Z"/>
>        </EnumerationDomain>
>   </IntVectorProperty>
>
> and then rename you combobox to "ActiveDimension" in qt designer.
>
> That's should be enough to do what you are looking for.
>
> If you want to fill dynamically your combobox depending on some  
> inputs, it's harder than that but can be done.
>
> for you first question, you can always use immediate_update=1  
> instead of information_only to make sure that your value is pushed  
> immediately to the server.
>
> Nehme
>
>
>
>
> 2009/12/11 Michael Jackson <mike.jackson at bluequartz.net>
> Well,
>  That helped. At least something is getting set on the server side  
> now. Copy-Paste error. Doh. Alas, the value getting set is not the  
> correct value.
>
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
> BlueQuartz Software                    www.bluequartz.net
> Principal Software Engineer                  Dayton, Ohio
>
> On Dec 11, 2009, at 5:15 PM, Utkarsh Ayachit wrote:
>
> Why do you have the "information_only" attribute ? That's used only
> for properties whose value are obtained from the server -side and are
> never pushed "to"  the server. Simply remove that attribute, and it
> should work -- I think.
>
> Utkarsh
>
> On Fri, Dec 11, 2009 at 5:12 PM, Michael Jackson
> <mike.jackson at bluequartz.net> wrote:
> Yes, I did not know about that, but adding it still did not help.
>
> --
> Mike Jackson <www.bluequartz.net>
>
> On Dec 11, 2009, at 5:02 PM, Utkarsh Ayachit wrote:
>
> Are you forgetting a this->proxy()->UpdateVTKObjects() call after you
> have changed the value?
>
> Utkarsh
>
> On Fri, Dec 11, 2009 at 4:23 PM, Michael Jackson
> <mike.jackson at bluequartz.net> wrote:
>
> In my ServerManager XML file I have the following:
>
>  <IntVectorProperty
>   name="ActiveDimension"
>   command="SetActiveDimension"
>   number_of_elements="1"
>   default_values="0"
>   information_only="1">
>  </IntVectorProperty>
>
> And in my Client GUI code (which extends pqLoadedFormObjectPanel) I  
> have
> the
> following code:
>  vtkSMProperty* smProperty =
> this->proxy()->GetProperty("ActiveDimension");
>  if (NULL == smProperty)
>  {
>  DebugTrace(<< "SMProperty was NULL for 'ActiveDimension'" );
>  }
>  vtkSMIntVectorProperty* activeDimProperty =
> vtkSMIntVectorProperty::SafeDownCast(smProperty);
>  activeDimProperty->SetElement(0, index);
>
> Doing a std::cout on the server side indicates that the Server side
> property
> (ActiveDimension) is NOT getting set. What exactly am I doing wrong?
>
>  I would also like to have a QComboBox in the Gui that is hooked up  
> to a
> server side property. What is the best way to go about that?
>
> Thanks
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
>
>



More information about the ParaView mailing list