[Paraview-developers] Improvement of pqSelectionInputWidget

Lodron, Gerald Gerald.Lodron at joanneum.at
Wed Mar 5 01:26:04 EST 2014


Hello

In a paraview plugin I reuse the pqSelectionInputWidget wich is in "original paraview" only used in ExtractSelection filter. The problem is that the "CopyActiveSelection" button only works if a selection is done. If nothing is selected the old selection is kept. Since my plugin filter has an optional input of selection it would be nice if the widget could set its state to an empty selection if "CopyActiveSelection" button is pressed on an empty active selection.....
This can be easily done by following changes in:

void pqSelectionInputWidget::copyActiveSelection()
{
  pqSelectionManager* selMan = (pqSelectionManager*)(
                    pqApplicationCore::instance()->manager("SelectionManager"));

  if (!selMan)
    {
    qDebug() << "No selection manager was detected. "
      "Don't know where to get the active selection from.";
pqSMProxy emptySource;
this->setSelection(emptySource);
    return;
    }

  pqOutputPort* port = selMan->getSelectedPort();
  if (!port)
    {
pqSMProxy emptySource;
this->setSelection(emptySource);

    return;
    }

  vtkSMProxy* activeSelection = port->getSelectionInput();
  if (!activeSelection)
    {
pqSMProxy emptySource;
this->setSelection(emptySource);

    return;
    }

... rest keep the same. Would be nice if this could be done in next release (or can I check that in in some way? I do not exactly know how...)....

Thanks,
Gerald

JOANNEUM RESEARCH Forschungsgesellschaft mbH

DIGITAL - Institute for Information and Communication Technologies
Steyrergasse 17, 8010 Graz, Austria

phone: +43 316 876-1751
fax: +43 316 8769-1751
e-mail: gerald.lodron at joanneum.at<mailto:gerald.lodron at joanneum.at>
web: www.joanneum.at/digital<http://www.joanneum.at/digital>
_________________________________________________________________

This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee(s) is prohibited. If you receive this in error please contact the sender and delete the material. The sender does not accept liability for any errors or omissions as a result of the transmission.

Please consider the environment before printing this page.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20140305/1294b991/attachment.html>


More information about the Paraview-developers mailing list