The Drawing Program PED (draft of 8/21/02)

Goal and Key Features of the Program

PED is intended to be a tool for creating scientific rather than artistic illustrations (although the latter are not precluded).  Most current drawing programs do not have the ability to include curves outside the program's own repertory. Consider for example, the following drawing:
Figure 1
Explanation for the curious

The first figure is a circle, the last an ellipse with a small eccentricity, and the middle a circle with a notch cut in. The size of the notch and the eccentricity of the ellipse are related. It is very easy to specify these three shapes mathematically and also write a simple program that plots these shapes. It is quite difficult to draw them precision with most of the existing drawing programs programs.

Given the numerous available high quality drawing programs (such as Microsoft's PhotoDraw), it would be a waste of time to start writing another full fledged drawing program. The solution I opted for is to write a simple drawing program for creating drawings both interactively and by writing code and making it easy to export the result to other drawing programs. PED is a descendant of a program with the same name that I wrote during 1982-84 while I was at Bell Labs (See history).

While PED has its own file format, it also supports the writing of Extended Metafiles which can then be inserted in other programs, including Microsoft's Word, PowerPoint,  PhotoDraw, Picture It, etc. PED can be easily customized through a user supplied DLL. There is a button on the toolbar that when it is clicked by the user it invokes a function called specialDraw() that is expected to be found in a DLL called customDR.dll. Because there are many more people who can write simple code than people who understand DLLs, the program is distributed with the source code and project files of the DLL (customDR.dll), including a sample of a custom function that users can modify to produce the shapes they wish. The function prototype is

int specialDraw(POINT *vp, int buf_size, int *np, char *cp);

The four arguments of the function are: an array of points to receive the data, the size of the array in the calling program (PED), an array of integers holding the number of points in each shape, and an array of characters that specify the shape. The function returns the number of shapes drawn. 

While reprogramming specialDraw() requires a basic understanding of the Windows drawing functions, it does not require knowledge about metafiles, how to implement interactive graphics, how to create toolbar buttons, etc. All these are taken care by PED. PED also provides some basic editing facilities, such as moving points, resizing shapes, etc. (See Detailed Documentation.) Click here for more examples.

The file ped.zip contains the source for the custom library, an already compiled DLL and a copy of the ped executable. You may download ped.zip provided you do so only for your own use and promise not to make copies. If you have any problems or want the souce of the main program send me e-mail (t.pavlidis AT ieee.org). Please note that no guarantees whatsoever are made about the program; use it at your own risk!
Timestamp of software: noon,  September 6, 2002. (See timeline.)  
theopavlidis.com Site Map