I agree with Matt.

A little addition:

The crosshair plane nodes also have a "renderer" property. That is, if you
do not have references to the nodes like here (m_PlaneNode1, etc.) but you
have to dig them out from the data storage, you can still check the
"renderer" property if they belong to the desired viewer.



On 22 May 2014 20:52, Clarkson, Matt <[email protected]> wrote:

>  Hi All,
>
>  we are upgrading from MITK 2013.09 to MITK 2014.03, and i just came
> across the following.
>
>  Please can the references to direct node names be removed, and replaced
> with something like the code below (only for illustration purposes).
>
>  Imagine a third party project has 1 or more QmitkStdMultiWidgets working
> simultaneously in another editor, operating behind the MITK Display, then
> the code below will simply toggle the first node called widget1Plane,
> widget2Plane or widget3Plane in DataStorage, which could belong to any
> QmitkStdMultiWidget, and not necessarily the desired one.
>
>  The code shown has existed for a long time, but its usage can vary when
> called from a 3rd party.
>
>  Thanks
>
>  Matt
>
>  diff --git a/Modules/QtWidgets/QmitkStdMultiWidget.cpp
> b/Modules/QtWidgets/QmitkStdMultiWidget.cpp
>  index 5c852d8..f03aea2 100644
>  --- a/Modules/QtWidgets/QmitkStdMultiWidget.cpp
>  +++ b/Modules/QtWidgets/QmitkStdMultiWidget.cpp
>  @@ -1824,9 +1824,16 @@ void
> QmitkStdMultiWidget::SetWidgetPlaneVisibility(const char* widgetName, bool
>
>
>   void QmitkStdMultiWidget::SetWidgetPlanesVisibility(bool visible,
> mitk::BaseRenderer *renderer)
>   {
>  -  SetWidgetPlaneVisibility("widget1Plane", visible, renderer);
>  -  SetWidgetPlaneVisibility("widget2Plane", visible, renderer);
>  -  SetWidgetPlaneVisibility("widget3Plane", visible, renderer);
>  +  //SetWidgetPlaneVisibility("widget1Plane", visible, renderer);
>  +  //SetWidgetPlaneVisibility("widget2Plane", visible, renderer);
>  +  //SetWidgetPlaneVisibility("widget3Plane", visible, renderer);
>  +  if (m_PlaneNode1.IsNotNull() && m_PlaneNode2.IsNotNull() &&
> m_PlaneNode3.IsNotNull())
>  +  {
>  +    m_PlaneNode1->SetVisibility(visible, renderer);
>  +    m_PlaneNode2->SetVisibility(visible, renderer);
>  +    m_PlaneNode3->SetVisibility(visible, renderer);
>  +  }
>  +
>     m_RenderingManager->RequestUpdateAll();
>   }
>
>
>  @@ -2197,4 +2204,4 @@ mitk::DataNode::Pointer
> QmitkStdMultiWidget::GetWidgetPlane(int id)
>       break;
>       default: return NULL;
>     }
>  -}
>  \ No newline at end of file
>  +}
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform
> available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
>
>
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to