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
[email protected]


                                          
_______________________________________________
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

Reply via email to