spc_4x4.gif (45 byte)
2. Plug-in Software Development Kit (SDK)
spc_2x2.gif (43 byte)
grd_2.gif (669 byte)
spc_2x2.gif (43 byte)
grd_3.gif (736 byte)


A plug-in is a DLL (Dynamic Link Library), that it is automatically loaded when VEGA starts. At the present time, the SDK is tested with Gcc (6) and Borland C/C++ Builder (7), but it also works with other C compilers. This DLL must have three exported functions - Init(), Free() and Call() -, whose definitions, constants and macros are included in the plugin.h header file.
The Init() function allows the initialization of the plug-in, describing the plug-in data (type, name and release) and the menu items, that will be added to the VEGA main menu.
The Free() function allows the release of all resources, when the program has terminated. In this subroutine one must include all code to free the resources, that are used by the plug-in. Finally the Call() function is the core of the plug-in, as it defines the code associated with a specific menu item.

Plug-in menu item   

Plug-in integration in VEGA graphic user interface (GUI).

When you select a plug-in menu item or press a button in the plug-in window, VEGA calls the corresponding subroutine passing the function code. Any plug-in can control all VEGA functions, read and modify the atom list, add a new atom and remove an atom in the list. VEGA stores the atom information in a memory list. Each atom has its own allocated memory space and each atom structure has the pointer to the next atom. Each atom is described by a series of values that include: atom name, atom number, residue name, residue number, chain indicator, 3D coordinates, atomic radius, atomic charge, atom type, connectivity matrix and bond order. A plug-in can allocate the corresponding memory to add a new atom, updating the pointer to total atoms and last atom; likewise a plug-in can free up memory to delete an atom from the list. These essential operations can be performed on the atom list of a molecule, of a trajectory and on the point lists of a surface, for which the saved data include the 3D coordinates and an associated value (it can be the point color or a point parameter, e.g. MEP, MLP, ILM, PSA, etc). These functions along with the specific features of VEGA allow any calculations on molecular structures to be carried out, analyzed, modified and managed. A plug-in can send commands to VEGA via the communication port associated to the main window to control the built-in functions. This is a two-way communication, as VEGA interprets and executes these commands, returning the operation results to the plug-in.

Previous page   1. Introduction 3. An example: the Predator plug-in   Next page