[Paraview] Changing "Representation" toolbar

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Jan 19 13:20:15 EST 2009


Jerome,

You can use:
  pqViewManager * viewmgr = qobject_cast<pqViewManager*>(
    pqApplicationCore::instace()->manager("MULTIVIEW_MANAGER"));
to get the view manager.

Before even creating your render views, you can simply split the
frames and create empty frames layed out the way you want. Then create
the views. pqViewManager will automatically assign those views to
already existing empty frames.

Utkarsh


On Mon, Jan 19, 2009 at 6:56 AM, Jérôme <jerome.velut at gmail.com> wrote:
> 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
>>>
>>
>


More information about the ParaView mailing list