[Paraview-developers] Access to the color legend and its modification

Maxim Glibin maxim.glibin at gmail.com
Mon Dec 8 08:05:48 EST 2014


Dear Utkarsh,

Thanks a lot for your help.
But I am not still understand how you can create a widget in the "Display"
panel without overriding the standard widgets (like Color Editor).
Is it possible to show a widget only within the selected filter?

I have tried to subclass pqColorEditorPropertyWidget and I have compilation
problems:
2>moc_pqMyColorEditorPropertyWidget.obj : error LNK2019: unresolved
external symbol "__declspec(dllimport) public: virtual void * __thiscall
pqColorEditorPropertyWidget::qt_metacast(char const *)" (__
imp_?qt_metacast at pqColorEditorPropertyWidget@@UAEPAXPBD at Z) referenced in
function "public: virtual void * __thiscall
pqMyColorEditorPropertyWidget::qt_metacast(char const *)"
(?qt_metacast at pqMyColorEditorPropertyWidget@@UAEPAXPBD at Z)
2>moc_pqMyColorEditorPropertyWidget.obj : error LNK2019: unresolved
external symbol "__declspec(dllimport) public: virtual int __thiscall
pqColorEditorPropertyWidget::qt_metacall(enum QMetaObject::Cal
l,int,void * *)" (__imp_?qt_metacall at pqColorEditorPropertyWidget
@@UAEHW4Call at QMetaObject@@HPAPAX at Z) referenced in function "public: virtual
int __thiscall pqMyColorEditorPropertyWidget::qt_metacall(en
um QMetaObject::Call,int,void * *)"
(?qt_metacall at pqMyColorEditorPropertyWidget@@UAEHW4Call at QMetaObject
@@HPAPAX at Z)
2>moc_pqMyColorEditorPropertyWidget.obj : error LNK2001: unresolved
external symbol "__declspec(dllimport) public: static struct QMetaObject
const pqColorEditorPropertyWidget::staticMetaObject" (__imp
_?staticMetaObject at pqColorEditorPropertyWidget@@2UQMetaObject@@B)
2>pqMyColorEditorPropertyWidget.obj : error LNK2019: unresolved external
symbol "__declspec(dllimport) public: __thiscall
pqColorEditorPropertyWidget::pqColorEditorPropertyWidget(class vtkSMProxy
*,cl
ass QWidget *)" (__imp_??0pqColorEditorPropertyWidget@@QAE at PAVvtkSMProxy
@@PAVQWidget@@@Z) referenced in function "public: __thiscall
pqMyColorEditorPropertyWidget::pqMyColorEditorPropertyWidget(class
vtkSMProxy *,class vtkSMProperty *,class QWidget *)"
(??pqMyColorEditorPropertyWidget@@QAE at PAVvtkSMProxy@@PAVvtkSMProperty@
@PAVQWidget@@@Z)
2>pqMyColorEditorPropertyWidget.obj : error LNK2019: unresolved external
symbol "__declspec(dllimport) public: virtual __thiscall
pqColorEditorPropertyWidget::~pqColorEditorPropertyWidget(void)" (__im
p_??1pqColorEditorPropertyWidget@@UAE at XZ) referenced in function "public:
virtual __thiscall
pqMyColorEditorPropertyWidget::~pqMyColorEditorPropertyWidget(void)"
(??1pqMyColorEditorPropertyWidget@@UAE
@XZ)

Best regards,
Maxim

2014-12-07 19:55 GMT+03:00 Utkarsh Ayachit <utkarsh.ayachit at kitware.com>:

> > 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
> >
>



-- 
Yours Sincerely,
*GLIBIN Maxim O.* - Developer
Phone : +7 (987) 533 00 55
Email: maxim.glibin at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20141208/85c02883/attachment.html>


More information about the Paraview-developers mailing list