This chapter provides a general overview of Molecular Inventor (MI) and includes a guided tour through a sample MI application, called miApp. This chapter contains the following sections:
“Open Inventor Basics” provides an overview of Open Inventor.
“Molecular Inventor Basics” provides an overview of MI.
“The Molecular Inventor Development Kit” describes the functionality that MI provides.
“Included Tools” describes optimizing, viewer, and file translation tools that you can use with Molecular Inventor applications.
“What You Need to Build Molecular Inventor Applications” describes the software you need in addition to MI to build MI applications.
“Looking at a Sample Molecular Inventor Application” takes you on a guided tour of the MI application, miApp, included in the software distribution.
The source code for miApp and other sample applications is not installed by default during the installation process for the Molecular Inventor Development Kit. When the sample source is installed, it is located in the /usr/share/src/MolInventor/examples directory.
Open Inventor is a library of classes that facilitates the rendering of 3D objects. It enables Open Inventor applications to take advantage of powerful graphics hardware with minimal programming effort. Open Inventor offers the economy and efficiency of a complete object-oriented system and it provides a programming model and user interface for OpenGL programs.
Based on OpenGL, the window system-independent toolkit provides a library of objects that you can use, modify, and extend to meet new needs. Open Inventor objects include database primitives, such as shape, property, group, and engine objects; interactive manipulators, such as the handle box and trackball; and components, such as the material editor, directional light editor, and examiner viewer.
In addition to simplifying application development, Open Inventor facilitates moving data between applications with its 3D interchange file format. End users of 3D programs can cut and paste 3D scene objects and share them among a variety of applications on the desktop.
For more information about Open Inventor, see The Inventor Mentor.
Molecular Inventor is a set of extensions to Open Inventor that facilitate the rendering of molecular structures, isosurfaces, and 3D contours. MI consists of two parts. One part is the Molecular Inventor Development Kit which contains the header files and Dynamic Shared Objects (DSOs) necessary to build an MI application. The Development Kit also contains sample code that can help you understand how to use various pieces of MI.
The other part of MI is the runtime DSO which is freely available for all Silicon Graphics machines. The runtime DSO enables end-users to run programs created with MI and also enables any Open Inventor-based application to access and render MI data.
MI also extends the Open Inventor file format which enables the interchange of chemical information between applications, including applications that are not chemistry specific.
You use the MI Development Kit to create molecular visualization applications. MI incorporates:
a variety of basic molecular structure rendering styles
a variety of options to control the quality of the rendering
the ability to display atom and bond labels with control over the content of the labels as well as their placement, font characteristics, and color
the ability to attach information to a chemical system; information not required by MI for rendering purposes
a variety of tools to select all or part of a chemical system display for an application-defined purpose
automatic highlighting of selected items with control over the specifics of the highlighting style used
the ability to display isosurfaces and 3D contours
a pop-up user interface for use in non-chemical applications
Molecular Inventor is built upon a set of C++ classes which are extensible. Therefore, MI can be tailored to meet the specific requirements of an application.
MI and Open Inventor include a variety of tools to optimize, translate, and view Open Inventor files that contain MI information. The source code for these tools can be found in the /usr/share/src/MolInventor and /usr/share/src/Inventor directories. These tools include:
mi2iv—creates an optimized Open Inventor file from a file containing MI information. The optimized file contains standard Open Inventor data without MI extensions.
ivToVRML— translates Open Inventor files into the VRML 1.0 standard
ivview—enables you to view Open Inventor files, including those with MI extensions
SceneViewer—is a 3D editor and demonstration program that demonstrates many Open Inventor features
gview—creates a window containing an examiner viewer on the left and a graph viewer on the right. Changes to the scene graph displayed in the graph viewer are reflected in the 3D scene displayed by the examiner viewer.
To build MI applications, in addition to the MI software, you need
a C++ compiler
the Open Inventor Development Kit
the Motif Development Kit
The Open Inventor Development Kit, included with the MI Development Kit, includes headers, libraries, documentation, sample programs, and sample data.
The Motif Development Kit includes tools to create a user interface based on Motif and a set of X toolkit components that come with the Open Inventor Development Kit.
Included in the software distribution is a sample application called miApp. This section encourages you to perform the steps in the following sections to take a brief guided tour of the application. The procedure introduces you to ideas and terminology used throughout the rest of this programming guide.
MI provides the source code but not the executable of miApp. So, your first task is to copy and compile the code.
Open a shell window.
Create a subdirectory:
% mkdir MIAPP |
Change to the directory just created:
% cd MIAPP |
Copy the miApp source code to the current directory:
% cp /usr/share/src/MolInventor/examples/miApp/* . |
Compile the code:
% make |
Start the program:
% miApp |
Choose File > Open and select the azt.pdb file to load.
miApp renders the date contained in the azt.pdb file.
Choose File > Write. In the dialog box, type the filename, azt.iv, and click Ok.
Open a new shell and list the files in the MIAPP directory:
% ls MIAPP |
Notice the azt.iv file appears.
List the contents of azt.iv:
% more azt.iv |
Notice that this file contains, in the Open Inventor file format, all of the data required to render the contents of the azt.pdb file.
Press the left mouse button while the cursor is in the display region and drag the mouse while holding the button down.
Notice that the molecule rotates according to the movements of the mouse. You can also use the Rotx, Roty and dolly wheels to rotate and zoom in and out on the molecule.
MI can render molecules in a variety of styles. Look at each of the styles by selecting the various items in the View menu.
MI enables you to change the appearance of a molecule easily. Try the following options:
Select the View > Wireframe option to use the Wireframe display style.
Drag the mouse cursor down several times on the View > DepthCue option to toggle the fog display on and off.
Notice that all atoms and bonds appear equally bright when the DepthCue is off and that, when the DepthCue is on, the farther from the user the atoms and bonds are, the darker and more hazy they appear.
Choose View > Preferences to display the Preferences dialog box.
Click the Hydrogen toggle switch several times.
Notice that the hydrogen atoms appear and disappear.
Click the Atom Labels toggle switch several times.
Notice that the atom names appear and disappear. Leave the labels on.
Click the Bond Labels toggle switch several times.
Notice that the bond labels appear and disappear. These numbers represent the length of the bonds. Leave the labels off.
Under Fonts and Labels, click on the pop-up menu that has 10 on it. Select 18.
Notice that the atom labels enlarge.
Click the pop-up menu that has Utopia on it. Select Times from the menu.
Notice that the atom labels change to the Times font.
In the Atom Labels box, change %a to %e and press <Enter>.
Notice that the labels change from the atom name to the atomic number.
In the Atom Labels box, change %e to %i and press <Enter>.
Notice that the labels change from the atomic number to the atom ID.
In the Atom Labels box, change %i to %a and press <Enter>.
Click on the Bond Labels toggle switch to display the bond labels.
In the Bond Labels box, change %d to %fa and press <Enter>.
Notice that the labels change from the bond length to the atom name of the atoms from which the bonds extend.
In the Bond Labels box, change %fa to %ta and press <Enter>.
Notice that the labels change to the atom name of the atoms toward which the bonds extend.
Select the View > BallStick option to use the BallStick display style.
Under Stick Style on the Preferences window, move the Complexity slider back and forth.
Notice that the cylinders appear more or less smooth depending on the value of Complexity.
Under Stick Style on the Preferences window, move the Radius slider back and forth.
Notice that the radii of the cylinders increase or decrease.
Under Sphere Style, move the Complexity slider back and forth.
Notice that the spheres appear more or less smooth depending on the value of Complexity.
Under Sphere Style, move the BallStick Scale slider back and forth.
Notice that the radii of the spheres increase or decrease.
MI provides a variety of selection tools. Try the following tasks:
Click the arrow (selection) icon on the right side of the window.
Notice that the cursor changes to an arrow.
Click several atoms sequentially using the left mouse button.
Notice that each atom is highlighted when you click it.
Click an atom with the left mouse button and while continuing to hold down the button, drag the mouse.
Notice that a selection sphere appears. You control its size by the motion of the mouse. When you release the mouse button, all atoms and bonds within the sphere appear highlighted (unless you make the sphere so small that it does not select anything).
Click the display region with the left mouse button at a location where there are no atoms or bonds.
Notice that any highlighted atoms and bonds become unhighlighted.
Click the display region again with the left mouse button at a location where there are no atoms or bonds and while continuing to hold down the button, drag the mouse.
Notice that a rectangle appears and changes size according to the movement of the mouse. When you release the mouse button, all atoms and bonds within the rectangle appear highlighted.