[Paraview] pqColorScaleEditor crash

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Apr 1 09:48:12 EDT 2011


No, lookup table management is application specific and hence we don't
create any by default, it's set to null. Such kind of segfaults should
have been easily caught in the debugger. You want to ensure that you
are doing a "debug" build (by setting the CMAKE_BUILD_TYPE to Debug in
cmake stage).

Utkarsh

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


More information about the ParaView mailing list