bugGNU Octave - Bugs: bug #41573, Reparenting axes do not cause...

 
 

bug #41573: Reparenting axes do not cause figure to be re-drawn

Submitter:  Pantxo Diribarne <pantxo>
Submitted:  Wed 12 Feb 2014 09:43:11 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  andy1978
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 04 Sep 2014 02:26:40 PM UTC, comment #16: 

@Pantxo: Works fine for me, thank you again. Closing this report as fixed

Andreas Weber <andy1978>
Group Member
Sat 23 Aug 2014 02:55:19 PM UTC, comment #15: 

@Andy: I have pushed the changeset augmented with a %!test (http://hg.savannah.gnu.org/hgweb/octave/rev/4c59f69fa52c). The original example now works me with both opengl toolkits. If it works for you, you may close the bug report.

Pantxo Diribarne <pantxo>
Group Member
Sat 23 Aug 2014 01:20:59 PM UTC, comment #14: 

@Pantxo: Thank you for your patch. I haven't had time to write a patch myself so I'm very pleased you did it :-)

Please go ahead and push it.

Andreas Weber <andy1978>
Group Member
Sat 23 Aug 2014 11:09:57 AM UTC, comment #13: 

Sorry, I've just seen that the bug was assigned to Andy. Don't take my previous post into account.

Pantxo Diribarne <pantxo>
Group Member
Sat 23 Aug 2014 11:07:50 AM UTC, comment #12: 

Hi,

Following Andy's suggestion, I produced a patch. If it works for you I can push it.

(file #31939)

Pantxo Diribarne <pantxo>
Group Member
Tue 19 Aug 2014 05:06:54 PM UTC, comment #11: 

@Andy: I think your analysis is correct.  Octave shouldn't leave the currentaxes property set to null after the reparenting.

Rik <rik5>
Group administrator
Tue 19 Aug 2014 02:42:32 PM UTC, comment #10: 

In Matlab "get(1, "currentaxes")" returns ax in the code from comment 9. I think we should fix this in graphics.cc/graphics.in.h.

Matlab result: http://octave.1599824.n4.nabble.com/Matlab-test-requested-tp4666120p4666121.html

Andreas Weber <andy1978>
Group Member
Tue 19 Aug 2014 02:14:56 PM UTC, comment #9: 

@Rik: Thank you for your explanation. The reason for this behaviour is that the property currentaxes for figure 1 is still empty after the parent is changed:


figure (1); figure (2);
li = plot (1:10); ax = gca ();
set (ax, "parent", 1);

# This returns [](0x0)
get(1, "currentaxes")

# This calls fltk_graphics_toolkit::update with ID_CURRENTAXES
# which shows the canvas
set(1, "currentaxes", ax)


Is it okay that figure 1 "currentaxes" is empty after "set (ax, "parent", 1)" ?

Andreas Weber <andy1978>
Group Member
Fri 01 Aug 2014 05:50:25 AM UTC, comment #8: 

@Andy: The bug is that the plot isn't redrawn without explicitly clicking on the canvas.  I just checked with cset 19cb2530c16b and the issue issue is still there.

Rik <rik5>
Group administrator
Thu 31 Jul 2014 09:46:20 PM UTC, comment #7: 

@Pantxo: I made some bigger changes to the fltk toolkit and if I try your code on default


figure (1); figure (2);
li = plot (1:10); ax = gca ();
set (ax, "parent", 1);


I see the plot hiding from figure 2 and appearing on figure 1 as soon as I click on figure (1). Thank you, Andy

Andreas Weber <andy1978>
Group Member
Fri 21 Feb 2014 04:11:55 PM UTC, comment #6: 

Pantxo, could you send the request to split the "Plotting with OpenGL" category directly to jwe@octave.org.  I believe he is the only one at the moment who can change those fields.

Rik <rik5>
Group administrator
Fri 21 Feb 2014 11:01:31 AM UTC, comment #5: 

Using qt graphics toolkit the axes is redrawn properly after reparenting.

The bug category "Plotting with OpenGL" should probably be split into "... with FLTK" and "... with qt", now that qt graphics toolkit has been integrated to octave sources.

Pantxo Diribarne <pantxo>
Group Member
Sun 16 Feb 2014 10:32:46 AM UTC, comment #4: 

Neither drawnow, nor _fltk_redaw_ have an effect:


figure (1); figure (2);
li = plot (1:10); ax = gca ();
set (ax, "parent", 1);
figure (1)
redraw                 ## no apparent difference
__fltk_redraw__ ()     ## here neither


Only clicking on the figure (1) canvas as an effect.

Pantxo Diribarne <pantxo>
Group Member
Sun 16 Feb 2014 12:01:21 AM UTC, comment #3: 

does drawnow() help?

Felipe G. Nievinski <fgnievinski>
Thu 13 Feb 2014 07:17:41 AM UTC, comment #2: 

You are right, clicking in the canvas area lets the axes be drawn.

Pantxo Diribarne <pantxo>
Group Member
Thu 13 Feb 2014 05:31:15 AM UTC, comment #1: 

Are they not drawn, or simply not refreshed?

The code works for me if I explicity click in the blank canvas of the figure.  This seems to be an issue with the OpenGL renderer not understanding that the figure has been invalidated and needs to be refreshed.  This worked for me


figure (1);
figure (2);
hax = gca;
plot (1:10);  # just to show something
## Re-position windows so that they don't overlap and both are visible
set (hax, 'parent', 1)
## Both figure are blank now
## Click on blank canvas of figure 1, plot will be shown
set (hax, 'parent', 2)
## Both figure are blank now
## Click on blank canvas of figure 2, plot will be shown



Rik <rik5>
Group administrator
Wed 12 Feb 2014 09:43:11 PM UTC, original submission:  

See example below :


figure (1); figure (2);
ax = axes ();
set (ax, "parent", 1)
## no axes on figure 1 or 2
get (ax, {'parent', 'visible'})
##ans =
##{
##  [1,1] =  1
##  [1,2] = on
##}
get (1, "children") == ax
##ans =  1


The axes is valid, I've tried to change its properties, draw lines ... all "silently" (invisibly) works but I can't get it to be drawn.


Pantxo Diribarne <pantxo>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #31939:  fix_new_currentaxes.patch added by pantxo (1KiB - application/x-download)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by andy1978 (Posted a comment)
  • -email is unavailable- added by fgnievinski (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-09-04 andy1978 StatusReady For Test Fixed
    2014-08-23 pantxo StatusNone Ready For Test
        Open/ClosedOpen Closed
    2014-08-23 pantxo Attached File- Added fix_new_currentaxes.patch, #31939
    2014-07-31 andy1978 Assigned toNone andy1978
    2014-02-15 rik5 SummaryReparented axes are not drawn Reparenting axes do not cause figure to be re-drawn

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code