Hi Thomas,

currently the DataManager does not listen to changes of the "selected" property 
in nodes. We decided this on purpose because the DataManager cannot decide 
whether he should *add* the node to the current selection or if he should just 
select this single node.
Instead we are using the BlueBerry selection service to inform the workbench 
about selections. E.g. Views inherited from "QmitkFunctionality" may use the 
methods 

FireNodeSelected( mitk::DataNode* node ) 
FireNodesSelected( std::vector<mitk::DataNode*> nodes )

to inform the DataManager about a new set of selected nodes.
If you do not have the chance to inherit from QmitkFunctionality, you may have 
a look into these methods to see how it works.

Regards,
Michael

-----Ursprüngliche Nachricht-----
Von: Thomas Wolf [mailto:[email protected]] 
Gesendet: Donnerstag, 31. März 2011 16:42
An: [email protected]
Betreff: [mitk-users] setting data manager selection from within an interacting 
vtkwidget

Dear all,

currently i am writing a new interaction tool to handle surfaces in the
multiwidget. It is implemented as a vtkWidget and works so far quite nicely.

There is one issue that bugs me:
I can now work freely in teh 3dView, selecting/ deselecting and
transforming objects in arbitrary order.. but for applying my
modifications i need the list of active selected nodes in the data
manager. Retrieving is no problem, but if i select my nodes from within
the 3D view via the appropriate renderer, the acive selection becomes
different from the data manager one.

My solution is to set the corresponding node activley to 'selected' from
within my vtkWidget.

This is the code:
>>>>>>>>>>>>>
   pRenderer->SetPickingMode(mitk::VtkPropRenderer::PointPicking);

   mitk::DataNode *pickNode = NULL;
   pickNode = pRenderer->PickObject(pickPoi, pickPoi3);

   if(m_pParent)
   {
      if(pickNode)
      {
         //MITK_INFO << "object node picked";

         pickNode->SetSelected(true, pRenderer);
  mitk::RenderingManager::GetInstance()->RequestUpdateAll();
         QCoreApplication::processEvents();
<<<<<<<<<<<<<

The QCoreApplication::processEvents(); was my attempt to force the main
application to yield its main event loop...

But the overall method doesn't achieve anything. Did I miss something or
is this completely wrong? The datanode in question won't be highlighted
nor added to the list of selected nodes in the data manager.

Regards,
Thomas Wolf

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to