octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic questions about the new graphics system


From: Shai Ayal
Subject: Re: Basic questions about the new graphics system
Date: Fri, 24 Oct 2008 06:39:42 +0200

On Fri, Oct 24, 2008 at 12:57 AM, John Swensen <address@hidden> wrote:
> As I have started to work on the GTK backend for the OpenGL graphics
> renderer, I have tried to go back to the mailing lists and read as much as I
> can about the new graphics system and to look at graphics.cc and
> fltk_backend.cc to try and figure everything out.  Unfortunately, there is a
> *lot* of code there and was wondering if I could ask a favor.  Is there a
> succinct write-up somewhere of exactly how the the new graphics system
> works?  If not, would one of the people who knows the new system well be
> willing to spend an hour(s) to make such a document?
>
> In particular, I have the following questions (but I'm sure once these are
> answered there will be 10 more):
>
> 1) I see that FTGL gets compiled in, but I don't see any text, titles,
> legends, etc. when I try to plot such things.  Is there something wrong with
> my latest build from HG?
FTGL gets compiled in as a basis for text rendering. Unfortunately, we
never quite got the time to actually use it and implement text
rendering

> 2) Along the line of (1), is there a list of which properties are actually
> implemented?  I see that essentially all the properties exist, but which
> ones actually have an effect on the plot rendering?  I guess this applies to
> both the GNUPLOT and OpenGL backends.

each backend implements a different subset of properties. To get an
idea, you have to look in the code which actually draws the stuff. For
gnuplot, it's al in m-files which write data to a gnuplot command
file, as for OpenGL, it's all in gl-renderer.*

> 3) For the new graphics subsystem, what is the appropriate way for UI
> callbacks to modify properties?  In my implementation of a GTK OpenGL plot
> window, when I change the window position or size, or click on a certain
> point in the window, etc. I need to know how to get that information back
> into the handle tree in the appropriate manner.  It is a simple as modifying
> the property directly, or is there an interface built in for doing this?  Do
> these take effect immediately, or do they wait until the next iteration of
> the readline idle loop?
I think the best way is to use set commands. each property has an
appropriate set method -- i.e. to set the property color in a line
object,, you have a method line.set_color The properties get set
immediately since they are normal c++ varaibles. However to see them
effect you have to wait for a redraw. In fltk this means waiting for a
"drawnow" command which you can do manually, or wait for the idle
loop.

have a look at the fltk_backend.cc code in the follwing functions for
examples of setting properties:
plot_window::resize -- this sets the position property for the figure
plot_window::axis_auto -- this issues the command axis("auto")
plot_window::togle_grid -- this issues the command grid()
__fltk_redraw__ -- this iterates over all figures


> 4) Are the event functions implemented yet?  What is the proper way to
> trigger them?


> 5) For the life of me, I can't get rotation to work with the opengl backend.
>  How should this be done in the proper manner?

I'm guessing here, but probably you should use the same methos as the
"view" command usses to change the view point.

>
> I think a 1/2 page to 1 page description of how the different parts of the
> new graphics subsystem (separating out the handle properties from the
> OpenGL/Gnuplot backends) would be a great help to me and I think to others
> who are looking at contributing to the new graphics subsystem.

Hmm... looking at the history of code documentation in octave, this
seems highly unlikely to happen -- people who have the time generally
prefer to use it to code, not document. However asking on mailing
lists has almost always given good results, so maybe just keep on
asking?

Shai


reply via email to

[Prev in Thread] Current Thread [Next in Thread]