<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
I'm sorry I think a founded the problem , I didn't know that I had to create a new "pqLookupTableManager" myself and set it to pqApplicationCore::instance() with setLookupTableManager.<br><br>I had no problem with ObjectBuilder and PluginManager that I didn't needed to instantiate.<br><br>Is it a bug ?<br><br>Thanks <br><br><hr size="2" width="100%"><blockquote><blockquote><b>Wertz Gil</b><br></blockquote><i>gilwertz@hotmail.com</i><br></blockquote><hr size="2" width="100%"><br><br><br><br><hr id="stopSpelling">From: gilwertz@hotmail.com<br>To: utkarsh.ayachit@kitware.com<br>Date: Fri, 1 Apr 2011 08:23:21 +0200<br>CC: paraview@paraview.org<br>Subject: Re: [Paraview] pqColorScaleEditor crash<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>


I'm not sure of what I could give you ( I tried to debug with gdb but it just say that the application crash, I knew it -_- )<br><br>But I made a sandbox and have the same problem, the code is shorter, I'll give it.<br><br>I joined 3 files, the app file named paraview-crash-on-legend.cpp and my 3D widget.<br><br>By the way I'm open for all comment or idea of improvement or else about good practise.<br><br>Thanks for your fast answer !<br><br>I use :<br>Qt 4<br>Paraview 10.0-RC1.<br><br><hr size="2" width="100%"><blockquote><blockquote><b>Wertz Gil</b><br></blockquote><i>gilwertz@hotmail.com</i><br></blockquote><hr size="2" width="100%"><br><br><br><br>&gt; Date: Thu, 31 Mar 2011 10:40:46 -0400<br>&gt; Subject: Re: [Paraview] pqColorScaleEditor crash<br>&gt; From: utkarsh.ayachit@kitware.com<br>&gt; To: gilwertz@hotmail.com<br>&gt; CC: paraview@paraview.org<br>&gt; <br>&gt; Gil,<br>&gt; <br>&gt; If you can provide the call-stack for where you're getting the<br>&gt; segfault, it will be helpful.<br>&gt; <br>&gt; Utkarsh<br>&gt; <br>&gt; On Thu, Mar 31, 2011 at 10:13 AM, Gil Wertz &lt;gilwertz@hotmail.com&gt; wrote:<br>&gt; &gt; I'm making a program that make calculation and try to integrate some<br>&gt; &gt; Paraview stuff, every things goes fine, I have my render from the server,<br>&gt; &gt; but when I use pqColorScaleEditor, the dialog show himself, I can change<br>&gt; &gt; color depending on scale but when I check the legend checkbox, the<br>&gt; &gt; application crash and I have no idea why ...<br>&gt; &gt;<br>&gt; &gt; Part of my code :<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; void Widget3D::show_color_editor(){<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scaleEdit = new pqColorScaleEditor(m_RenderView-&gt;getWidget());<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pqDataRepresentation* repr = m_input-&gt;getRepresentation(m_RenderView);<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scaleEdit-&gt;setRepresentation(repr);<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scaleEdit-&gt;show();<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; }<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; void Widget3D::createView(){<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(m_server){<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // create a graphics window and put it in our main window<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;m_RenderView = qobject_cast&lt;pqRenderView*&gt;(<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_object_builder-&gt;createView(pqRenderView::renderViewType(),<br>&gt; &gt; m_server));<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(m_RenderView){<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_layout_v-&gt;insertWidget(0,this-&gt;m_RenderView-&gt;getWidget());<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //NLog::globalLog()-&gt;addError("Problem when creating a<br>&gt; &gt; RenderView.");<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //NLog::globalLog()-&gt;addError("Cannot create RenderView if no<br>&gt; &gt; paraview server connection is set.");<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; }<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; void Widget3D::showRender()<br>&gt; &gt; &nbsp;&nbsp;&nbsp; {<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(m_source){<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_input = m_source;//m_filter2;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; m_object_builder-&gt;createDataRepresentation(m_input-&gt;getOutputPort(0),<br>&gt; &gt; this-&gt;m_RenderView);<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; changeStyle();<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pqDataRepresentation* repr =<br>&gt; &gt; m_input-&gt;getRepresentation(m_RenderView);<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; this-&gt;m_color-&gt;setRepresentation(m_input-&gt;getRepresentation(m_RenderView));<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; //this-&gt;scaleEdit-&gt;setRepresentation(m_input-&gt;getRepresentation(m_RenderView));<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qDebug() &lt;&lt; repr-&gt;getLookupTable();<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //m_RenderView-&gt;get<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qDebug() &lt;&lt; repr-&gt;getLookupTableProxy();<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // zoom to object<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;m_RenderView-&gt;resetCamera();<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // make sure we update<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;m_RenderView-&gt;render();<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //NLog::globalLog()-&gt;addError("There is no file to render.");<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; &gt; &nbsp;&nbsp;&nbsp; }<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; Widget3D::Widget3D(QWidget *parent) :<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QWidget(parent)<br>&gt; &gt; &nbsp;&nbsp;&nbsp; {<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // automatically make a server connection<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_core = pqApplicationCore::instance();<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_object_builder = m_core-&gt;getObjectBuilder();<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Register ParaView interfaces.<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_plugin_manager = m_core-&gt;getPluginManager();<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // adds support for standard paraview views.<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_plugin_manager-&gt;addInterface(new<br>&gt; &gt; pqStandardViewModules(m_plugin_manager));<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; createView();<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; showRender();<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; connect(m_show_color_palet,SIGNAL(released()),this,SLOT(show_color_editor()));<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; }<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; You'll notice that I use client - server paraview architecture. What is<br>&gt; &gt; strange is that I have no problem seting color on my mesh but the legend<br>&gt; &gt; make the application crash.<br>&gt; &gt;<br>&gt; &gt; I tryed different things like :<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scaleEdit = new pqColorScaleEditor(m_RenderView-&gt;getWidget());<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scaleEdit-&gt;show();<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp; =&gt; it show me that there is no map ta set the legend... So I think it<br>&gt; &gt; found the map<br>&gt; &gt;<br>&gt; &gt; Maybe the problem is that the rendering is made in server side, but I did<br>&gt; &gt; not have problems with "pqDisplayColorWidget" that also use<br>&gt; &gt; pqDataRepresentation.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Thanks for any idea, if you need the full code I can provide it.<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt;<br>&gt; &gt; Wertz Gil<br>&gt; &gt;<br>&gt; &gt; gilwertz@hotmail.com<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Powered by www.kitware.com<br>&gt; &gt;<br>&gt; &gt; Visit other Kitware open-source projects at<br>&gt; &gt; http://www.kitware.com/opensource/opensource.html<br>&gt; &gt;<br>&gt; &gt; Please keep messages on-topic and check the ParaView Wiki at:<br>&gt; &gt; http://paraview.org/Wiki/ParaView<br>&gt; &gt;<br>&gt; &gt; Follow this link to subscribe/unsubscribe:<br>&gt; &gt; http://www.paraview.org/mailman/listinfo/paraview<br>&gt; &gt;<br>&gt; &gt;<br>                                               
<br>_______________________________________________
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                                               </body>
</html>