Abstract base class for DialogViz components More...
#include <DialogViz/dialog/SoDialogViz.h>
Public Types | |
enum | LabelAlignment { LEFT, CENTER, RIGHT } |
Static Public Member Functions | |
static void | init () |
static void | finish () |
static bool | isInitialized () |
static const char * | getProductName () |
static const char * | getVersion () |
static SoDialogViz * | loadFromFile (SbString filename, SbString auditorID="") |
static void | setSkin (SbString skinName) |
static void | setSkinsDirectories (SbString directories) |
static SbString | getSkinsDirectories () |
static void | setFont (DG_FONT font) |
Public Attributes | |
SoSFBool | enable |
SoSFString | label |
SoSFEnum | labelAlignment |
SoSFString | auditorID |
This is the abstract base class for all DialogViz (user interface) nodes. It defines common methods and fields that all DialogViz nodes inherit. It is also used to initialize DialogViz.
SoDialogViz::init must be called before creating any DialogViz nodes.
The enable field allows/disallows use of the node.
The label field specifies the string contained in the left part of a control or the text on a button. See individual components for their specific usage of this field.
An auditor ID is a name that identifies a specific component and is specified using the auditorID field. Generally, the auditor ID should be unique. It allows you to access a specific component from your application program.
DialogViz components can be used to build 2D and/or 3D interfaces. A DialogViz interface definition can be read from an Inventor file or created programmatically. To build a 2D user interface, call the buildDialog() method. To build a 3D user interface, insert the DialogViz nodes in your scene graph. Note that when using 3D mode, DialogViz nodes are fully built only after the first rendering traversal is complete.
When using components as 3D objects in your scene, DialogViz allows the user to customize the look for each type of component using DialogViz skin files. DialogViz components are draggers, and draggers allow their parts to be redefined. A skin file redefines the 3D geometry for different parts of a component. To use your own skin files, use the setSkin() method, or set the DIALOGVIZ_SKIN environment variable to specify the path/name of the skin files directory. By default, the DialogViz skin directory is located at $OIVHOME/data/DialogViz/Skins/ and the used skin name is "default". A skin is a collection of several files defining DialogViz component geometry, colors, etc... For example, the skin file TextProperties.iv is used by all of the DialogViz components. This skin file can be useful for applying a font, a color, etc. to the text nodes.
The default font for DialogViz components in 2D mode is:
In 3D mode, the font is defined in the TextProperties.iv Inventor file.
2D Mode Limitation: We do not recommend the use of ref(), unref(), or unrefNoDelete() when manipulating DialogViz nodes in 2D mode. However, these methods can be used as long as you don't destroy and re-create nodes or change the hierarchical structure of components.
label | "" |
callbackID | "" |
enable | TRUE |
SoTopLevelDialog, SoTopComponent, SoMenuItem
MultiViewers, MultiViewers, ShowAll, ShowAll, Simple, SetSkin, SetSkin, Simple3DMenu, Simple3DMenu
static void SoDialogViz::finish | ( | ) | [static] |
Shuts down the DialogViz module, which includes freeing any internal static memory that it allocated.
Finish methods must be called in the reverse order of the init method calls:
SoDialogViz::finish(); SoXt::finish(); ...
static const char* SoDialogViz::getProductName | ( | ) | [static] |
Returns a character string identifying the name of the extension.
static SbString SoDialogViz::getSkinsDirectories | ( | ) | [static] |
Returns the skins directory.
static const char* SoDialogViz::getVersion | ( | ) | [static] |
Returns a character string identifying the version of the extension.
static void SoDialogViz::init | ( | ) | [static] |
Initalizes the DialogViz classes.
static bool SoDialogViz::isInitialized | ( | ) | [static] |
Returns TRUE if module is currently initialized.
static SoDialogViz* SoDialogViz::loadFromFile | ( | SbString | filename, | |
SbString | auditorID = "" | |||
) | [static] |
Loads a DialogViz node from an Inventor file.
filename,: | Specifies the full path of a file containing DialogViz nodes. This file is loaded. | |
auditorID,: | The first DialogViz node in the file having this auditorID is returned. If this parameter is not supplied or if no DialogViz nodes having this auditorID are found in the file, the first DialogViz node in the file is returned. |
static void SoDialogViz::setFont | ( | DG_FONT | font | ) | [static] |
Sets the DialogViz font.
static void SoDialogViz::setSkin | ( | SbString | skinName | ) | [static] |
Shows the component.
Hides the component. Sets the directory for 3D DialogViz component skins. The directory is searched for in the current directory (usually, but not always the directory from which the application was started), and then in $OIVHOME/data/DialogViz/skins. Returns TRUE if the specified directory exists, FALSE otherwise. The default skin to use can be set using the DIALOGVIZ_SKIN environment variable.
static void SoDialogViz::setSkinsDirectories | ( | SbString | directories | ) | [static] |
Sets a list of directories where to search for skins.
Each directory in the list must be separated by a semicolon (;). Using this method overrides the DIALOGVIZ_SKINS_DIR environment value.
Specifies the auditor ID of the node.
Default is empty string.
Enables component.
Default is TRUE. If set to FALSE, the component is grayed out and is not usable.
Label string of the element.
Default is an empty string. This field is used by all derived classes except for SoMenuSeparator, SoMenuBar, SoDialogCustom, SoDialogSeparator, and SoDialogGroup. This field is the title of the window created by an SoTopLevelDialog. This field supports the newline (\n) character except for some derived classes such as SoMenuItem. It supports the tab (\t) character as well.
Specifies the label alignment.
Default is RIGHT.