Open Inventor FAQs - [Win32] IVF

[Win32] Where can I find IVF documentation?

The documentation for the IVF functions consists of on-line help documentation, specific IVF examples, and source code for IVF.

  • The on-line help (Reference Manual) provides an architectural overview of IVF and descriptions for each of the IVF classes.
  • The IVF examples are located in your Open Inventor directory, src\Inventor\examples\IVF. This directory contains the source code for the IVF "viewer" classes. There is a makefile to build an application from these files. The examples are provided to show how to create a new IVF viewer class for a new SoWin viewer class.
  • IVF source code is provided for documentation purposes only. It is not intended for the user to modify the IVF source code.

[Win32] If I've decided to use MFC, why should I use IVF instead of using the SoWin classes directly?

The IVF classes allow an elegant integration of Open Inventor into MFC programs, while the SoWin classes create the window system integration of Open Inventor into the Win32 environment just as the SoXt classes do for the X11 windowing system. The IVF classes do *not* need to be used when Open Inventor is used in MFC programs, but as a layer built upon the Win32/SoWin level, they provide some definite advantages, just as MFC provides a higher level of abstraction over Win32. That is, somebody has written a lot of code that the developer using IVF does not have to write himself! Some of these advantages:

  • The IVF AppWizard creates the skeleton MFC/IVF program without any programming on the the part of the application developer.
  • IVF provides multiple viewpoints, providing viewpoint management.
  • IVF provides deferred loading of inlines and texture images.
  • IVF provides OLE server support.
  • IVF provides printing integrated with MFC.
  • IVF provides Windows Clipboard support.

The same rationale behind using MFC over Win32 dictates the use of IVF over pure SoWin programming -- IVF is the 3D graphics equivalent to MFC.

Why wouldn't one use IVF in an MFC program? For the programmer who needs complete control over the programming environment to achieve specific functionality not achievable due to design contraints imposed by implicit decisions within IVF, the lower level SoWin classes should be used, just as the lower level programming interface is used in any situation where control is required over programmer productivity.

[Win32/MFC] Why are events in the Inventor window not delivered to my View class message handlers?

The Inventor viewers automatically size themselves to exactly cover their parent window. This is very convenient because it allows you to stick an Inventor viewer almost anywhere, e.g. in a dialog, just by providing a parent window in the right place. But it also means that the Inventor window gets the mouse events first.

You will need to use the Open Inventor "raw event" callback.

The Open Inventor viewers provide a "raw" event callback which allows you to intercept Win32 messages before they are handled by the viewer. You can use this to grab events and stuff them into the normal MFC message map mechanism. See the .../src/Inventor/examples/IVF/Scribble3D example in the SDK

[Win32] How do I integrate a custom (i.e., sub-classed) Open Inventor viewer into an IVF program?

The following example is delivered with the Open Inventor SDK:

%OIVHOME%\src\Inventor\examples\IVF\Ivf CustomerViewer

How can I tell which viewer (Examiner, Walk, etc.) is active in a SceneViewer MFC app (created by the IVF AppWizard)?

In your View class you can use:

IvfSvEVi ewerType   IvfGetCurrViewerType()

In an IVF SceneViewer-based application, how do I get a pointer to the actual viewer object so that I can (for example) call pointer->setDecoration(on/off)?

In your View class you can use:

SoWinFullViewer *p = m_pSV->getCurrViewer ();

Note that in a SceneViewer app you must query the viewer pointer every time you use it, because you don't know if the user has switched to a different viewer.

[Win32] Can I get the Inventor viewer decoration Help button to reference my help file, not the Inventor help file?

Yes! Use these SoWinViewer methods:

m_pViewer- >helpFileName="yourHelpFileName";

If you've used the IVF AppWizard to build your application, these calls go in the OnInitialUpdate method in your C<app>View class. You need to specify the name of the help file and the topic from the help file that you want to display. The topic is identified by its context ID (number).

You may also need to add:

#include <Inv entor/Win/viewers/SoWinFullViewer.h>

The help file is searched for in a variety of places:

  • The directory specified by environment variable SO_HELP_DIR
  • The doc directory of the Open Inventor installation (%OIVHOME%\doc)
  • The current working directory
  • The standard Windows directory
  • The current path

When the user clicks on the Help button, the program should display the help file at the topic specified in yourContextID.