[Paraview-developers] Improvement of pqSelectionInputWidget
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Wed Mar 5 12:47:07 EST 2014
Gerald,
That's be totally okay. If you submit a topic to gerrit
(http://www.paraview.org/Wiki/ParaView/Git/Develop) or just attach a
patch, that'll make it easier to get this incorporated.
At the same time, I'd like to mention that you don't really need to
patch ParaView for such changes. A plugin can easily provide new
pqPropertyWidget subclasses and then have them used for the properties
on your proxies without changing ParaView code
(http://paraview.org/Wiki/Plugin_HowTo#Adding_Customizations_for_Properties_Panel)
Utkarsh
On Wed, Mar 5, 2014 at 12:26 AM, Lodron, Gerald
<Gerald.Lodron at joanneum.at> wrote:
> 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
>
> web: 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.
>
>
>
>
>
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
More information about the Paraview-developers
mailing list