<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.3">
</HEAD>
<BODY>
<BR>
Ok, I'm still not having much luck with creating my own proxy group and associated menu. Using the 3.11.1 code from the git i have the following menu builder routine:<BR>
<BR>
void pqParaView2MenuBuilders::buildFiltersMenu(QMenu& menu, QMainWindow* mainWindow)<BR>
{<BR>
         pqProxyGroupMenuManager* mgr = new pqProxyGroupMenuManager(&menu, "ParaViewFilters2");<BR>
         mgr->addProxyDefinitionUpdateListener("filters2");<BR>
         mgr->setRecentlyUsedMenuSize(10);<BR>
<BR>
         new pq2FiltersMenuReaction(mgr);<BR>
         pqPVApplicationCore::instance()->registerForQuicklaunch(&menu);<BR>
}<BR>
<BR>
<BR>
And a plugin filter specified as <BR>
<BR>
<ProxyGroup name="filters2"><BR>
<SourceProxy name="MyElevationFilter" class="vtkMyElevationFilter" label="MyElevation"><BR>
...<BR>
</ProxyGroup><BR>
<BR>
The pq2FiltersMenuReaction class is a copy of the class pqFiltersMenuReaction. <BR>
<BR>
I have discovered at least one area where things are going wrong. For some reason the new menu manager class is not created with any actions so the foreach loop in the updateEnableState is never entered.<BR>
<BR>
pqProxyGroupMenuManager* mgr =<BR>
static_cast<pqProxyGroupMenuManager*>(this->parent());<BR>
mgr->setEnabled(enabled);<BR>
bool some_enabled = false;<BR>
<BR>
foreach (QAction* action, mgr->actions())<BR>
{<BR>
... [ never goes in here ]<BR>
}<BR>
<BR>
Any suggestions? Is there anything special you need to define to initialize your own proxy groups either in the plugin or as part of the main app?<BR>
<BR>
Kit<BR>
<BR>
<BR>
<BR>
On Tue, 2011-06-14 at 09:16 -0400, Utkarsh Ayachit wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Use pqProxyGroupMenuManager::addProxyDefinitionUpdateListener() to set</FONT>
<FONT COLOR="#000000">the group to listen to for updates (assuming you are using</FONT>
<FONT COLOR="#000000">git-master/3.11.1)</FONT>
<FONT COLOR="#000000">Utkarsh</FONT>
<FONT COLOR="#000000">On Tue, Jun 14, 2011 at 7:26 AM, Kit Chambers</FONT>
<FONT COLOR="#000000"><<A HREF="mailto:kit.chambers@rocktalkimaging.com">kit.chambers@rocktalkimaging.com</A>> wrote:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Ok,</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Here's what I have so far:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> The filters for the new menu are given a different ProxyGroup name ("myfiltergroup" ) in the XML i.e</FONT>
<FONT COLOR="#000000">> <ServerManagerConfiguration></FONT>
<FONT COLOR="#000000">> <ProxyGroup name="myfiltergroup"></FONT>
<FONT COLOR="#000000">> <SourceProxy name="MyCellDerivatives" class="vtkCellDerivatives" label="My Cell Derivatives"></FONT>
<FONT COLOR="#000000">> <Documentation</FONT>
<FONT COLOR="#000000">> long_help="Create point attribute array by projecting points onto an elevation vector."</FONT>
<FONT COLOR="#000000">> short_help="Create a point array representing elevation."></FONT>
<FONT COLOR="#000000">> </Documentation></FONT>
<FONT COLOR="#000000">> <InputProperty</FONT>
<FONT COLOR="#000000">> name="Input"</FONT>
<FONT COLOR="#000000">> command="SetInputConnection"></FONT>
<FONT COLOR="#000000">> <ProxyGroupDomain name="filters"></FONT>
<FONT COLOR="#000000">> <Group name="sources"/></FONT>
<FONT COLOR="#000000">> <Group name="filters"/></FONT>
<FONT COLOR="#000000">> </ProxyGroupDomain></FONT>
<FONT COLOR="#000000">> <DataTypeDomain name="input_type"></FONT>
<FONT COLOR="#000000">> <DataType value="vtkDataSet"/></FONT>
<FONT COLOR="#000000">> </DataTypeDomain></FONT>
<FONT COLOR="#000000">> </InputProperty></FONT>
<FONT COLOR="#000000">> </SourceProxy></FONT>
<FONT COLOR="#000000">> </ProxyGroup></FONT>
<FONT COLOR="#000000">> </ServerManagerConfiguration></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Then I define a menu builder function which is called from the MainWindow app.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> void MyMenuBuilders::buildSecondFiltersMenu(QMenu* menu, QMainWindow* mainWindow)</FONT>
<FONT COLOR="#000000">> {</FONT>
<FONT COLOR="#000000">> pqProxyGroupMenuManager* mgr =</FONT>
<FONT COLOR="#000000">> new pqProxyGroupMenuManager(menu, "mysetfilters");</FONT>
<FONT COLOR="#000000">> mgr->setRecentlyUsedMenuSize(10);</FONT>
<FONT COLOR="#000000">> new RosieProcessingMenuReactions(mgr);</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> new pqUpdateProxyDefinitionsBehavior(</FONT>
<FONT COLOR="#000000">> pqUpdateProxyDefinitionsBehavior::ANY, "myfiltergroup", mgr);</FONT>
<FONT COLOR="#000000">> pqPVApplicationCore::instance()->registerForQuicklaunch(menu);</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> if (mainWindow)</FONT>
<FONT COLOR="#000000">> {</FONT>
<FONT COLOR="#000000">> // create toolbars for categories as needed.</FONT>
<FONT COLOR="#000000">> new pqCategoryToolbarsBehavior(mgr, mainWindow);</FONT>
<FONT COLOR="#000000">> }</FONT>
<FONT COLOR="#000000">> }</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> I can specify various filters to be loaded at startup by putting them inside the mysetfilters XML (i.e. just like the ParaViewFilters XML object). However, The when the above server manager XML is used a plugin it doesn't come up in the menu.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Any ideas as to what I'm missing here? Any guidance is welcome.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Kit</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> On Mon, 2011-06-13 at 16:27 -0400, Utkarsh Ayachit wrote:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> You are on the right track. Any proxy registered in the "filters" group from the plugins will automatically end up in the "Filters" menu, there's no way around it. The solution would be create a new group for your filters that's being shown in your menu. Theoretically, it should work, but I don't think we test it, but definitely worth a try.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Utkarsh</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> On Mon, Jun 13, 2011 at 3:43 PM, Kit Chambers <<A HREF="mailto:kit.chambers@rocktalkimaging.com">kit.chambers@rocktalkimaging.com</A>> wrote:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Dear all</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Is it possible to create a second filters menu which I specify plugin filters to be added to?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> I can create a static menu from the main application using pqProxyGroupMenuManager() with the appropriate XML but cannot work out how to specify make filters from plugins go to the new menu rather than the filters menu. I guess I would like to be able to do something like specify a ProxyGroup (i.e. <ProxyGroup name="MyGroup"> ... ) in the plugin XML which puts filters in the new menu rather than in with the filters as a normal <ProxyGroup name="filters"> does.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Any suggestions and or help is welcome.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Kit</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Kit Chambers</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Principal Geophysicist</FONT>
<FONT COLOR="#000000">> Office: +33 9 6418 7790</FONT>
<FONT COLOR="#000000">> Direct: +44 1872 879 007</FONT>
<FONT COLOR="#000000">> Mobile: +44 7816506558</FONT>
<FONT COLOR="#000000">> Email: <A HREF="mailto:kit.chambers@rocktalkimaging.com">kit.chambers@rocktalkimaging.com</A></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> NOTE: OUR WEBSITE AND EMAIL ADDRESSES HAVE CHANGED. TO ENSURE WE RECEIVE YOUR COMMUNICATION, PLEASE UPDATE YOUR RECORDS.</FONT>
<FONT COLOR="#000000">> _______________________________________________</FONT>
<FONT COLOR="#000000">> Powered by <A HREF="http://www.kitware.com">www.kitware.com</A></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Visit other Kitware open-source projects at <A HREF="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</A></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Please keep messages on-topic and check the ParaView Wiki at: <A HREF="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</A></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Follow this link to subscribe/unsubscribe:</FONT>
<FONT COLOR="#000000">> <A HREF="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</A></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Kit Chambers</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Principal Geophysicist</FONT>
<FONT COLOR="#000000">> Office: +33 9 6418 7790</FONT>
<FONT COLOR="#000000">> Direct: +44 1872 879 007</FONT>
<FONT COLOR="#000000">> Mobile: +44 7816506558</FONT>
<FONT COLOR="#000000">> Email: <A HREF="mailto:kit.chambers@rocktalkimaging.com">kit.chambers@rocktalkimaging.com</A></FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> NOTE: OUR WEBSITE AND EMAIL ADDRESSES HAVE CHANGED. TO ENSURE WE RECEIVE YOUR COMMUNICATION, PLEASE UPDATE YOUR RECORDS.</FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<IMG SRC="cid:1308224670.25770.0.camel@cribber" ALIGN="bottom" BORDER="0"><BR>
<BR>
<BR>
<B>Kit Chambers</B><BR>
<BR>
<I>Principal Geophysicist</I><BR>
Office: +33 9 6418 7790<BR>
Direct: +44 1872 879 007<BR>
Mobile: +44 7816506558<BR>
Email: <U><FONT COLOR="#0000ff"><A HREF="mailto:kit.chambers@reservoirrocktalk.com">kit.chambers@rocktalkimaging.com</A></FONT></U><BR>
<BR>
<B>NOTE: OUR WEBSITE AND EMAIL ADDRESSES HAVE CHANGED. TO ENSURE WE RECEIVE YOUR COMMUNICATION, PLEASE UPDATE YOUR RECORDS.</B>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>