From graphics-request at octave dot org Thu Feb 16 03:06:36 2006 Subject: Re: Minimal requirements from a handle graphics package From: Ole Jacob Hagen To: Shai Ayal CC: graphics at octave dot org, octave maintainers mailing list Date: Thu, 16 Feb 2006 10:04:51 +0000 Hi, Following objects should also be included into the handle graphics package: image uicontrol uimenu uicontextmenu light rectangle Command: delete must be included. And which M*lab version should our handle graphics package be compatible with? R11, R12, R13, R14? Mathworks has redesigned their handle graphics package, from R13 to R14. Should we strive for R11 or R13 compatibility ? You can also find similar low-level functions in oplot as well. You can browse online here: http://cvs.sourceforge.net/viewcvs.py/oplot/oplot/src/octave/ You'll find that both octplot and oplot has the same low-level functions. They both are dispatching, creating aliases for their functions. The low level function set/get are used in a similar way in both octplot and oplot Oplot version of set/get calls oplotcom(....), while octplot versions calls the octplot_command(....) See examples at the end of this mail. So octplot and oplot is more alike, than you would like to prefer, I guess. Octplot uses also a similar toogle mechanism as enabling/disabling usage of graceplot. These m-files can be retrieved from octave-forge. It handles the order of the search directories in the loadpath used in Octave. Oplot uses props for handle graphics storage, while octplot is a Props-less implementation...This it not entirely true, or is it Shai? You are calling MAKE_REF(...) to make properties available to both read and write. I can see that you've created your own Props-similar implementation? I am refering to the prop-prefixed cpp-source files in octplot. Oplot has a handle graphics storage, that are used by the rendering classes, and they are not "glued" together. Therefore I would say and claim that octplot and oplot is very alike. Same principles, but different software design in some areas. Besides, we have exchanged files from each other. The handle graphics functionality restricts developers in designing and implementing visualisation application to octave supporting handle graphics. The same minimum amount of low-level functions have to be shipped: line, surface, image, patch, text, figure, axes, set, get and delete. These must be shipped to ensure minimal visualisation functionality. This require that the following graphic objects are supported: root, figure, axes, line, surface, patch, image and text. If octave shall provide a library for the graphical objects at all, the Props library or a similar library would be preferable. Props can be used internally by Octave, or by the visualisation application. It should be noticable that Props used internally inside Octave doesn't do any visualisations. For a graphic less props browse http://cvs.sourceforge.net/viewcvs.py/oplot/oplot/props/octave/ This could be nice to use, if you want to handle/experiment with handle graphics without visualisation, and to experiment on how props really works. Props was designed and developed during a bachelor thesis written by my brother, Hans O. Cheers, Ole J. Comparison set.m oplot: > function *oset*(varargin) > oplotcom(*"set"*, varargin{:}); > end octplot: > function *oset* (varargin) > *if* (length(varargin)<3 || mod(length(varargin),2)~=1) , > usage('set(hnd,prop,val[,prop,val])'); > endif > > hnd = varargin{1}; > *for* ii=2:2:length(varargin), > *for* jj=1:length(hnd), > octplot_command('set',hnd(jj), varargin{ii},varargin{ii+1}); > endfor > endfor > > endfunction > get.m oplot: function x = oget(varargin) x = oplotcom(*"get"*, varargin{:}); end octplot: > function _out = get (varargin) > > *if*(nargin<1) > usage(*"get(hnd,[prop])"*); > endif > > hnd = varargin{1}; > *out* = cell(); > oi =1; > *for* ii=1:length(hnd) > tt = octplot_command(*"get"*,hnd(ii),varargin{2:length(varargin)}); > *out*(oi:oi+length(tt)-1) = tt; > oi += length(tt); > endfor > > *if*(length(*out*) ~= length(hnd)) > ## means we were returned a list of all properties > printf(*"\nProperty list\n\n"*); > *for* ii=1:length(*out*), > printf(*" %s\n"*,*out*{ii}); > endfor > printf(*"\n"*); > elseif( length(*out*) == 1) > _out = *out*{1}; > elseif( length(*out*) == 0) > _out = []; > *else* > _out = *out*; > endif > > endfunction