man SoQtFullViewer (Fonctions bibliothèques) -

NAME

SoQtFullViewer -

SYNOPSIS



#include <Inventor/Qt/viewers/SoQtFullViewer.h>

Inherits SoQtViewer.

Inherited by SoQtConstrainedViewer, SoQtExaminerViewer, and SoQtPlaneViewer.

Detailed Description

The SoQtFullViewer class adds some user interface components to the viewer canvas.

The SoQtFullViewer is an abstract viewer class which extends it's superclass (the basic SoQtViewer class) with two major user interface additions:.

•
decorations around the render canvas, with buttons and thumbwheels to control camera interaction and various other aspects of model / scene viewing

•
a popup menu, invoked with the right mouse button, which controls yet more aspects of the rendering and the viewer

The user interface features listed above are the common parts of the user interfaces of the SoQtFullViewer's non-abstract subclasses.

For 'real' application programs, the viewers / components from this class onwards and further down in the inheritance hierarchy is usually not all that interesting, as they enforces too much extra user interface cruft not compatible with the look and feel of the other parts of the application user interface. So most 'real' applications will use either the SoQtViewer or the SoQtRenderArea as their base-level component, and then inherit one of these down into one's own 'proper' viewer classes.

The non-abstract subclasses of the SoQtFullViewer class are viewer components often used as a test-bed for prototyping / rapid application development when doing quick testing of scenes, stand-alone 3D-models, animation techniques, etc etc.

See also: SoQtConstrainedViewer, SoQtExaminerViewer, SoQtPlaneViewer

Public Types

enum BuildFlag { BUILD_NONE = 0x00, BUILD_DECORATION = 0x01, BUILD_POPUP = 0x02, BUILD_ALL = (BUILD_DECORATION | BUILD_POPUP) }

Public Member Functions

void setDecoration (const SbBool on)

SbBool isDecoration (void) const

void setPopupMenuEnabled (const SbBool on)

SbBool isPopupMenuEnabled (void) const

QWidget * getAppPushButtonParent (void) const

void addAppPushButton (QWidget *newButton)

void insertAppPushButton (QWidget *newButton, int index)

void removeAppPushButton (QWidget *oldButton)

int findAppPushButton (QWidget *oldButton) const

int lengthAppPushButton (void) const

QWidget * getRenderAreaWidget (void) const

virtual void setViewing (SbBool on)

virtual void setComponentCursor (const SoQtCursor &cursor)

Protected Member Functions

SoQtFullViewer (QWidget *parent, const char *name, SbBool embed, BuildFlag flag, Type type, SbBool build)

~SoQtFullViewer ()

virtual void sizeChanged (const SbVec2s &size)

QWidget * buildWidget (QWidget *parent)

virtual void buildDecoration (QWidget *parent)

virtual QWidget * buildLeftTrim (QWidget *parent)

virtual QWidget * buildBottomTrim (QWidget *parent)

virtual QWidget * buildRightTrim (QWidget *parent)

QWidget * buildAppButtons (QWidget *parent)

QWidget * buildViewerButtons (QWidget *parent)

virtual void createViewerButtons (QWidget *parent, SbPList *buttonlist)

virtual void buildPopupMenu (void)

virtual void setPopupMenuString (const char *title)

virtual void openPopupMenu (const SbVec2s position)

virtual void leftWheelStart (void)

virtual void leftWheelMotion (float)

virtual void leftWheelFinish (void)

float getLeftWheelValue (void) const

void setLeftWheelValue (const float value)

virtual void bottomWheelStart (void)

virtual void bottomWheelMotion (float)

virtual void bottomWheelFinish (void)

float getBottomWheelValue (void) const

void setBottomWheelValue (const float value)

virtual void rightWheelStart (void)

virtual void rightWheelMotion (float)

virtual void rightWheelFinish (void)

float getRightWheelValue (void) const

void setRightWheelValue (const float value)

void setLeftWheelString (const char *const name)

QWidget * getLeftWheelLabelWidget (void) const

void setBottomWheelString (const char *const name)

QWidget * getBottomWheelLabelWidget (void) const

void setRightWheelString (const char *const name)

QWidget * getRightWheelLabelWidget (void) const

virtual SbBool processSoEvent (const SoEvent *const event)

Protected Attributes

QWidget * leftWheel

QWidget * rightWheel

QWidget * bottomWheel

QWidget * leftDecoration

QWidget * rightDecoration

QWidget * bottomDecoration

QWidget * leftWheelLabel

char * leftWheelStr

float leftWheelVal

QWidget * rightWheelLabel

char * rightWheelStr

float rightWheelVal

QWidget * bottomWheelLabel

char * bottomWheelStr

float bottomWheelVal

SoQtPopupMenu * prefmenu

Friends

class SoGuiFullViewerP

class SoQtFullViewerP

Member Enumeration Documentation

enum SoQtFullViewer::BuildFlag

Valid values for the constructor argument that decides how much of the user interface features to set up. The enum values are bitflags that can be OR'ed together.

Enumerator:

BUILD_NONE
Do not add any of the user interface components.
BUILD_DECORATION
Only build and set up the decorations around the OpenGL canvas.
BUILD_POPUP
Only build the popup menu. (Activated with the right mousebutton.)
BUILD_ALL
Build all user interface components of the SoQtFullViewer.

Constructor & Destructor Documentation

SoQtFullViewer::~SoQtFullViewer () [protected]

Destructor.

Member Function Documentation

void SoQtFullViewer::setDecoration (const SbBool enable)

Turn the viewer decorations on or off.

See also: isDecoration()

SbBool SoQtFullViewer::isDecoration (void) const

Return TRUE if the viewer decorations are on, otherwise FALSE.

See also: setDecoration()

void SoQtFullViewer::setPopupMenuEnabled (const SbBool enable)

Decide whether or not if clicking with the right mouse button on the OpenGL canvas should reveal a preferences popup menu when in viewing mode.

See also: isPopupMenuEnabled()

SbBool SoQtFullViewer::isPopupMenuEnabled (void) const

Return TRUE if the popup preferences menu is enabled, otherwise FALSE.

See also: setPopupMenuEnabled()

QWidget * SoQtFullViewer::getAppPushButtonParent (void) const

Returns the widget which is used as the parent of application specified buttons. The row of application buttons (if any) will be placed in the upper left corner.

See also: addAppPushButton(), insertAppPushButton(), removeAppPushButton()

void SoQtFullViewer::addAppPushButton (QWidget * newButton)

Add an application specific push button to the viewer decorations. Application buttons will be laid out in a vertical row from the upper left corner.

The button will be added bottom-most.

See also: insertAppPushButton(), removeAppPushButton(), getAppPushButtonParent()

void SoQtFullViewer::insertAppPushButton (QWidget * newButton, int index)

Insert an application specific push button to the viewer decorations at the given index.

See also: addAppPushButton(), removeAppPushButton(), getAppPushButtonParent()

void SoQtFullViewer::removeAppPushButton (QWidget * oldButton)

Remove one of the application specific buttons.

See also: addAppPushButton(), insertAppPushButton()

int SoQtFullViewer::findAppPushButton (QWidget * oldButton) const

Return the index of a particular button that has been specified by the application, or -1 of the button has not been added.

See also: addAppPushButton()

int SoQtFullViewer::lengthAppPushButton (void) const

Return number of application specific buttons added.

See also: addAppPushButton(), insertAddAppPushButton()

QWidget * SoQtFullViewer::getRenderAreaWidget (void) const

Returns the render area OpenGL canvas widget.

void SoQtFullViewer::setViewing (SbBool on) [virtual]

Set view mode.

If the view mode is on, user events will be caught and used to influence the camera position / orientation. If view mode is off, all events in the viewer canvas (like for instance keypresses or mouseclicks and -movements) will be passed along to the scene graph.

Default is to have the view mode active.

See also: isViewing()

Reimplemented from SoQtViewer.

Reimplemented in SoQtPlaneViewer, SoQtExaminerViewer, and SoQtFlyViewer.

void SoQtFullViewer::setComponentCursor (const SoQtCursor & cursor) [virtual]

Sets the cursor for this component.

Note: not part of the original SGI InventorXt API.

Reimplemented from SoQtComponent.

void SoQtFullViewer::sizeChanged (const SbVec2s & size) [protected, virtual]

Called internally from within the SoQt library when the widget embedded in a component changes it size, which is usually triggered by end-user interaction.

This method is then invoked to notify the component that the size has changed. It is called from the top and all the way down to the bottom, the size being adjusted to take into account extra decorations having been added at each level in the component class hierarchy.

Reimplemented from SoQtViewer.

QWidget * SoQtFullViewer::buildWidget (QWidget * parent) [protected]

This method builds the component contents in the given parent widget. For subclasses adding new user interface items, this method is typically overridden in the following manner:

  QWidget * MyOwnViewer::buildWidget(QWidget * parent)
  {
     QWidget * superw = <superclass>::buildWidget(parent);
     // [then move superw within MyOwnViewer framework and add own
     // user interface components]
  }

Reimplemented from SoQtRenderArea.

Reimplemented in SoQtPlaneViewer.

void SoQtFullViewer::buildDecoration (QWidget * parent) [protected, virtual]

Build viewer decorations.

QWidget * SoQtFullViewer::buildLeftTrim (QWidget * parent) [protected, virtual]

Build decorations on the left of the render canvas. Override this method in subclasses if you want your own decorations on the viewer window.

The decoration will be 30 pixels wide.

QWidget * SoQtFullViewer::buildBottomTrim (QWidget * parent) [protected, virtual]

Build decorations on the bottom of the render canvas. Override this method in subclasses if you want your own decorations on the viewer window.

QWidget * SoQtFullViewer::buildRightTrim (QWidget * parent) [protected, virtual]

Build decorations on the right side of the render canvas. Override this method in subclasses if you want your own decorations on the viewer window.

QWidget * SoQtFullViewer::buildAppButtons (QWidget * parent) [protected]

Build the application specified button row (if any buttons were set up).

QWidget * SoQtFullViewer::buildViewerButtons (QWidget * parent) [protected]

Build and layout viewer specified button row.

void SoQtFullViewer::createViewerButtons (QWidget * parent, SbPList * buttonlist) [protected, virtual]

Set up the viewer buttons with pixmaps and event connections.

One important note if you want to override this method to add your own buttons to the list (in the explanation below, it is assumed that you know how virtual function table pointers are handled by C++):

createViewerButtons() is called (indirectly) from the constructors of the viewer classes. This means that you need to delay it's invocation until your own subclass's constructor is run, because otherwise your re-implementation won't have been added to the internal virtual function table yet.

Delaying a superclass viewer from building it's decorations is done by passing build==FALSE as the last argument of the protected constructors. You will then have to explicitly trigger the building in your own constructor.

Here's a minimal example that shows the steps needed to be able to override createViewerButtons() from SoQtExaminerViewer:

  class MyExaminerViewer : public SoQtExaminerViewer {
  
  public:
    MyExaminerViewer(QWidget * parent);
  
  protected:
    virtual void createViewerButtons(QWidget * parent, SbPList * buttonlist);
  };
  
  MyExaminerViewer::MyExaminerViewer(QWidget * parent)
    : SoQtExaminerViewer(parent, NULL, TRUE,
                            SoQtFullViewer::BUILD_ALL, SoQtFullViewer::BROWSER,
                            // build == FALSE, to delay creation of decorations
                            FALSE)
  {
    // Explicitly trigger the construction of viewer decorations.
    QWidget * widget = this->buildWidget(this->getParentWidget());
    this->setBaseWidget(widget);
  }
  
  void
  MyExaminerViewer::createViewerButtons(QWidget * parent, SbPList * buttonlist)
  {
    SoQtExaminerViewer::createViewerButtons(parent, buttonlist);
    // [now add your own button(s) to the buttonlist]
  }

Reimplemented in SoQtPlaneViewer, and SoQtExaminerViewer.

void SoQtFullViewer::buildPopupMenu (void) [protected, virtual]

Make a popup menu with preferences settings.

One important note as for when you want to override this function in a subclass: be aware that it will usually be invoked (indirectly) from this class's constructor. That is before the table of virtual function pointers has been set up for the subclass, and because of this, the function will not be called in the subclass even though it is virtual.

To make the overriding actually be in effect, you need to delay building the widgets of this class. For information on how to do that, see the documentation of SoQtFullViewer::createViewerButtons().

void SoQtFullViewer::setPopupMenuString (const char * name) [protected, virtual]

Set title of popup menu.

void SoQtFullViewer::openPopupMenu (const SbVec2s position) [protected, virtual]

NOTE: This method is not part of the original InventorXt API.

void SoQtFullViewer::leftWheelStart (void) [protected, virtual]

Called when the user start to drag the thumbwheel in the left frame. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: leftWheelMotion(), leftWheelFinish()

bottomWheelStart(), rightWheelStart()

Reimplemented in SoQtPlaneViewer.

void SoQtFullViewer::leftWheelMotion (float value) [protected, virtual]

Called repeatedly as the user drags the thumbwheel in the left frame. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: leftWheelStart(), leftWheelFinish()

bottomWheelStart(), rightWheelStart()

Reimplemented in SoQtPlaneViewer, SoQtExaminerViewer, and SoQtConstrainedViewer.

void SoQtFullViewer::leftWheelFinish (void) [protected, virtual]

Called as the user let go of the thumbwheel in the left frame after a drag operation. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: leftWheelStart(), leftWheelMotion()

bottomWheelStart(), rightWheelStart()

Reimplemented in SoQtPlaneViewer.

float SoQtFullViewer::getLeftWheelValue (void) const [protected]

Get current value of the left thumbwheel.

See also: leftWheelMotion()

void SoQtFullViewer::setLeftWheelValue (const float value) [protected]

Set a new value for the left thumbwheel.

void SoQtFullViewer::bottomWheelStart (void) [protected, virtual]

Called when the user start to drag the thumbwheel in the bottom frame. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: bottomWheelMotion(), bottomWheelFinish()

leftWheelStart(), rightWheelStart()

Reimplemented in SoQtPlaneViewer.

void SoQtFullViewer::bottomWheelMotion (float value) [protected, virtual]

Called repeatedly as the user drags the thumbwheel in the bottom frame. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: bottomWheelStart(), bottomWheelFinish()

leftWheelStart(), rightWheelStart()

Reimplemented in SoQtPlaneViewer, SoQtExaminerViewer, and SoQtConstrainedViewer.

void SoQtFullViewer::bottomWheelFinish (void) [protected, virtual]

Called as the user let go of the thumbwheel in the bottom frame after a drag operation. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: bottomWheelStart(), bottomWheelMotion()

leftWheelStart(), rightWheelStart()

Reimplemented in SoQtPlaneViewer.

float SoQtFullViewer::getBottomWheelValue (void) const [protected]

Get current value of the bottom thumbwheel.

See also: bottomWheelMotion()

void SoQtFullViewer::setBottomWheelValue (const float value) [protected]

Set a new value for the bottom thumbwheel.

void SoQtFullViewer::rightWheelStart (void) [protected, virtual]

Called when the user start to drag the thumbwheel in the right frame. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: rightWheelMotion(), rightWheelFinish()

leftWheelStart(), bottomWheelStart()

Reimplemented in SoQtPlaneViewer.

void SoQtFullViewer::rightWheelMotion (float value) [protected, virtual]

Called repeatedly as the user drags the thumbwheel in the right frame. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: rightWheelStart(), rightWheelFinish()

leftWheelStart(), bottomWheelStart()

Reimplemented in SoQtPlaneViewer, SoQtExaminerViewer, and SoQtFlyViewer.

void SoQtFullViewer::rightWheelFinish (void) [protected, virtual]

Called as the user let go of the thumbwheel in the right frame after a drag operation. Override this method in subclassed viewers to provide your own functionality on the thumbwheel.

See also: rightWheelStart(), rightWheelMotion()

leftWheelStart(), bottomWheelStart()

Reimplemented in SoQtPlaneViewer.

float SoQtFullViewer::getRightWheelValue (void) const [protected]

Get current value of the right thumbwheel.

See also: rightWheelMotion()

void SoQtFullViewer::setRightWheelValue (const float value) [protected]

Set a new value for the right thumbwheel.

void SoQtFullViewer::setLeftWheelString (const char *const string) [protected]

Set label of the left thumbwheel.

QWidget * SoQtFullViewer::getLeftWheelLabelWidget (void) const [protected]

This method returns the native widget for the label below the left thumb wheel.

void SoQtFullViewer::setBottomWheelString (const char *const string) [protected]

Set label of the bottom thumbwheel.

QWidget * SoQtFullViewer::getBottomWheelLabelWidget (void) const [protected]

This method returns the native widget for the label beside the bottom thumb wheel.

void SoQtFullViewer::setRightWheelString (const char *const string) [protected]

Set label of the right thumbwheel.

QWidget * SoQtFullViewer::getRightWheelLabelWidget (void) const [protected]

This method returns the native widget for the label below the right thumb wheel.

SbBool SoQtFullViewer::processSoEvent (const SoEvent *const event) [protected, virtual]

Toolkit-native events are attempted converted to Coin-generic events in the SoQtRenderArea::processEvent() method. If this succeeds, they are forwarded to this method.

This is a virtual method, and is overridden in it's subclasses to catch events of particular interest to the viewer classes, for instance.

Return TRUE iff the event was processed. If not it should be passed on further up in the inheritance hierarchy by the caller. This last point is extremely important to take note of if you are expanding the toolkit with your own viewer class.

This method is not part of the original SGI InventorXt API. Note that you can still override the toolkit-native processEvent() method instead of this 'generic' method.

Reimplemented from SoQtViewer.

Reimplemented in SoQtPlaneViewer, SoQtExaminerViewer, and SoQtFlyViewer.

Member Data Documentation

QWidget * SoQtFullViewer::leftWheel [protected]

The widget representing the thumbwheel left of the render canvas.

QWidget * SoQtFullViewer::rightWheel [protected]

The widget representing the thumbwheel on the right side of the render canvas.

QWidget * SoQtFullViewer::bottomWheel [protected]

The widget representing the thumbwheel below the render canvas.

QWidget * SoQtFullViewer::leftDecoration [protected]

The root widget for the left-side decorations.

QWidget * SoQtFullViewer::rightDecoration [protected]

The root widget for the right-side decorations.

QWidget * SoQtFullViewer::bottomDecoration [protected]

The root widget for the bottom decorations.

QWidget * SoQtFullViewer::leftWheelLabel [protected]

Label widget of left wheel.

char * SoQtFullViewer::leftWheelStr [protected]

Text of left thumbwheel's label.

float SoQtFullViewer::leftWheelVal [protected]

Current value of the left thumbwheel.

QWidget * SoQtFullViewer::rightWheelLabel [protected]

Label widget of right wheel.

char * SoQtFullViewer::rightWheelStr [protected]

Text of right thumbwheel's label.

float SoQtFullViewer::rightWheelVal [protected]

Current value of the right-side thumbwheel.

QWidget * SoQtFullViewer::bottomWheelLabel [protected]

Label widget of bottom wheel.

char * SoQtFullViewer::bottomWheelStr [protected]

Text of bottom thumbwheel's label.

float SoQtFullViewer::bottomWheelVal [protected]

Current value of the bottom thumbwheel.

SoQtPopupMenu * SoQtFullViewer::prefmenu [protected]

Pointer to the popup menu instance.

Author

Generated automatically by Doxygen for SoQt from the source code.