Wed 15 Jul 2015 05:05:06 PM UTC, comment #4:
With toolkit, I do not mean the interface between Octave and FLTK, I mean FLTK itself. If I created a GUI toolkit (I have considered to do so since I am not happy with any existing one), I would use Window coordinates between -1 and 1. So the line drawing API, for the "Canvas" widget would simply look like
void lineDraw(Canvas* c,const float* x,const float* y,size_t n_points);
Or
void lineDraw(Canvas* c,const Point* x,size_t n_points);
As a user of that function, I do not need to ask for the width, since I know that the scaling is invariant. All I need to do before calling the function is to make sure all values are in the correct range, and that is trivial. The only problem is aspect ratio, but that can be solved by choose a fixed y range [-1 1] and add
float widthGet(Canvas* c);
It is now left to Octave to call these functions with appropriate values. Compatible with Matlab? Yes.
I am not an expert in Octave, but I know that the `plot` command is a high-level routine, so the `plot` command should not do the work, it is more low-level than that.
|