Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Interaction of graphics object properties EraseMode and Visibility
Date: Wed, 3 Dec 2008 02:37:02 +0000 (UTC)
Organization: PhysioSonics Inc
Lines: 23
Message-ID: <gh4rce$rvp$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228271822 28665 172.30.248.37 (3 Dec 2008 02:37:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 3 Dec 2008 02:37:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1129061
Xref: news.mathworks.com comp.soft-sys.matlab:504570


I have a GUI with two overlaid "pages".  On one page is a sweeping display that displays data in real time, and on the other page is a set of edit uicontrols for user data entry.  The parent for the sweeping display axes is a uipanel, and the parent for the uicontrols is another uipanel.  The uipanels are coincident, and a togglebutton determines which will be displayed.  I display one and hide the other by setting the uipanel's visibillity property to On and Off, respectively.

The sweeping display is an axes with a hundreds of image objects oriented vertically.  Each image represents a column of data (i.e. a vertical line) in the display.  I can then update the CData of a single column during each step of the sweep, rather than refreshing a single image that occupies the entire axes (which is an operation that is too slow to generate smooth updates at a good framerate).

So, the object heircharcy looks like this:
figure
    uipanel1
        axes
            image
    uipanel2
        uicontrol

In order to get the sweeping display to update quickly, I need to set the EraseMode property of the image objects to none.  This works well because the object never needs to be erased ... during a refresh of that line the CData is updated.

The problem is that with EraseMode = 'none', the image objects are visible even when the ancestor uipanel is set to Visible = 'off'.  They are not immediately visible when I hide the panel, but become visible as their CData is updated.

The net effect is that the vertical lines of the sweeping display are drawn over the top of the data input uicontrols.  I can fix this by setting EraseMode = 'normal', but then the display updates much more slowly.  EraseModes 'xor' and 'background' have the same problem as 'none'.

Is this a bug, or expected behavior?  My renderer is 'painters'.

One of the questions I have is whether I should be updating the CData of the images when they are not visible.  I had thought this would not be a problem since nothing should be rendered when the object is invisible, even if the CData is updated, right?.  The problem with not updating them when they are not visible is that I would need to keep a separate buffer and update all the lines each time the sweeping display is made visible, which I can do, but I'd like to get more insight first.

I'll see if I can create a simplifed version of the GUI that shows this behavior, and post that.