[Paraview-developers] programmatically selection of cells on the view
Carlos Alberto Bulant
carlos.alberto.bulant at gmail.com
Mon Mar 31 15:10:10 EDT 2014
Hi all, my name is Carlos, I am new in the ParaView developers World, very
exited to start developing my application in the form of plugins of this
great application we all love...
Right now I need some help...
I have successfully implemented my first filter/plugin, which is a
"Labeler", The input is a polydata, and the output is a polydata with an
extra celldata array containing labels for each cell that the user type in
a customized pqObjectPanel (lets call the class LabelerOP). This custom
panel consist of a qTableView with all the cells id and cells labels that
the user can edit.
What I'm trying to do is to programmatically select the cell in the current
view associated to the table raw selected by the user. I've prepared all
the connection between the table signals and LabelerOP custom slot that
will perform the selection, but the problem is that i don't know how to
actually perform the selection...
I couldn't find a similar problem on the list, and I have been seen the
code of the FindDataCreationFrame plugin, but i'm a litle confused with the
paraview workflow...
What i think it must be done is the following:
// Get the selection manager
QPointer<pqSelectionManager> SelectionManager =
qobject_cast<pqSelectionManager*>(
pqApplicationCore::instance()->manager("SELECTION_MANAGER"));
// Get the polydata used as input to my filter
pqPipelineSource* source =
qobject_cast<pqPipelineSource*>(
pqActiveObjects::instance().activeSource());
pqOutputPort* port = source->getOutputPort(0);
// Set the selection, imagine i want to select the Cell with ID=0
port->setSelectionInput( /*Don't know how to set the selection*/)
// Make the selection on the selection manager
SelectionManager->select(port);
// Render the polydata on all views?
port->renderAllViews();
I hope some kind soul can help me with my little problem, i apology for my
english,
Thanks in advance
Carlos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20140331/3ac3d225/attachment.html>
More information about the Paraview-developers
mailing list