[Paraview-developers] Sending a vector from GUI to Server
RIVERA ROLDAN, Jorge Orlando
Orlando.RIVERA at mtu.de
Mon Jun 15 03:29:00 EDT 2015
Dear Utkarsh
Thanks for you example, It turned out that in the GUI I was missing in my overwritten updateInformationDomains a call to vtkSMProxy ::UpdateProperty(“ ActivateSelVec”)
And it seems to be working now , for 3.98 I did not have to call this. I think it is better now since RequestData is called only once and not twice (3.98) .
Any pointer to how vtkSMProxy works I would like to understand this better
Regards
Orlando
Von: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com]
Gesendet: Wednesday, 10. June 2015 21:18
An: RIVERA ROLDAN, Jorge Orlando; Paraview Developers
Betreff: Re: [Paraview-developers] Sending a vector from GUI to Server
Not entirely sure where your code is failing, but attached is a sample. Since I let ParaView create the default widget, I can entire arbitrary int values in the UI and they seem to get propagated to the source as expected.
Utkarsh
On Wed, Jun 10, 2015 at 9:19 AM RIVERA ROLDAN, Jorge Orlando <Orlando.RIVERA at mtu.de<mailto:Orlando.RIVERA at mtu.de>> wrote:
Dear Mailing list
I was developing a reader for 3.98 and I want to port into 4.3.1. A short description follows:
I use a vtkSMIntVectorProperty selProp to store a vector with 1 or 0 (true or false ) . This vector selPro is l filled when in the GUI I call the accepted property (Apply in Pipeline Browser:: Properties ) . This selPro is connected to a function ActivateSelVec on the server , that fills another vector (vtkIntArray) selVec.
When the RequestData is called selVec should be already filled with 1s and 0s. (the same values of selPro )
In 3.98 RequestData (the whole sequence in fact ) is called twice when I press Apply, Don’t know how ? but I see it with the debugger.
The order in which the functions are called are:
1st call
SetActivateSelVec (Server: fills selVec – with zeros only since accepted was not executed -- )
Accepted (Gui fills selPro with 1 and 0 depending on the state of qtree)
RequestData (Does nothing since selVec is all 0 )
2nd call
SetActivateSelVec (Server: fills selVec – this time correctly since Accepted was already call in the first call and selPro has correct values )
Accepted (Gui fills selPro with 1 and 0 depending on the state of qtree , which is the same as the 1st call )
RequestData (Works since selVec has 1 and 0 from ActivateSelVec in the second call )
In 4.3.1 does not work because the sequence is called once !!
1st call
SetActivateSelVec (Server: fills selVec – with zeros only since accepted was not executed -- )
Accepted (Gui fills selPro with 1 and 0 depending on the state of qtree)
RequestData (Does nothing since selVec is all 0 ) !!!!
The problem is that in 4.3.1 This sequence is called only once .
Another reformulation of my question will be : How can I send values to RequestData from the GUI ?
Any help will be greatly appreciated
Regards
Orlando Rivera
PS My files look like this
--------------------------
pqReader.cxx:
pqReader::pqReader //GUI constructor
{
this->selPro=vtkSMIntVectorProperty::SafeDownCast(this->proxy()->GetProperty( "ActivateSelVec" ));
}
-----------------------------
Reader.xml:
<ServerManagerConfiguration>
<ProxyGroup name="sources">
….
<IntVectorProperty name="ActivateSelVec"
command="SetActivateSelVec
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="1"
use_index="1"
default_values="0"
label="ActivateStructure">
</IntVectorProperty>
</ServerManagerConfiguration>
-----------------
vtkReader.cxx
void vtkReader:: SetActivateSelVe (int idx, int flag);
{
selPro->InsertTuple1(idx,flag);
}
Int vtkReader::RequesData(…)
{
/* getData using selPro */
}
--
MTU Aero Engines AG
Vorstand/Board of Management: Reiner Winkler, Vorsitzender/CEO; Dr. Rainer Martens, Michael Schreyoegg
Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Klaus Eberhardt
Sitz der Gesellschaft/Registered Office: Muenchen
Handelsregister/Commercial Register: Muenchen HRB 157206
Diese E-Mail sowie ihre Anhaenge enthalten MTU-eigene vertrauliche oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte den Absender und loeschen Sie diese
E-Mail sowie die Anhaenge. Das unbefugte Speichern, Kopieren oder Weiterleiten ist nicht gestattet.
This e-mail and any attached documents are proprietary to MTU, confidential or protected by law.
If you are not the intended recipient, please advise the sender and delete this message and its attachments.
Any unauthorised storing, copying or distribution is prohibited.
_______________________________________________
Powered by www.kitware.com<http://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:
http://public.kitware.com/mailman/listinfo/paraview-developers
--
MTU Aero Engines AG
Vorstand/Board of Management: Reiner Winkler, Vorsitzender/CEO; Dr. Rainer Martens, Michael Schreyoegg
Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Klaus Eberhardt
Sitz der Gesellschaft/Registered Office: Muenchen
Handelsregister/Commercial Register: Muenchen HRB 157206
Diese E-Mail sowie ihre Anhaenge enthalten MTU-eigene vertrauliche oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte den Absender und loeschen Sie diese
E-Mail sowie die Anhaenge. Das unbefugte Speichern, Kopieren oder Weiterleiten ist nicht gestattet.
This e-mail and any attached documents are proprietary to MTU, confidential or protected by law.
If you are not the intended recipient, please advise the sender and delete this message and its attachments.
Any unauthorised storing, copying or distribution is prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20150615/d783becf/attachment-0001.html>
More information about the Paraview-developers
mailing list