views:

148

answers:

4

I want to create a few illustrations for one of my c++ related articles. This illustration must show how different structures are placed in memory ( variables, vtable, pointers etc ). I want illustrations to look something like this, like this or like this. Of course i can draw such illustrations by hand using gimp/photoshop or writer/msword. But i need a few dozens of them, so drawing them manually will take a lot of time :(. Is it some software ( preferrably free ), script or tool available that can help me to create such illustrations fast?

A: 

It's seems to be xfig figures. Used by every good scientist in their articles :)

I used it several times for paper, report and other stuff. Every phd thesis in computer science are full of xfig pictures :)

Of course, it's open source, very powerfull, maybe hard to begin for people not used to unix old school apps. But really very powerfull imo and lots of doc on the web.

claferri
i was always thinking that xfig is no difference from gimp/photoshop/inkscape/coreldraw. It will take me a lot of time to create such illustrations in the raster / vector image editing program :(. Any ways to accelerate process a bit?
Eye of Hell
When you get used to xfig, this kind of figure take no long to draw but i admit some "xfig trick" must be known. My firsts figures took me a while but now it's much more faster as I can reuse old figures.
claferri
A: 

Maybe ImageMagick could come your way. I found it pretty useful when bulk-processing images.

Scarlet
but imagemagick is just a batch image processor userd to resize / change format / apply filters to a huge amount of images. How can it help me to illustrate structures in memory?
Eye of Hell
Not only that, you can even design with IM, but I've taken a look to the instruments NXC suggested you, and as far as I can understand they are better for your purpose. Sorry for the answer.
Scarlet
A: 

Is the layout of structs defined by the C++ standard? I would suppose that it is compiler dependent.

SebastianK
nope. this is exactly the point i want to illustrate my article. So my collegues can see "how all it works" under the hood of they favorite visual c++ 2008
Eye of Hell
IIRC, the only part of the memory layout that isn't defined by the spec is the padding. Everything else should be exactly the same compiler to compiler.
rmeador
+1  A: 

Any vector drawing or diagramming tool will do this sort of illustration. Examples of open-source ones are:

  • Dia - a diagramming tool that does the same sort of thing as Visio. It is released under the GPL, Linux/Unix and Windows versions are available.

  • Inkscape - a vector drawing tool that does the same sort of thing as Adobe Illustrator or Corel draw. Again, this runs on Windows, Linux/Unix and Mac OSX.

  • Xfig - this is a diagramming tool. It's somewhat old-school and has a different user interface to a modern direct-manipulation one. However, it's quite powerful and runs very quickly. As far as I am aware, it uses Xlib, so it's quite closely bound to X and only runs on X-based platforms such as Linux/Unix or Cygwin.

ConcernedOfTunbridgeWells
seems that i forgot dia. Not a silver bullet, but i think that rectangles-with-text will be drawn by it at suitable speed. Thanks
Eye of Hell