[Paraview-developers] Access to the color legend and its modification
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Sun Dec 7 11:55:14 EST 2014
> 1. How can I assign my custom button into 'Display' panel?
I am assuming you're using ParaView 4.2. There's no "Display" panel in
ParaView 4.2, but simply the Properties panel that shows
pqPropertyWidget instances for properties on proxies. The widget that
allows users to pick the array to color with is called
pqColorEditorPropertyWidget [1]. The Panel creates this widget when it
encounters a property group that requests 'ColorEditor' as the
"panel_widget" [2]. In your plugin, you can either subclass
pqColorEditorPropertyWidget or create a new one that you'd want to use
whenever "ColorEditor" widget is requested by any proxy. You can
register your widget for the TYPE set to "ColorEditor" in
add_paraview_property_group_widget() [3] and your widget will be used
instead of the default pqColorEditorPropertyWidget in the panel.
> 2. How can I get an instance of color legend to change annotations by using
> input or output information of filter?
Now entirely sure what you're looking for, but here's a way:
a). first track down the lookup-table ( transfer function) proxy of
interest. You can get it several ways: using the "LookupTable"
property on the "representation" proxy providing the data being
colored, or by using vtkSMTransferFunctionManager [4]. Once you have
the transfer function proxy, you can locate the legend for that in a
view using vtkSMTransferFunctionProxy::FindScalarBarRepresentation()
[5]. Look at the implementation for
vtkSMPVRepresentationProxy::SetScalarBarVisibility(); that'll give you
some hints.
[1] http://www.paraview.org/ParaView3/Doc/Nightly/www/cxx-doc/classpqColorEditorPropertyWidget.html
[2] http://www.paraview.org/ParaView3/Doc/Nightly/www/cxx-doc/classpqStandardPropertyWidgetInterface.html#a83531c3804ae704d71dc917706e2e40e
[3] http://www.paraview.org/Wiki/Plugin_HowTo#Adding_Customizations_for_Properties_Panel
[4] http://www.paraview.org/ParaView3/Doc/Nightly/www/cxx-doc/classvtkSMTransferFunctionManager.html
[5] http://www.paraview.org/ParaView3/Doc/Nightly/www/cxx-doc/classvtkSMTransferFunctionProxy.html#ac50a4c96be88696ca032048efc6c965a
On Fri, Dec 5, 2014 at 2:05 AM, Maxim Glibin <maxim.glibin at gmail.com> wrote:
> Hello all,
>
> I am interested in creating a plugin filter that will change the color
> legend by pressing a button as shown at the attached picture.
>
> And I have a few questions:
> 2. How can I get an instance of color legend to change annotations by using
> input or output information of filter?
>
> Best regards,
> Maxim
>
> --
> Yours Sincerely,
> GLIBIN Maxim O. - Developer
> Phone : +7 (987) 533 00 55
> Email: maxim.glibin at gmail.com
>
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
More information about the Paraview-developers
mailing list