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

Maxim Glibin maxim.glibin at gmail.com
Fri Dec 12 09:15:00 EST 2014


This is what is needed.
This plugin doesn't display the button and even doesn't create it until
this widget will not be defined in the proxy group representation of
plugin, does it?
<ServerManagerConfiguration>
  <ProxyGroup name="representations">
    <RepresentationProxy name="MyRepresentation"
                         class="vtkPVMyRepresentation"
                         processes="client|renderserver|dataserver"
                         base_proxygroup="representations"
                         base_proxyname="SurfaceRepresentation">
    </RepresentationProxy>
    <Extension name="UnstructuredGridRepresentation">
      <RepresentationType subproxy="MyRepresentation"
                          subtype="Surface"
                          text="Annotation" />
      <SubProxy>
        <Proxy name="MyRepresentation"
               proxygroup="representations"
               proxyname="MyRepresentation">
        </Proxy>
        <ShareProperties subproxy="SurfaceRepresentation">
          <Exception name="Input" />
          <Exception name="Visibility" />
          <Exception name="Representation" />
        </ShareProperties>
        <ExposedProperties>
          <PropertyGroup panel_visibility="default"
panel_widget="ColorEditor" label="Coloring" />
        </ExposedProperties>
      </SubProxy>
    </Extension>
  </ProxyGroup>
</ServerManagerConfiguration>
Am I right?


2014-12-12 16:56 GMT+03:00 Maxim Glibin <maxim.glibin at gmail.com>:

> This is what is needed.
> But this simple plugin doesn't show push-button and entirely
>
> 2014-12-12 1:21 GMT+03:00 Utkarsh Ayachit <utkarsh.ayachit at kitware.com>:
>
>> Well I am a little lost what you're trying to do. In any case, attached
>> is simple plugin to add a push-button to the ColorEditorWidget by extending
>> it. Now when I show any data in the render view, its "Coloring" widget has
>> my button on it.
>>
>> Utkarsh
>>
>> On Thu, Dec 11, 2014 at 7:03 AM, Maxim Glibin <maxim.glibin at gmail.com>
>> wrote:
>>
>>> Thank you, Utkarsh.
>>> I already resolved this problem yesterday.
>>>
>>> I have registered my widget:
>>> ADD_PARAVIEW_PROPERTY_GROUP_WIDGET(IFACES1 IFACE_SRC1
>>>     TYPE "ColorEditor"
>>>     CLASS_NAME pqExtraColorEditorPropertyWidget
>>>     )
>>> How should I initialize the property group and property widget in
>>> representation of server manager XML?
>>>
>>> Are there any examples that utilize a similar logic.
>>>
>>> How can I add a property widget to the property group? (via XML or on
>>> the level of propertyWidget class)
>>>
>>> At the moment I did the following:
>>> <ProxyGroup name="representations">
>>>     <RepresentationProxy name="MyRepresentation"
>>>                          class="vtkPVMyRepresentation"
>>>                          processes="client|renderserver|dataserver"
>>>                          base_proxygroup="representations"
>>>                          base_proxyname="SurfaceRepresentation">
>>>       <Property name="Annotation"
>>>                 label="Annotation"
>>>                 command="Annotate"
>>>                 panel_widget="AnnotationButton">
>>>       </Property>
>>>     </RepresentationProxy>
>>>
>>>     <Extension name="UnstructuredGridRepresentation">
>>>       <RepresentationType subproxy="MyRepresentation"
>>>                           subtype="Surface"
>>>                           text="Annotation" />
>>>       <SubProxy>
>>>         <Proxy name="MyRepresentation"
>>>                proxygroup="representations"
>>>                proxyname="MyRepresentation">
>>>         </Proxy>
>>>         <ShareProperties subproxy="SurfaceRepresentation">
>>>           <Exception name="Input" />
>>>           <Exception name="Visibility" />
>>>           <Exception name="Representation" />
>>>         </ShareProperties>
>>>         <ExposedProperties>
>>>           <PropertyGroup panel_visibility="default"
>>> panel_widget="ColorEditor" label="Coloring">
>>>             <Property name="Ambient" />
>>>             <Property name="AmbientColor" />
>>>             <Property name="ColorArrayName" />
>>>             <Property name="Diffuse" />
>>>             <Property name="DiffuseColor" />
>>>             <Property name="LookupTable" />
>>>             <Property name="AnnotationGroups" />
>>>           </PropertyGroup>
>>>         </ExposedProperties>
>>>       </SubProxy>
>>>     </Extension>
>>>   </ProxyGroup>
>>>
>>> Where did I go wrong?
>>>
>>> Thanks,
>>> Maxim
>>>
>>> 2014-12-09 16:19 GMT+03:00 Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
>>> :
>>>
>>>> To overcome the build issue, just add the following line to your
>>>> CMakeLists.txt file after the add_paraview_plugin() call.
>>>>
>>>> target_link_libraries(<pluginname> pqApplicationComponents)
>>>>
>>>> Utkarsh
>>>>
>>>> On Mon, Dec 8, 2014 at 8:05 AM, Maxim Glibin <maxim.glibin at gmail.com>
>>>> wrote:
>>>>
>>>>> 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
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Yours Sincerely,
>>> *GLIBIN Maxim O.* - Developer
>>> Phone : +7 (987) 533 00 55
>>> Email: maxim.glibin at gmail.com
>>>
>>>
>>
>
>
> --
> Yours Sincerely,
> *GLIBIN Maxim O.* - Developer
> Phone : +7 (987) 533 00 55
> Email: maxim.glibin at gmail.com
>
>


-- 
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/20141212/1a46f729/attachment-0001.html>


More information about the Paraview-developers mailing list