Hi Miklos,

you are right. Modified() should always be called if any of the 
properties has changed.
This has just recently been fixed in commit: 
ed3a1760c7bbe27b72cfb3459b732f9741debb4b
I hope that I didn't miss anything there.

Christoph


On 01/14/2015 04:31 PM, Miklos Espak wrote:
> This works, although I would be still curious if the update could be
> directly triggered. Moreover, the Modified() function should be
> invoked by SetText() or SetProperty() IMO.
>
>        textOverlay->SetText("hallo");
>        textOverlay->Modified();
>
>
> On 14 January 2015 at 15:25, Miklos Espak <[email protected]> wrote:
>> Hi,
>>
>> is it possible to change the text of a text overlay and update the
>> screen or you need to create a new TextOverlay2D instance any time
>> when you want to change the text.
>>
>> I want to show the pixel intensities at the crosshair as an
>> annotation, but cannot update the text.
>>
>> I tried these so far, with no success:
>>
>>      for (int i = 0; i < 3; ++i)
>>      {
>>        mitk::BaseRenderer* renderer = m_RenderWindows[i]->GetRenderer();
>>        mitk::OverlayManager::Pointer overlayManager =
>> renderer->GetOverlayManager();
>>
>>        mitk::TextOverlay2D::Pointer textOverlay = m_TextOverlays[i];
>>        textOverlay->SetText("hallo");
>>        textOverlay->Update(renderer);
>>        renderer->RequestUpdate();
>>        mitk::AbstractOverlayLayouter::Pointer layouter =
>> overlayManager->GetLayouter(renderer,
>> mitk::Overlay2DLayouter::STANDARD_2D_BOTTOMRIGHT());
>>        layouter->RemoveOverlay(textOverlay);
>>        layouter->AddOverlay(textOverlay);
>>        overlayManager->UpdateOverlays(renderer);
>>      }
>>
>>
>> The text was "hello" initially, and it does not change to "hallo".
>>
>> Is it a bug or am I missing something?
>>
>> Thanks,
>> Miklos
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to