Routines for Open Inventor/Windows compatibility. More...
#include <Inventor/Win/SoWin.h>
Classes | |
struct | RegisteredClassStruct |
Static Public Member Functions | |
static SoWidget | init (const char *appName, const char *className="Inventor") |
static void | init (SoWidget topLevelWidget) |
static void | init () |
static bool | isInitialized () |
static void | finish () |
static void | mainLoop () |
static SbBool | nextEvent (XtAppContext appContext, XEvent *event) |
static Boolean | dispatchEvent (XEvent *event) |
static XtAppContext | getAppContext () |
static SbGlContextHelper::Display | getDisplay () |
static SoWidget | getTopLevelWidget () |
static void | show (SoWidget w) |
static void | hide (SoWidget w) |
static XmString | encodeString (char *s) |
static char * | decodeString (XmString xs) |
static void | setWidgetSize (SoWidget w, const SbVec2s &size) |
static SbVec2s | getWidgetSize (SoWidget w) |
static SoWidget | getShellWidget (SoWidget w) |
static void | createSimpleErrorDialog (SoWidget widget, char *dialogTitle, char *errorStr1, char *errorStr2=NULL) |
static void | getPopupArgs (UINT *d, int scr, ArgList args, int *n) |
static void | addColormapToShell (SoWidget widget, SoWidget shell) |
static SoConsole * | getErrorConsole (void) |
static void | doIdleTasks (void) |
Friends | |
class | SoWinTimerManager |
class | SoWinEventHandler |
Deprecated | |
| |
static SoDEPRECATED SoWidget | threadInit (const char *appName, const char *className="Inventor") |
static SoDEPRECATED void | threadInit (SoWidget topLevelWidget) |
static SoDEPRECATED void | threadInit () |
The SoWin class initializes Open Inventor for use with Microsoft Windows. SoWin::init() must be called in order for Open Inventor to work properly with Windows. SoWin::finish() should be called to clean up static memory allocations.
SoWin::mainLoop() must be called in order for extension device messages to be passed to Open Inventor render areas. The other methods are convenience functions.
Refer to the SoWinComponent reference pages for examples on how this class should be used when using Open Inventor Windows components.
SoWinComponent, SoWinErrorConsole
static void SoWin::addColormapToShell | ( | SoWidget | widget, | |
SoWidget | shell | |||
) | [static] |
This method is included for portability only.
static void SoWin::createSimpleErrorDialog | ( | SoWidget | widget, | |
char * | dialogTitle, | |||
char * | errorStr1, | |||
char * | errorStr2 = NULL | |||
) | [static] |
Convenience routine which brings a simple Windows error dialog box displaying the given error string(s) and window title.
The OK button, which destroys the dialog, is the only button displayed.
static char* SoWin::decodeString | ( | XmString | xs | ) | [static] |
This method is included for portability only.
Dispatch the passed message to a handler.
This returns TRUE if a handler was found, else it returns FALSE.
static void SoWin::doIdleTasks | ( | void | ) | [static] |
If you use SoWin::mainLoop or SoWin::nextEvent, Inventor automatically calls this when the Windows message queue is empty.
If you don't use those utilities you are responsible for periodically processing the tasks in the Inventor "delay queue", *** some of which are critical! *** like notifying the viewer when the scene graph changes.
static XmString SoWin::encodeString | ( | char * | s | ) | [static] |
This method is included for portability only.
static void SoWin::finish | ( | ) | [static] |
Frees Open Inventor's internal static memory allocations.
This avoids false positives from memory leak checking software. We recommend calling this method and it should be the last Open Inventor method called by the application. This method calls SoDB::finish(), SoNodeKit::finish(), and SoInteraction::finish().
Note: Open Inventor objects should be destroyed before you call this method.
For example:
Wrong Open Inventor Ending | Safe Open Inventor Endings | ||
void main() { SoWidget myW = SoWin::init(""); SoWinExaminerViewer viewer( myW ); .... .... SoWin::mainLoop(); SoWin::finish(); } |
| ||
SoWin doesn't end properly: SoWinExaminerViewer is destroyed after the finish() method has been called. | The SoWinExaminerViewer (that uses Open Inventor) is destroyed before the finish() method is called. |
static XtAppContext SoWin::getAppContext | ( | ) | [static] |
This method is included for portability only.
static SbGlContextHelper::Display SoWin::getDisplay | ( | ) | [static] |
This method is included for portability only.
static SoConsole* SoWin::getErrorConsole | ( | void | ) | [static] |
Returns the VSG error console.
An application can use the VSG error console to display its own text messages. See SoConsole for details.
static void SoWin::getPopupArgs | ( | UINT * | d, | |
int | scr, | |||
ArgList | args, | |||
int * | n | |||
) | [static] |
This method is included for portability only.
static SoWidget SoWin::getShellWidget | ( | SoWidget | w | ) | [static] |
Convenience routine which will return the topmost window containing the given window handle.
The window handle tree is traversed up until the last window handle is found using GetParent.
static SoWidget SoWin::getTopLevelWidget | ( | ) | [static] |
Returns information based on the initial window handle returned by or passed to init.
static SbVec2s SoWin::getWidgetSize | ( | SoWidget | w | ) | [static] |
Convenience routine to get the size of the given window.
static void SoWin::hide | ( | SoWidget | w | ) | [static] |
Convenience routine to hide the passed window handle.
This includes any children the window may have.
static void SoWin::init | ( | ) | [static] |
This alternate form of init does not require a top level window.
Calls SoDB::init(), SoNodeKit::init(), and SoInteraction::init().
static void SoWin::init | ( | SoWidget | topLevelWidget | ) | [static] |
This alternate form of init allows the application to initialize Windows.
TopLevelWidget should be the top level window handle returned from the Windows initialization.
Calls SoDB::init(), SoNodeKit::init(), and SoInteraction::init().
static SoWidget SoWin::init | ( | const char * | appName, | |
const char * | className = "Inventor" | |||
) | [static] |
This is called to initialize Open Inventor and Windows, and bind Open Inventor with Windows message handling so that Open Inventor sensors will work correctly.
Use this method for convenience if you want Open Inventor to create a top-level window for the application. Returns the top level shell window handle. Calls SoDB::init(), SoNodeKit::init(), and SoInteraction::init().
static bool SoWin::isInitialized | ( | ) | [static] |
Returns TRUE if SoWin module is currently initialized.
static void SoWin::mainLoop | ( | ) | [static] |
This retrieves and dispatches messages (loops forever).
It calls SoWin::nextEvent() and SoWin::dispatchEvent() to do this.
static SbBool SoWin::nextEvent | ( | XtAppContext | appContext, | |
XEvent * | event | |||
) | [static] |
Get the nextEvent by calling GetMessage.
The appContext can be had by calling SoWin::getAppContext().
static void SoWin::setWidgetSize | ( | SoWidget | w, | |
const SbVec2s & | size | |||
) | [static] |
Convenience routine to set the size of the given window.
static void SoWin::show | ( | SoWidget | w | ) | [static] |
Convenience routine to show the passed window handle.
This includes any children the window may have.
static SoDEPRECATED void SoWin::threadInit | ( | ) | [static] |
This method calls XXX::threadInit(), rather than XXX::init().
Otherwise it is the same as the corresponding SoWin::init() method. Use this method if you need to use multi-threading with Open Inventor.
static SoDEPRECATED void SoWin::threadInit | ( | SoWidget | topLevelWidget | ) | [static] |
This method calls XXX::threadInit(), rather than XXX::init().
Otherwise it is the same as the corresponding SoWin::init() method. Use this method if you need to use multi-threading with Open Inventor.
static SoDEPRECATED SoWidget SoWin::threadInit | ( | const char * | appName, | |
const char * | className = "Inventor" | |||
) | [static] |
This method calls XXX::threadInit(), rather than XXX::init().
Otherwise it is the same as the corresponding SoWin::init() method. Use this method if you need to use multi-threading with Open Inventor.
friend class SoWinEventHandler [friend] |
friend class SoWinTimerManager [friend] |