Hi there,

I have created my own scale legend which actually works fine. 
It updates after zooming or resizing the render window and comparing to my own 
line measurement tool it also shows the right length.
Unfortunately it won't update correctly after changing the layout of the render 
windows (e.g. from 2 windows to a 2x2 matrix style).

In fact the UpdateScale method is called each time I switch the layout but the 
ScalseFactorMMPerDisplayUnit is not updated.
It still gets its old value.
The value is defined in this way:
double scaleFactorMMPerDisplayUnit = 
mitk::BaseRenderer::GetInstance(m_Renderer->GetVtkRenderWindow())->GetDisplayGeometry()->GetScaleFactorMMPerDisplayUnit();

(Note: Each m_Renderer was set to each QmitkRenderWindow* renderWindow in the 
setup method.)

The scale is just showing the correct length after I call the AcINITMOVE via 
CTRL+LEFTMOUSEBTN.
DisplayVectorInteractor::ExecuteAction(...)
{
...
case mitk::AcINITMOVE:
    {
      m_Sender=posEvent->GetSender();
     double scaleFactorMMPerDisplayUnit = 
m_Sender->GetDisplayGeometry()->GetScaleFactorMMPerDisplayUnit();
...
}

This value is now the correct one. So apparently the scale factor was updated 
once called via m_Sender.
After initializing the zoom (not zooming) the UpdateScale method is called 
again and the scale legend updated correctly.

I have tried to force an update on the renderer or to calculate the scale 
factor by myself with
mitk::Vector2D vectora = 
mitk::BaseRenderer::GetInstance(m_Renderer->GetVtkRenderWindow())->GetDisplayGeometry()->GetSizeInDisplayUnits();
mitk::Vector2D vectorb = 
mitk::BaseRenderer::GetInstance(m_Renderer->GetVtkRenderWindow())->GetDisplayGeometry()->GetSizeInMM();
 .
But this two values are not updated as well.

My question is if this is a known bug in MITK or how to update the scale factor 
without initializing the zoom.

Kind regards,
Peter



                                          
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to