Re: Octave-handled graphics
Bill Denney <[email protected]> Mon, 1 May 2006 14:06:01 -0400 (EDT)
| Newsgroups | gmane.comp.gnu.octave.graphics |
|---|---|
| Message-ID | <[email protected]> |
Unfortunately, my code contains only minor differences from jwe's
handle-graphics.tgz so far (I'm a better document writer than coder).
I can give a general summary, and feel free to ask questions so that
hopefully I can improve the summary to the form that it will be a good
document for backend writers to use. I will post this on the wiki with
suggestions welcome on how to make it better.
To make a backend for octave, we will use a method called dispatching.
You will be responsible for creating a function called __drawnow_<backend
name>__ (e.g. __drawnow_gnuplot__) that will draw the current figure
object. This will be dispatched over __drawnow__. The drawing has
several steps:
* Determine the current figure.
* either
fignum = get(0, "currentfigure");
or
fignum = gcf()
* Get the information from that figure.
* figdata = get(fignum);
* Draw the figure window according to the parameters from that figure.
* Draw the children of the figure
* something like the following code
for i = 1:length(figdata.children)
kid = figdata.children(i);
drawchild(kid);
endfor
* Some child types will have their own children (axes, groups, etc.) They
will need to be drawn in a similar method.
Bill
On Mon, 1 May 2006, Robert S. Weigel wrote:
> Dear Bill,
>
> I am looking for a write-up or paragraph that describes the steps
> needed to develop and Octave-handled graphics backend. Perhaps using
> gnuplot as an example? The audience is a C++ programmer who has never
> used Octave or Matlab. Your wiki page is a great starting point, but
> we are getting hung up on the part where we try to figure out what to
> do with the code in handle-graphics.tgz. A concrete example with
> something I understand, such as gnuplot, would help me spec the
> project out.
>
> Project? I am trying to get an estimate for the time required to do this,
> either as part of a new project or a proposed project.
>
> Thanks,
>
> Bob Weigel
>
--
"The best that you can hope for is to die in your sleep."
-- Kenny Rogers, "The Gambler"