<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi,<br><br>The tutorial works fine :) It was my bad...<br>But, I would like to know if there's an easier way for doing this display ?<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">De :</span></b> R M <mlokida@yahoo.fr><br><b><span style="font-weight: bold;">À :</span></b> R M <mlokida@yahoo.fr>; paraview@paraview.org<br><b><span style="font-weight: bold;">Envoyé le :</span></b> Lun 20 décembre 2010, 17h 22min 57s<br><b><span style="font-weight: bold;">Objet :</span></b> Re : [Paraview] Problem -> How to display informations in a plugin GUI ?<br></font><br><meta
http-equiv="x-dns-prefetch-control" content="off"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Hi,<br><br>I have not yet found the solution. <span>I have followed this example: <a rel="nofollow" target="_blank" href="http://www.paraview.org/pipermail/paraview/2008-November/010217.html">http://www.paraview.org/pipermail/paraview/2008-November/010217.html</a> but still have problems.</span><br>In my plugin xml file I have this:<br><br><DoubleVectorProperty<br> show="1"<br> name="Result"<br> label="Result<br> command="GetResult"<br> number_of_elements="1"<br> default_values="0"<br>
information_only="1"><br> <SimpleDoubleInformationHelper /><br> </DoubleVectorProperty><br><br>In my plugin source file, I have this:<br>double GetResult()<br>
{<br>
return m_result;<br>
}<br><br>I have a class that inherit from pqAutoGeneratedObjectPanel:<br>#include "MyPluginPanel.h"<br><br>#include <QLineEdit><br><br>#include "vtkSMDoubleVectorProperty.h"<br>#include "vtkSMProperty.h"<br>#include "vtkSMProxy.h"<br><br>MyPluginPanel::MyPluginPanel(pqProxy* object_proxy, QWidget* _parent)<br>:pqAutoGeneratedObjectPanel(object_proxy, _parent)<br>{<br> p_resultWidget = this->findChild<QLineEdit*>("Result");<br> <br> if( this->findChild<QLineEdit*>("Resylt") )<br> {<br> qWarning() << "NULL Widget Pointer";<br> return;<br> }<br><br> p_resultWidget->setReadOnly(true);<br>}<br><br>MyPluginPanel::~MyPluginPanel()<br>{}<br><br>void MyPluginPanel::updateInformationAndDomains()<br>{<br>
pqAutoGeneratedObjectPanel::updateInformationAndDomains();<br> updateDoubleValue(p_resultWidget, "Result", 0);<br>}<br><br>void MyPluginPanel::updateDoubleValue(QLineEdit* qLineEdit, QString property, qint32 index)<br>{ <br> vtkSMProperty* smProperty = this->proxy()->GetProperty(property.toAscii());<br> if (!smProperty)<br> {<br> qWarning() << "SMProperty [double] was NULL for " << property.toAscii();<br> return;<br> }<br> vtkSMDoubleVectorProperty* dvp = vtkSMDoubleVectorProperty::SafeDownCast(smProperty);<br> <br> double value = dvp->GetElement(index);<br> <br> qLineEdit->setText(QString::number(value)); <br>}<br><br>The problem is that the widget resultWidget is always NULL. But I can have the good result.<br><br>So, what's wrong
with my code ?<br><br>Why the widget doesn't appear in the GUI plugin in Paraview ?<br><br>Thank you for your attention and your advice.<br><br><br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">De :</span></b> R M <mlokida@yahoo.fr><br><b><span style="font-weight: bold;">À :</span></b> paraview@paraview.org<br><b><span style="font-weight: bold;">Envoyé le :</span></b> Mer 15 décembre 2010, 10h 12min 20s<br><b><span style="font-weight: bold;">Objet :</span></b> [Paraview] Problem -> How to display informations in a plugin GUI ?<br></font><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>Hi,<br><br>I develop a plugin that and in its corresponding xml file, I have a doubleVectorProperty in which I would like to write the
result of my filter and I don't want to make it editable.<br>So, I am looking for some examples of doing this beacause I really don't know how to do this and that make a while I want to make it. I have found nothing about this in the Paraview Guide book.<br><br>Here's what I have written in the plugin xml file:<br><br><DoubleVectorProperty<br> name="GetResult"<br> command="GetResult"<br> information_only="1"><br> <SimpleDoubleInformationHelper/><br>
</DoubleVectorProperty><br> <br> <DoubleVectorProperty<br> name="Result"<br> command="SetResult<br> number_of_elements="1"<br> default_values="0.0"<br> information_property="GetResult"><br> </DoubleVectorProperty><br><br>and the code in the source is:<br>double GetResult()<br>
{<br>
return m_result;<br>
}<br>
<br>void SetResult(double value)<br>{<br> m_result = value;<br>}<br><br>Then, in my code, when I would like to update this lineedit in the plugin GUI I call SetResult(myResult). But nothing happen and the lineedit in the plugin GUI is editable (which I don't want).<br><br>Thank you for your advise.<br><br><br></div>
</div><br>
</div></div>
</div><br>
<meta http-equiv="x-dns-prefetch-control" content="on"></div></div>
</div><br>
</body></html>