Hi folks,
I'd like to have a PV data source that can be used either as a
source(without an input dataset) or as a filter(with an input dataset).
Based on what I have observed, to accomplish it the source has to show
up both in the sources menu and the filters menu, which is easy to do
with the XML by adding an entry in both the sources and filters groups
that points back to the same class and base proxy. It all works except
for sharing a custom qt panel between them, specifically sharing the
panel across proxy groups isn't currently allowed.
The attached patch enables a custom panel to be shared across the
sources/filters proxy groups. Assuming that this is the right way to
accomplish this can this patch be committed?
Why would you want to do this? For one example:
a source with an optional input used like a filter can then extract
spatial bounds from the input dataset and then position itself
automatically in the scene. This makes the source faster/easier to use
than if you have to type in the coordinates to position it. There are
plenty of other examples, with one thing in common, the potential to
make the source easier/faster to use.
Burlen
Index: Qt/Components/pqObjectPanelImplementation.cxx.in
===================================================================
RCS file: /cvsroot/ParaView3/ParaView3/Qt/Components/pqObjectPanelImplementation.cxx.in,v
retrieving revision 1.5
diff -u -r1.5 pqObjectPanelImplementation.cxx.in
--- Qt/Components/pqObjectPanelImplementation.cxx.in 19 Feb 2009 19:40:11 -0000 1.5
+++ Qt/Components/pqObjectPanelImplementation.cxx.in 18 Dec 2009 22:42:53 -0000
@@ -50,16 +50,18 @@
bool @panel_n...@implementation::canCreatePanel(pqProxy* proxy) const
{
- if (QString("@PANEL_XML_GROUP@") != proxy->getProxy()->GetXMLGroup())
+ foreach (QString group, QString("@PANEL_XML_GROUP@").split(';',QString::SkipEmptyParts))
{
- return false;
- }
- foreach (QString name, QString("@PANEL_XML_NAME@").split(';',
- QString::SkipEmptyParts))
- {
- if (name == proxy->getProxy()->GetXMLName())
+ if (group != proxy->getProxy()->GetXMLGroup())
+ {
+ continue;
+ }
+ foreach (QString name, QString("@PANEL_XML_NAME@").split(';',QString::SkipEmptyParts))
{
- return true;
+ if (name == proxy->getProxy()->GetXMLName())
+ {
+ return true;
+ }
}
}
return false;
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview