Chapter 1. Porting to Open Inventor 2.1: Getting Started

This chapter gets you started porting to Open Inventor 2.1. It steps you through the porting process, pointing to other relevant information as appropriate.

The process of porting to Open Inventor 2.1 is much simpler if your application has no custom classes derived from the Inventor classes. This chapter therefore discusses the process in two separate sections:

Porting Applications With No Custom Classes

To port an application without custom classes, follow these steps:

  1. Compile your application under Inventor 2.1.

    If you have no errors, go to Step 4. Otherwise, continue with Step 2.

  2. If you have compile or link problems, go to “Overview of Changes By Class Name” and from there to the more detailed description.

  3. Fix all your problems in sequence and recompile, or recompile after each fix. The approach you take depends on your application and your personal preference.

  4. Run the application with the debug version of the library as follows:

    • Set the environment variable LD_LIBRARY_PATH to /usr/lib/libInventorDebug to run your application with the debug version of the library.

    • Note any debug messages that occur while running your application and fix problems. (The messages should be self-explanatory.)

  5. When your application compiles and links without errors, run it and watch carefully whether there are changes to the appearance of your scenes. Because some defaults changed, things may not look exactly as they did before.

  6. If you find problems, go to Chapter 3, “Scene Appearance Changes in Inventor 2.1.” The chapter provides a table that lets you access the API problem description based on the appearance problem description.

After the application compiles and runs satisfactorily, you are urged to also prepare it for the future by removing obsolete nodes, fields, and so on, that are supported for compatibility only.

In some cases, the old version of the API is supported in addition to the new version. This is done only to make the transition from 2.0 to 2.1 easier. To flush out cases where your code is still using the old version, compile your code with -DIV_STRICT as an option to cc.

Finally, optimize the application to really get the most out of Inventor 2.1 as follows:

  1. Change the program and the scene graphs to take advantage of the new vertexProperty field of vertex-based shapes.

  2. Look at the other new features discussed in Chapter 4, “New Features,” and make sure you're taking advantage of the available enhancements and optimizations.

  3. Look at the information in Chapter 6, “Optimizing Open Inventor Applications.” It has been updated for 2.1 from the booklet of the same name (which was not previously available online). Optimize your program using that information as appropriate.

Porting Custom Classes

If your application has custom classes, porting becomes more complex. Consider doing the following:

  1. Attempt to update your classes as appropriate before you compile the application for the first time. See Chapter 5, “Incompatible Extender API Changes,” for information that's useful when updating custom classes.

  2. When you believe you've fixed most problems, go through the steps in “Porting Applications With No Custom Classes”.

  3. If compiling or linking uncovers further problems with your custom classes, see also the include files in /usr/include/Inventor.