logo资料库

COIN3D+帮助文件 COIN3D+帮助文件 COIN3D+帮助文件 COIN3D+帮助文件.pdf

第1页 / 共197页
第2页 / 共197页
第3页 / 共197页
第4页 / 共197页
第5页 / 共197页
第6页 / 共197页
第7页 / 共197页
第8页 / 共197页
资料共197页,剩余部分请下载后查看
Miscellaneous Classes
Classes
SoQt Class Reference [Miscellaneous Classes]
Detailed Description
Public Types
Static Public Member Functions
Friends
Member Typedef Documentation
Member Enumeration Documentation
Member Function Documentation
SoQtComponent Class Reference
Detailed Description
Public Member Functions
Static Public Member Functions
Protected Member Functions
Friends
Constructor & Destructor Documentation
Member Function Documentation
SoQtConstrainedViewer Class Reference [Qt Components, Qt Viewer Components]
Detailed Description
Public Member Functions
Protected Member Functions
Constructor & Destructor Documentation
Member Function Documentation
SoQtCursor Class Reference [Miscellaneous Classes]
Detailed Description
Public Types
Public Member Functions
Static Public Member Functions
Classes
Member Enumeration Documentation
Constructor & Destructor Documentation
Member Function Documentation
SoQtCursor::CustomCursor Class Reference
Detailed Description
Public Attributes
Member Data Documentation
SoQtDevice Class Reference [Qt Device Classes]
Detailed Description
Public Member Functions
Static Public Member Functions
Protected Member Functions
Static Protected Member Functions
Friends
Constructor & Destructor Documentation
Member Function Documentation
SoQtExaminerViewer Class Reference [Qt Components, Qt Viewer Components]
Detailed Description
Public Member Functions
Protected Member Functions
Friends
Constructor & Destructor Documentation
Member Function Documentation
SoQtFlyViewer Class Reference [Qt Viewer Components]
Detailed Description
Public Member Functions
Protected Member Functions
Friends
Constructor & Destructor Documentation
Member Function Documentation
SoQtFullViewer Class Reference [Qt Components, Qt Viewer Components]
Detailed Description
Public Types
Public Member Functions
Protected Member Functions
Protected Attributes
Friends
Member Enumeration Documentation
Constructor & Destructor Documentation
Member Function Documentation
Member Data Documentation
SoQtGLWidget Class Reference [Qt Components]
Detailed Description
Public Member Functions
Protected Member Functions
Protected Attributes
Friends
Constructor & Destructor Documentation
Member Function Documentation
Member Data Documentation
SoQtKeyboard Class Reference [Qt Device Classes]
Detailed Description
Public Types
Public Member Functions
Friends
Member Enumeration Documentation
Constructor & Destructor Documentation
Member Function Documentation
SoQtMouse Class Reference [Qt Device Classes]
Detailed Description
Public Types
Public Member Functions
Friends
Member Enumeration Documentation
Constructor & Destructor Documentation
Member Function Documentation
SoQtObject Class Reference [Miscellaneous Classes]
Detailed Description
Public Member Functions
Static Public Member Functions
Member Function Documentation
SoQtObject Class Reference [Miscellaneous Classes]
Detailed Description
Public Member Functions
Static Public Member Functions
Member Function Documentation
SoQtPlaneViewer Class Reference [Qt Components, Qt Viewer Components]
Detailed Description
Public Member Functions
Protected Member Functions
Friends
Constructor & Destructor Documentation
Member Function Documentation
SoQtRenderArea Class Reference [Qt Components, Qt Viewer Components]
Detailed Description
Public Member Functions
Static Public Member Functions
Protected Member Functions
Friends
Constructor & Destructor Documentation
Member Function Documentation
SoQtObject Class Reference [Miscellaneous Classes]
Detailed Description
Public Member Functions
Static Public Member Functions
Member Function Documentation
SoQtViewer Class Reference [Qt Components, Qt Viewer Components]
Detailed Description
Public Types
Public Member Functions
Protected Member Functions
Friends
Member Enumeration Documentation
Constructor & Destructor Documentation
Member Function Documentation
SoQt Documentation 1.4.2a SoQt is a library which provides the glue between Systems in Motion's Coin high-level 3D visualization library and Troll Tech's Qt 2D user interface library. Qt is a C++ toolkit for multiplatform development of 2D user interfaces, and also includes other functionality to help programmers write multiplatform applications. Qt is currently available on X11-based systems (UNIX, Linux and BSDs), MSWindows, Mac OS X and embedded systems. For more information on the Qt toolkit, see the web site for Troll Tech (makers of Qt): . By using the combination of Coin, Qt and SoQt for your 3D applications, you have a framework for writing completely portable software across the whole range of UNIX, Linux, Microsoft Windows and Mac OS X operating systems. Coin, Qt and SoQt makes this possible from a 100% common codebase, which means there is a minimum of hassle for developers when working on multiplatform software, with the resulting large gains in productivity. SoQt, like Coin and Qt, provides the programmer with a high-level application programmer's interface (API) in C++. The library primarily includes a class-hierarchy of viewer components of varying functionality and complexity, with various modes for the end-user to control the 3D-scene camera interaction. For a small, completely stand-alone usage example on how to initialize the library and set up a viewer instance window, see the following code: #include #include #include #include #include int main(int argc, char ** argv) { // Initializes SoQt library (and implicitly also the Coin and Qt // libraries). Returns a top-level / shell Qt window to use.
QWidget * mainwin = SoQt::init(argc, argv, argv[0]); // Make a dead simple scene graph by using the Coin library, only // containing a single yellow cone under the scenegraph root. SoSeparator * root = new SoSeparator; root->ref(); SoBaseColor * col = new SoBaseColor; col->rgb = SbColor(1, 1, 0); root->addChild(col); root->addChild(new SoCone); // Use one of the convenient SoQt viewer classes. SoQtExaminerViewer * eviewer = new SoQtExaminerViewer(mainwin); eviewer->setSceneGraph(root); eviewer->show(); // Pop up the main window. SoQt::show(mainwin); // Loop until exit. SoQt::mainLoop(); // Clean up resources. delete eviewer; root->unref(); return 0; } As compiled and run, this example provides the end-user with a full fledged 3D viewer. The viewer automatically contains mouse interaction handling logic to let the end-user "examine" the 3D-model / scene (since this is the SoQtExaminerViewer class), plus toolbar controls on the right-side decorations border for often used controls:
The SoQt library contains several such high-level classes as the SoQtExaminerViewer used in the above example. These are primarily used for doing Rapid Application Development (RAD) of new concepts and ideas for your 3D system. The "real" application will typically use one of the lower-complexity classes higher up in the inheritance hierarchy, such as the SoQtRenderArea, which provides the application programmer with full control over the user interface components and general layout to present for the end-user, as suitable for the specific application needs. This is how the SoQt library fits in with the other system components:
As can be seen from the above figure, SoQt builds on Systems in Motion's Coin library for the 3D graphics, and Troll Tech's Qt library for the 2D user interface components and the OpenGL canvas binding. The additional functionality provided by SoQt over Coin and Qt is: • The most convenient management of OpenGL context types, such as singlebuffered versus doublebuffered rendering, the use of overlay planes, stereo rendering, etc. This is handled through the SoQtGLWidget class, which builds on Qt's QGLWidget class, and through the SoQtRenderArea class (which contains the main binding into the Coin library's main data structures). • The translation of native Qt interaction device events (from e.g. the mouse or the keyboard) into the Coin library's event types. The translation is done by the SoQtDevice classes, controlled by the SoQtRenderArea.
These "generic" Coin events are then passed into the 3D scenegraph for further processing, for instance by Coin's 3D user interaction components -- like this "trackball manipulator" attached to a simple cone: • Some abstract viewer classes, like the SoQtViewer and SoQtFullViewer, which provides additional services on top of the SoQtRenderArea for assisting the application programmer in convenient handling of cameras and lightsources in the 3D scene (by the SoQtViewer), plus adding the basic, common user interface components (by the SoQtFullViewer). • A set of high-level viewer classes, as has been presented by the SoQtExaminerViewer in the above source code example. There are currently three different non-abstract viewer classes to choose from: the SoQtExaminerViewer (a plain model viewer), the SoQtFlyViewer (for fly-throughs in larger 3D scenes) and the SoQtPlaneViewer (for CAD-style viewing and interaction along the 3 principal axes). The SoQt library is "dual-licensed", which means it's available either under a Free Software license (specifically the GNU General Public License), or a license better suited for the development of proprietary / commercial applications: our Coin Professional Edition License. Note that to use SoQt under the GNU General Public License, you have to comply with that license's restrictions. These restrictions are not well suited for the development of non-Free software, so the availability of SoQt under the GNU GPL is primarily meant to be a service to the Free Software community. We strongly advise you to invest in the Coin Professional Edition License for using SoQt in proprietary development projects. As a Coin Professional Edition License holder, you gain the
rights to use the SoQt library in just about any way you like. See the Coin web site at for more information on the advantages of the Coin Professional Edition License, and how to become a license holder. For those who are using the implementations of the Inventor API from either SGI or TGS, we would like to point out that SoQt can also be used on top of either of those libraries instead of the Coin library from Systems in Motion. The SoQt API is based on and closely matches the InventorXt library API, originally developed by SGI. This should make it straigthforward to port InventorXt code over to SoQt, for instance to gain greater portability. See also: The documentation for the Coin library: . Miscellaneous Classes Classes class SoQt The SoQt class takes care of Qt initialization and event dispatching. This is the "application-wide" class with solely static methods handling initialization and event processing tasks. You must use this class in any application built on top of the SoQt library. More... class SoQtObject The SoQtObject class is the common superclass for all SoQt component classes. The purpose of making this class the superclass of all SoQt device, component and viewer classes is to be able to do run-time type checking of the SoQt objects. More... class SoQtCursor The SoQtCursor class is used to set cursors for GUI components. The class provides both a set of pre-defined cursor shapes, aswell as the option to use custom bitmap graphics. More... SoQt Class Reference [Miscellaneous Classes]
#include List of all members. Detailed Description The SoQt class takes care of Qt initialization and event dispatching. This is the "application-wide" class with solely static methods handling initialization and event processing tasks. You must use this class in any application built on top of the SoQt library. Typical usage is as follows (complete application code): #include #include #include #include #include int main(int argc, char ** argv) { // Initialize SoQt and Inventor API libraries. This returns a main // window to use. QWidget * mainwin = SoQt::init(argc, argv, argv[0]); // Make a dead simple scene graph, only containing a single // yellow cone under the scenegraph root. SoSeparator * root = new SoSeparator; root->ref(); SoBaseColor * col = new SoBaseColor; col->rgb = SbColor(1, 1, 0); root->addChild(col); root->addChild(new SoCone);
// Use one of the convenient viewer classes. SoQtExaminerViewer * eviewer = new SoQtExaminerViewer(mainwin); eviewer->setSceneGraph(root); eviewer->show(); // Pop up the main window. SoQt::show(mainwin); // Loop until exit. SoQt::mainLoop(); // Clean up resources. delete eviewer; root->unref(); return 0; } And voila:
分享到:
收藏