[Paraview] Changing "Representation" toolbar

Jérôme jerome.velut at gmail.com
Mon Jan 19 07:08:01 EST 2009


Hi,

Thanks for your answer. It is helpful.
Now, I would like to initiate an action when the user presses a
toolbar button that divides the GUI into 4 independent view frames (
as opposed to "Comparative" where there is only one frame with several
renderers).

I coded that inside the onAction function:

void MyToolbarAction::onAction(QAction* a)
{
  pqApplicationCore* core = pqApplicationCore::instance();
  pqObjectBuilder* builder = core->getObjectBuilder();
  pqServerManagerModel* sm = core->getServerManagerModel();

  QString actionStr = a->data().toString();
  if( actionStr == QString("Configure") )
  {
     pqServer* server = sm->getItemAtIndex<pqServer*>(0);
     if( server )
     {
        builder->createView( "RenderView", server );
        builder->createView( "RenderView", server );
        builder->createView( "RenderView", server );
     }
  }
}

The problem is that this way splits the current view frame (I think
so, but I didn't manage to track the code until the
splitVertical/Horizontal functions). And the result is attached
(paraview_tile_result.jpg) : this is not a regular tile of the
interface.

I tried, but it was unsuccessful, to get the ActiveView::instance,
then set the ActiveView::current(), and so on. But nothing changed.
How can I access the pqView, pqViewManager, pqMainWindowCore instances
inside my plugin? I think this is the way to handle the layout of the
main window.

If I am wrong, what is the best way to get automatically an interface
as in paraview_tile_expected.jpg?

Thanks a lot !

Regards,

Jerome

2009/1/16 Utkarsh Ayachit <utkarsh.ayachit at kitware.com>:
> Jerome,
>
> It's definitely possible using a plugin to create a new toolbar that
> acts as both the representation chooser as well as slice selector.
> Look at the toolbar plugin example on the Wiki and then look at
> pqDisplayRepresentationWidget ( in
> Qt/Components/pqDisplayRepresentationWidget.h|cxx) to see the code for
> the  current representation toolbar.
>
> pqDisplayRepresentationWidget is indeed the representation toolbar, so
> for simply changing the source code, that's the one you should be
> looking at.
>
> Utkarsh
>
> On Fri, Jan 16, 2009 at 3:28 AM, Jérôme <jerome.velut at gmail.com> wrote:
>> Hi,
>>
>> I wonder how I can add the "slice" slider of a slice representation in
>> the representation toolbar. First, is it possible within a plugin ? If
>> not, I can make changes in ParaView source code, but I didn't find how
>> the combo box for the representation is added, so I cannot do the same
>> !
>>
>> Thanks a lot,
>>
>> Jerome
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: paraview_tile_result.jpg
Type: image/jpeg
Size: 33789 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090119/27899f17/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: paraview_tile_expected.jpg
Type: image/jpeg
Size: 33260 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090119/27899f17/attachment-0003.jpg>


More information about the ParaView mailing list