[Paraview-developers] Custom Applications / Manual Selection
Mathieu Westphal
mathieu.westphal at gmail.com
Mon Dec 16 10:11:37 EST 2013
Hello
I'm trying, in my custom application, to track selection in a specific view
and select point on another view consequently.
By "selecting" i mean : render it in a different color in renderview,
highligth it in spreadsheet view and display it in FindData widget "current
selection" field
I'm able to catch selected signal and extractt the selected cells numbers.
However i am not able to manually select anything.
I have try to copy the code used in the FindData widget and i've come up
with the following code , wich is suposed to select the cell with id==0,
how ever it is not working,
it clears the current selection but doesn't select anything :
[code]
//!!!!!!!!!!!!!!!!!!!! SELECTION ? NOT WOKRING !!
// Find the proper Proxy manager
vtkSMSessionProxyManager* pxm =
vtkSMProxyManager::GetProxyManager()->GetActiveSessionProxyManager();
// Create a new selection source
vtkSMProxy* selSource = pxm->NewProxy("sources",
"SelectionQuerySource");
vtkSMPropertyHelper(selSource, "FieldType").Set( vtkSelectionNode::CELL
);
selSource->UpdateVTKObjects();
QString query;
query = "%1 == %2";
query = query.arg("id", "0");
vtkSMPropertyHelper(selSource,
"QueryString").Set(query.toAscii().constData());
printf("query : %s \n",query.toAscii().constData());
selSource->PrintSelf(std::cout, vtkIndent(0));
this->reader->getOutputPort(0)->setSelectionInput(vtkSMSourceProxy::SafeDownCast(selSource),
0);
pqSelectionManager * selman =
qobject_cast<pqSelectionManager*>(pqApplicationCore::instance()->manager("SELECTION_MANAGER"));
selman->select(this->reader->getOutputPort(0));
this->reader->getOutputPort(0)->renderAllViews( true );
[/code]
any idea or pointer about how to achieve that ?
Thanks
Mathieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20131216/e3f581ef/attachment.htm>
More information about the Paraview-developers
mailing list