xjiang4 / ellipsoids

Automatically exported from code.google.com/p/ellipsoids
Other
0 stars 1 forks source link

Automate generation of pictures for ET manual #130

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Automate generation of pictures for ET manual

We currently have an automatic tool 

elltool.doc.run_helpcollector

that generates doc/chap_functions.tex file based on 
source code structure and help headers within the class methods and functions. 
This file defines
a content of a special chapter that contains descriptions for most of classes 
and functions 
in out toolbox. The rest of tex source files are static i.e. they are not 
generated on the fly. 
However most of tex files reference code snippets from doc\mcodesnippets 
folder. This means 
that source code of those snippets is automatically read and compiled into pdf 
via a special
\verbmcodef Latex environment. There is small problem with such approach though 
- the pictures
that those code snippets are supposed to generate are static i.e. they do not 
change when we change
either the snippets or internals of our toolbox. 

To solve this problem I suggest the following solution 

1) We move all the snippets from /doc/mcodesnippets to elltool.doc.snip and 
modify tex files to account for changed
location of the snippets. This is just a cosmetic change to put the snippets 
into elltool.doc package

2) For each picture named xyz.eps in doc/pic we write
a separate function in elltool.doc.picgen named xyz_gen.m which accepts a 
target file name for a picture and
generates this picture by

a) running the specific snippets from elltool.gen.snip package
b) finding a handle of required figure object (you can use either findobj 
built-in matlab function to 
find a figure handle by its name and type or you can slightly modify the 
snippets so that methods like plotEa we return
a relation data plotter object which can then be used to get the figure handles 
easily. The last solution would look like this

plotterObj=reachObj.plotEa();%this part is in the snippet

%this part is in the function
SFig=plotterObj.getPlotStructure().figHMap().toStruct()
%the you just scan fields of SFig to find the figure you need

c) using built-in Matlab function saveas to save a figure as eps picture.

3) modifying elltool.doc.run_helpcollector so that it runs all the functions 
from elltool.doc.picgen package
in lexicographical order (functions should be named after pictures while 
pictures should be renamed in the same
we as snippets are i.e. their names should contain chapter and section names 
and finally - picture number within a section
to define a picture order within a section).

Once all this is done the pictures in doc/pic folder will be updated 
automatically each time we run the help collector.

Of course the code of the functions from elltool.doc.picgen package should be 
specific for each picture so that 
the picture is taken in the best way (use view, set(figure,'Position') and 
other tricks to make the picture of correct
size, format and at the best angle (for 3d pictures)).

Original issue reported on code.google.com by heartofm...@gmail.com on 19 Sep 2013 at 2:33

GoogleCodeExporter commented 8 years ago

Original comment by heartofm...@gmail.com on 19 Sep 2013 at 2:34

GoogleCodeExporter commented 8 years ago
As I mentioned earlier gen functions may not plot or modify pictures in any 
way. They only can change picture sizes

Original comment by heartofm...@gmail.com on 7 Oct 2013 at 9:41

GoogleCodeExporter commented 8 years ago
You can reintegrate. Please strictly follow the reintegration algorithm 
described at 
http://code.google.com/p/ellipsoids/wiki/Issues_workflow_and_branching_policy

Original comment by heartofm...@gmail.com on 8 Nov 2013 at 12:51

GoogleCodeExporter commented 8 years ago

Original comment by shcherba...@gmail.com on 13 Nov 2013 at 11:27

GoogleCodeExporter commented 8 years ago

Original comment by heartofm...@gmail.com on 23 Nov 2013 at 9:08