<div dir="ltr">Hi Orlando,<div><br></div><div>Thanks for reporting back that you solved your problem. Indeed, that should be a much faster way to set elements in a large vector property.</div><div><br></div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 6, 2015 at 6:46 AM, RIVERA ROLDAN, Jorge Orlando <span dir="ltr"><<a href="mailto:Orlando.RIVERA@mtu.de" target="_blank">Orlando.RIVERA@mtu.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Hi
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Maybe someone may be interested, I solve the problem using
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">A->SetElements(vectorWithStates)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Instead of :<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">for (int i=0;i< A->GetNumberOfElements;i++)<u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">A->SetElement(I, [0|1] ) ;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> RIVERA ROLDAN, Jorge Orlando
<br>
<b>Gesendet:</b> Tuesday, 29. September 2015 13:01<br>
<b>An:</b> <a href="mailto:paraview-developers@paraview.org" target="_blank">paraview-developers@paraview.org</a><br>
<b>Betreff:</b> load State slow by remembering the states checked/ unchecked<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Dear Forum members
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">I hope you can help me with something I am dealing with .<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">I have a reader base on a vtkMultiBlock , the data layout of the multiblock will be represented by a qtree on the client/GUI , so the Data layout
will be one to one to the qtree widget <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">like this:
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">- vtkMB (0)
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">- - vtkMB (1)
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">- - - vtkMB (2)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">- - - - grid (3)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">- - - - grid (4)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">- - - vtkMB (5)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">- - - - grid (6<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">- - - - grid (7) …
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">There is a vtkSMIntVectorProperty (A) that connects the Qtree(GUI) with the Server . The corresponding intArray (B) on the server side follows
simply the indexes on the MB tree {0,1,2,3,4,5,6,7…} so at server and GUI both arrays (A)-(B) mirror each other.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">So when I select an element on the qtree widget , lets say (3) (A[3]=1) . Then at the server B[3]=1 and the grid 3 will be read and loaded
. When I select in the qtree (2) , then A[2]=1 , that means also, A[3]=1 and A[4]=1 , ( 3 and 4 being children of 2) are to be read and loaded i.e. B[2]=1, B[3]=1 and B[4]=1.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">In normal operation all woks like a charm. However, when I save the state following behavior can be observer . In the state-xml file the pipeline
is saved normally , so the state of intArray is saved (vector B) , the data is read and loaded in requesData and I have my representation as supposed to be.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">The Data Layout will be them transferred to the GUI with a vtkSMStringVectorProperty and the state of checked and unchecked with the vtkSMIntVectorProperty
vector (A) , so far so good. Now , when I check and /or uncheck other elements on the Qtree/GUI the response time is quite lame. With the debugger I could see that the time is used in A->SetValue(index, 1) (1 for checked and 0 for unchecked ) .
Since a have a couple or thousand of elements in my tree (Qtree), this takes several minutes, but **ONLY when LOAD STATE is used ** .
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">The function in the GUI that contains A->SetValue(index, CHECKED/UNCHECKED ) works really fast when I load my example normally (open File ,
apply plugins and filters ). The same Function is very slow ( A->SetValue(index, CHECKED/UNCHECKED ) ) when loaded from a SAVE and LOAD state.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">What could be the cause ? do you have any Idea or have observed similar behavior?
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Thanks in Advance
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Orlando Rivera
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
</div>
</div>
</div>
</div></div></div><div><div class="h5">
<span style="font-size:8.0pt;font-family:"Arial";color:silver">--</span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver"><strong>MTU Aero Engines AG</strong></span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">Vorstand/Board of Management: Reiner Winkler, Vorsitzender/CEO; Dr. Rainer Martens, Michael Schreyoegg</span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Klaus Eberhardt</span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">Sitz der Gesellschaft/Registered Office: Muenchen</span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">Handelsregister/Commercial Register: Muenchen HRB 157206</span><br>
<br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">Diese E-Mail sowie ihre Anhaenge enthalten MTU-eigene vertrauliche oder rechtlich geschuetzte Informationen.</span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte den Absender und loeschen Sie diese</span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">E-Mail sowie die Anhaenge. Das unbefugte Speichern, Kopieren oder Weiterleiten ist nicht gestattet.</span><br>
<br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">This e-mail and any attached documents are proprietary to MTU, confidential or protected by law.</span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">If you are not the intended recipient, please advise the sender and delete this message and its attachments.</span><br>
<span style="font-size:8.0pt;font-family:"Arial";color:silver">Any unauthorised storing, copying or distribution is prohibited.</span><br>
</div></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>