octave-maintainers
[Top][All Lists]
Advanced

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

Re: GSoC project: new graphics backend


From: Arseniy Lartsev
Subject: Re: GSoC project: new graphics backend
Date: Sun, 29 Mar 2009 10:10:25 +0300
User-agent: KMail/1.10.3 (Linux/2.6.27.19-3.2-default; KDE/4.1.3; i686; ; )

> Am I mistaken, or what you mean is taking the current "draw()" interface of
> opengl_renderer class and put it into an abstract class, and make
> opengl_renderer
> inherit from it?
Yes. It would look like this:

class abstract_renderer {
...
  void abstract_renderer::draw (const line::properties& props);
  virtual void draw_line(const Matrix &x, const Matrix &y, const Matrix &z)=0;
...
};

class opengl_renderer: public abstract_renderer {
...
  virtual void draw_line(const Matrix &x, const Matrix &y, const Matrix &z);
...
};

void abstract_renderer::draw (const line::properties& props)
{
  Matrix x = xform.xscale (props.get_xdata ().matrix_value ());
  Matrix y = xform.yscale (props.get_ydata ().matrix_value ());
  Matrix z = xform.zscale (props.get_zdata ().matrix_value ());
  draw_line(x, y, z);
}

void opengl_renderer::draw_line(const Matrix &x, const Matrix &y,
  const Matrix &z)
{
  glFoo();
  glBar();
  ...
}

Of course, there should also be line width, color, style, etc.

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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