Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoQtExaminerViewer Class Reference

VSG extension Viewer component which uses a virtual trackball to view the data. More...

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

+ Inheritance diagram for SoQtExaminerViewer:

Public Types

enum  ViewingMode {
  VIEWING_MODE_SPIN ,
  VIEWING_MODE_SPIN_CONSTRAINED ,
  VIEWING_MODE_PAN ,
  VIEWING_MODE_ROLL ,
  VIEWING_MODE_ZOOM
}
 Viewing mode. More...
 
enum  ConstrainedViewingMode {
  NONE ,
  CONSTRAINED_VIEWING_MODE_X ,
  CONSTRAINED_VIEWING_MODE_Y ,
  CONSTRAINED_VIEWING_MODE_Z
}
 Constrained viewing mode. More...
 
- Public Types inherited from SoQtFullViewer
enum  BuildFlag {
  BUILD_NONE = 0x00 ,
  BUILD_DECORATION = 0x01 ,
  BUILD_POPUP = 0x02 ,
  BUILD_ALL = 0xff
}
 Build flags. More...
 
- Public Types inherited from SoQtViewer
enum  Type {
  BROWSER ,
  EDITOR
}
 Editor types. More...
 
enum  DrawStyle {
  VIEW_AS_IS ,
  VIEW_HIDDEN_LINE ,
  VIEW_NO_TEXTURE ,
  VIEW_LOW_COMPLEXITY ,
  VIEW_LINE ,
  VIEW_POINT ,
  VIEW_BBOX ,
  VIEW_LOW_RES_LINE ,
  VIEW_LOW_RES_POINT ,
  VIEW_SAME_AS_STILL
}
 List of possible drawing styles. More...
 
enum  DrawType {
  STILL ,
  INTERACTIVE
}
 Draw types. More...
 
enum  BufferType {
  BUFFER_SINGLE ,
  BUFFER_DOUBLE ,
  BUFFER_INTERACTIVE
}
 List of different buffering types. More...
 
enum  DecimationStrategy {
  NORMAL ,
  FIXED_NUM_TRIANGLES ,
  FRAMES_PER_SECOND ,
  FIXED_PERCENTAGE
}
 List of decimation strategies. More...
 
enum  CursorStyle {
  CLASSIC ,
  XOR ,
  SHADOW
}
 Curors styles. More...
 
- Public Types inherited from SoQtGLWidget
enum  FloatColorBufferSize {
  FLOAT_16_COLOR_BUFFER = SoGuiGLWidget::FLOAT_16_COLOR_BUFFER ,
  FLOAT_32_COLOR_BUFFER = SoGuiGLWidget::FLOAT_32_COLOR_BUFFER
}
 FloatColorBufferSize. More...
 

Public Member Functions

 SoQtExaminerViewer (QWidget *parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, SoQtFullViewer::BuildFlag flag=SoQtFullViewer::BUILD_ALL, SoQtViewer::Type type=SoQtViewer::BROWSER)
 Constructor which specifies the viewer type.
 
 ~SoQtExaminerViewer ()
 Destructor.
 
void setViewingMode (ViewingMode viewingMode)
 Sets the viewing mode.
 
ViewingMode getViewingMode () const
 Gets the current viewing mode.
 
void setConstrainedViewingMode (ConstrainedViewingMode mode)
 Sets the constrained viewing mode.
 
ConstrainedViewingMode getConstrainedViewingMode () const
 Returns the current constrained viewing mode.
 
void setFeedbackVisibility (SbBool onOrOff)
 Shows/hides the point of rotation feedback, which only appears while in viewing mode (default is off).
 
SbBool isFeedbackVisible () const
 Returns the rotation feedback flag.
 
void setFeedbackSize (int newSize)
 Sets the point of rotation feedback size in pixels (default 20 pix).
 
int getFeedbackSize () const
 Returns the point of rotation feedback size in pixels.
 
void setAnimationEnabled (SbBool onOrOff)
 Enables/disables the spin animation feature of the viewer (enabled by default).
 
SbBool isAnimationEnabled ()
 Returns whether spin animation is enabled.
 
void stopAnimating ()
 Stops animation, if it is occurring.
 
SbBool isAnimating ()
 Queries if the viewer is currently animating.
 
virtual void viewAll ()
 Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).
 
virtual void resetToHomePosition ()
 Restores the camera values.
 
virtual void setCamera (SoCamera *cam)
 Sets the edited camera.
 
virtual void setViewing (SbBool onOrOff)
 Sets whether the viewer is turned on or off.
 
virtual void setCursorEnabled (SbBool onOrOff)
 Sets whether the viewer is allowed to change the cursor over the renderArea window.
 
virtual void setSeekMode (SbBool onOrOff)
 Set the viewer into/out of seek mode (default OFF).
 
virtual void activateSpinning (const SbVec2s &newLocator)
 Sets the start locator for spin camera animation.
 
virtual void activatePanning (const SbVec2s &newLocator)
 Sets the start locator for pan camera animation.
 
virtual void activateDolly (const SbVec2s &newLocator)
 Sets the start locator for dolly camera animation.
 
virtual void activateRoll (const SbVec2s &newLocator)
 Sets the start locator for roll camera animation.
 
virtual void rollCamera (const SbVec2s &newLocator)
 Roll the camera based on cursor motion.
 
virtual void spinCamera (const SbVec2f &newLocator)
 Spin the camera based on cursor motion.
 
virtual void spinConstrainedCamera (const SbVec2f &newLocator, int axisIndex)
 Spin the constrained camera based on cursor motion.
 
virtual void dollyCamera (const SbVec2s &newLocator)
 Move the camera on the z axis based on cursor motion.
 
virtual void reverseDollyCamera (const SbVec2s &newLocator)
 Same as dollyCamera but reversed.
 
virtual void panCamera (const SbVec2f &newLocator)
 Pans the camera based on cursor motion.
 
- Public Member Functions inherited from SoQtFullViewer
virtual void setDecoration (SbBool onOrOff)
 Shows/hides the viewer component trim (default on).
 
SbBool isDecoration ()
 Returns whether the viewer component trim is on or off.
 
void setPopupMenuEnabled (SbBool trueOrFalse)
 Enables/disables the viewer popup menu (default enabled).
 
SbBool isPopupMenuEnabled ()
 Returns whether the viewer popup menu is enabled or disabled.
 
void setClientPopupMenu (QMenu *menu)
 Enables application-specific popup menu.
 
SbBool isClientPopupMenuInstalled ()
 Returns TRUE if an application-specific popup menu is installed.
 
QWidget * getAppPushButtonParent () const
 Returns application push button parent.
 
void addAppPushButton (SoQtButton *newButton)
 Adds application push button, which will be placed in the left hand side decoration trim.
 
void insertAppPushButton (SoQtButton *newButton, int index)
 Adds application push button, which will be placed in the left hand side decoration trim.
 
void removeAppPushButton (SoQtButton *oldButton)
 Removes specified application push button.
 
int findAppPushButton (SoQtButton *oldButton)
 Returns index of specified push button.
 
int lengthAppPushButton ()
 Returns number of application push buttons.
 
QWidget * getRenderAreaWidget ()
 Returns the render area window handle.
 
virtual void hide ()
 This hides the component.
 
virtual void setHeadlight (SbBool onOrOff)
 Turns the headlight on/off (default on).
 
virtual void setDrawStyle (SoQtViewer::DrawType type, SoQtViewer::DrawStyle style)
 Sets the current drawing style in the main view.
 
virtual void setBufferingType (SoQtViewer::BufferType type)
 Sets the current buffering type in the main view (default SoQtViewer::BUFFER_DOUBLE).
 
virtual SoStereoDialoggetStereoDialog ()
 Returns the current stereo dialog.
 
void setStereoDialog (SoStereoDialog *newDialog)
 Sets the stereo dialog the viewer should use.
 
- Public Member Functions inherited from SoQtViewer
virtual void setSceneGraph (SoNode *newScene)
 Sets the scene graph to render.
 
virtual SoNodegetSceneGraph ()
 Gets the scene graph to render.
 
SoCameragetCamera ()
 Gets the edited camera.
 
virtual void setCameraType (SoType type)
 Sets the camera type that will be created by the viewer if no cameras are found in the scene graph (see SoPerspectiveCamera and SoOrthographicCamera).
 
SoType getCameraType ()
 Gets the camera type that will be created by the viewer if no cameras are found in the scene graph (see SoPerspectiveCamera and SoOrthographicCamera).
 
virtual void setPreserveCameraHeightAngle (SbBool flag)
 If TRUE, an SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthographicCamera and then toggled back to an SoPerspectiveCamera.
 
virtual SbBool isCameraHeightAnglePreserved () const
 Query whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthographicCamera and then toggled back to an SoPerspectiveCamera.
 
virtual void enableSeekWithOrtho (SbBool flag)
 If FALSE, the seek functionality is disabled for an SoOrthographicCamera.
 
virtual SbBool isSeekWithOrthoEnabled () const
 Query whether the seek functionality is enabled for an SoOrthographicCamera.
 
virtual void saveHomePosition ()
 Saves the camera values.
 
void setCameraTypeChangeCallback (SoQtViewerCameraTypeChangeCB *callback, void *userdata)
 Defines a callback which is called each time the camera type has changed (change from SoPerspectiveCamera to SoOrthographicCamera or vice versa).
 
SbBool isHeadlight ()
 Queries if the headlight is on.
 
SoDirectionalLightgetHeadlight ()
 Returns the headlight node.
 
SoQtViewer::DrawStyle getDrawStyle (SoQtViewer::DrawType type)
 Queries the current drawing style in the main view.
 
SoQtViewer::BufferType getBufferingType ()
 Gets the current buffering type in the main view.
 
SbBool isViewing () const
 Queries whether the viewer is turned on or off.
 
SbBool isCursorEnabled () const
 Queries whether the viewer is allowed to change the cursor over the renderArea window.
 
void setAutoClipping (SbBool onOrOff)
 Sets the auto clipping plane.
 
SbBool isAutoClipping () const
 Queries if auto clipping is ON.
 
virtual void setStereoViewing (SbBool onOrOff)
 Turns stereo viewing on/off on the viewer (default off).
 
virtual SbBool isStereoViewing ()
 Queries if stereo viewing is on or off on the viewer.
 
void setStereoOffset (float dist)
 Sets the stereo offset.
 
float getStereoOffset ()
 Returns the stereo offset.
 
void setDetailSeek (SbBool onOrOff)
 When the viewer is in seek mode, left mouse clicks initiate a pick, and the viewer changes its orientation and position to look at the picked object.
 
SbBool isDetailSeek ()
 Queries whether the viewer is in seek mode.
 
void setSeekTime (float seconds)
 Sets the time a seek takes to change to the new camera location.
 
float getSeekTime ()
 Queries the seek time.
 
void addStartCallback (SoQtViewerCB *f, void *userData=NULL)
 Adds start callback routine on the viewer.
 
void addFinishCallback (SoQtViewerCB *f, void *userData=NULL)
 Adds finish callback routines on the viewer.
 
void removeStartCallback (SoQtViewerCB *f, void *userData=NULL)
 Removes start callback routine from the viewer.
 
void removeFinishCallback (SoQtViewerCB *f, void *userData=NULL)
 Removes finish callback routine from the viewer.
 
virtual void recomputeSceneSize ()
 This can be used to let the viewer know that the scene graph has changed so that the viewer can recompute things like speed which depend on the scene graph size.
 
void setDecimationStrategy (SoQtViewer::DecimationStrategy strategy)
 Sets strategy to use to decide on decimation value.
 
SoQtViewer::DecimationStrategy getDecimationStrategy ()
 Gets strategy to use to decide on decimation value.
 
void setGoalNumberOfTriangles (int32_t goal)
 Sets goal number of triangles for the viewer to try to render.
 
int32_t getGoalNumberOfTriangles ()
 Gets goal number of triangles for the viewer to try to render.
 
void setGoalFramesPerSecond (float goal)
 Sets goal frames per second for the viewer to try to render.
 
float getGoalFramesPerSecond ()
 Gets goal frames per second for the viewer to try to render.
 
void setFixedPercentage (float percent)
 Sets fixed percentage for the viewer to render (0.0 to 1.0) Default is 1.0.
 
float getFixedPercentage ()
 Gets fixed percentage for the viewer to render (0.0 to 1.0)
 
void enableFullRenderingWhenStill (SbBool onOff)
 If this flag is set, the viewer will render at full resolution when it sits still for a certain period of time.
 
SbBool isFullRenderingWhenStill ()
 Queries if the viewer will render at full resolution when it sits still for a certain period of time.
 
SbBool isStillNow ()
 Returns whether the viewer is currently still.
 
void setFramesPerSecondCallback (SoQtViewerFPSCB *callback, void *userData=NULL)
 Registers frames per second callback.
 
void setNumSamples (int numFrames)
 Sets how many frames should be timed before frames per second callback is called, default is 10.
 
int getNumSamples ()
 Gets how many frames should be timed before frames per second callback is called.
 
void setDecimationPercentageCallback (SoQtViewerDecimationPercentageCB *callback, void *userData=NULL)
 Registers decimation percentage callback.
 
float getCurrentDecimationPercentage ()
 Returns the Decimation Percentage the viewer used in its last render.
 
virtual SoCameragetViewerCamera ()
 Returns the camera so SoBaseStereo can manipulate it to achieve the stereo effect.
 
virtual SbBool isViewerDoubleBuffer ()
 Returns TRUE if viewer is double buffered.
 
virtual void actualRendering ()
 This method is called automatically when the viewer requests that its SoBaseStereo object perform stereo rendering.
 
virtual const SbVec2sgetSize ()
 Returns the size of the OpenGL drawing window in absolute screen coordinates (not relative to parent window) of the native window system (typically Y increasing downward).
 
virtual const SbVec2sgetTopLeft ()
 Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to parent window) of the native window system (typically Y increasing downward).
 
virtual const SbVec2sgetBottomRight ()
 Returns the position of the OpenGL drawing window in absolute screen coordinates (not relative to parent window) of the native window system (typically Y increasing downward).
 
void setStereoViewType (SoBaseStereo *stereo)
 Set an implementation of stereo viewing to use.
 
SoBaseStereogetStereoViewType ()
 Returns the current stereo implementation.
 
void reverseStereoView (SbBool reverse)
 If TRUE, reverse the left and right eye views.
 
SbBool isStereoViewReversed ()
 Returns TRUE if the left and right eye views are reversed.
 
virtual void setStereoAbsoluteAdjustments (SbBool absolute)
 If TRUE, use stereo absolute adjustments.
 
virtual SbBool isStereoAbsoluteAdjustments () const
 Returns TRUE if stereo absolute adjustments are enabled.
 
virtual void setStereoBalance (float balance, SbBool nearFrac=false)
 Sets the stereo balance (the position of the zero parallax plane).
 
virtual float getStereoBalance ()
 Returns the current stereo balance.
 
virtual SbBool isStereoBalanceNearFrac ()
 Returns TRUE if the stereo balance adjustement is defined as a fraction of the camera near distance.
 
virtual void setStereoActive (SbBool activate)
 If TRUE, stero is activated.
 
virtual SbBool isStereoActive ()
 Returns TRUE if stereo is active.
 
void setViewport (short left, short bottom, short width, short height)
 Sets viewport region with given origin (lower-left corner) and size, given as pixel coordinates.
 
void getViewport (short &left, short &bottom, short &width, short &height)
 Returns viewport region as origin (lower-left corner) and size, given as pixel coordinates.
 
SoSeparatorgetSceneRoot ()
 Returns the viewer's scene root.
 
virtual void setCursorStyle (SoQtViewer::CursorStyle style)
 Sets the cursor style.
 
SoQtViewer::CursorStyle getCursorStyle ()
 Returns the cursor style.
 
void setAutoClipTolerance (float tolerance)
 Sets the auto clipping tolerance value.
 
float getAutoClipTolerance () const
 Gets the auto clipping tolerance value.
 
virtual void setCameraSceneGraph (SoNode *cameraSceneGraph)
 Sets the sub-scene graph to be used for viewAll computation.
 
SoNodegetCameraSceneGraph ()
 Gets the sub-scene graph to be viewed.
 
void enableMouseWheelDolly (SbBool onOff)
 Enable/disable moving the camera with the mouse wheel, TRUE by default.
 
SbBool isSeekMode ()
 Returns TRUE if currently in seek mode.
 
virtual void toggleCameraType ()
 This routine will toggle the current camera from perspective to orthographic, and from orthographic back to perspective.
 
void setPickRadius (float radius)
 Sets the pick radius, in pixels, used by the viewer for picking and seeking actions.
 
float getPickRadius () const
 Returns the current pick radius for picking and seeking actions.
 
SbBool getDepthValue (int x, int y, float &depth)
 Returns the depth value, scaled between 0.0 and 1.0, from the depth buffer at window coordinates x, y.
 
virtual SoDEPRECATED void adjustClippingPlanes ()
 Along with the manipulation of the camera, SoBaseStereo needs to set the scene appropriately when changing the camera settings.
 
- Public Member Functions inherited from SoQtRenderArea
 SoQtRenderArea (QWidget *parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, SbBool getMouseInput=TRUE, SbBool getKeyboardInput=TRUE)
 Constructor which is passed arguments which tell it whether to register the mouse and keyboard devices by default (SoQtMouse and SoQtKeyboard).
 
 ~SoQtRenderArea ()
 Destructor.
 
void registerDevice (SoQtDevice *d)
 Registers interest in devices.
 
void unregisterDevice (SoQtDevice *d)
 Unregisters interest in devices.
 
void setBackgroundColor (const SbColor &c)
 Sets the background color for this window.
 
SbColor getBackgroundColor () const
 Gets the background color for this window.
 
void setBackgroundIndex (int index)
 Sets the window background color when in color index mode.
 
int getBackgroundIndex () const
 Gets the window background color when in color index mode.
 
void setColorMap (QGLColormap *cmap)
 Sets the colors to use when displaying in color index mode.
 
void setViewportRegion (const SbViewportRegion &newRegion)
 Sets viewport region to use for rendering.
 
const SbViewportRegiongetViewportRegion () const
 Gets current viewport region to use for rendering.
 
void setTransparencyType (SoGLRenderAction::TransparencyType type)
 Sets the algorithm for rendering transparent objects.
 
SoGLRenderAction::TransparencyType getTransparencyType () const
 Gets the algorithm for rendering transparent objects.
 
void setFastEditSavePolicy (SoGLRenderAction::FastEditSavePolicy policy, SbBool fastEditDelayedObjects=FALSE)
 Sets fast editing save policy to use when rendering.
 
SoGLRenderAction::FastEditSavePolicy getFastEditSavePolicy () const
 Returns fast editing save policy used when rendering.
 
void setInvalidateCacheMode (SoGLRenderAction::InvalidateCacheMode icm)
 Enables or disables the invalidation of render caches.
 
SoGLRenderAction::InvalidateCacheMode getInvalidateCacheMode ()
 Returns the current cache invalidation mode.
 
void setClearBeforeRender (SbBool trueOrFalse, SbBool zbTrueOrFalse=TRUE)
 Enables/prevents window clearing from happening before a rendering starts (default is clear TRUE).
 
SbBool isClearBeforeRender () const
 Queries whether the window will be cleared before rendering starts.
 
SbBool isClearZBufferBeforeRender () const
 Queries whether the depth buffer (sometimes called the Z buffer) will be cleared before rendering starts.
 
void setAutoRedraw (SbBool trueOrFalse)
 The render area will automatically redraw whenever something in the scene graph changes.
 
SbBool isAutoRedraw () const
 Queries whether the render area will automatically redraw whenever something in the scene graph changes.
 
void setRedrawPriority (uint32_t priority)
 Sets the priority of the redraw sensor.
 
uint32_t getRedrawPriority () const
 Gets the priority of the redraw sensor.
 
void render ()
 Calling this forces the render area to be redrawn now.
 
void scheduleRedraw ()
 Schedules a redraw to happen sometime soon (as opposed to immediately).
 
void redrawOnSelectionChange (SoSelection *s)
 Call this convenience method to have this render area redraw whenever the selection list changes in the passed node.
 
void setEventCallback (SoQtRenderAreaEventCB *fcn, void *userData=NULL)
 Windows messages which occur in the render area window are either directly handled by the viewer (when this is really a viewer) or automatically translated to SoEvents, then passed into the scene graph (via the SoHandleEventAction) so that live scene graph objects can handle the message (when viewers are not in viewing mode).
 
void setSceneManager (SoSceneManager *sm)
 Sets the normal scene manager.
 
SoSceneManagergetSceneManager () const
 Gets the normal scene manager.
 
void setGLRenderAction (SoGLRenderAction *ra)
 Sets the GL render action to use.
 
SoGLRenderActiongetGLRenderAction () const
 Gets the current GL render action.
 
const SbGLShareContext getShareContext ()
 Returns the information needed to make OpenGL render contexts share OpenGL objects, for example, display lists and texture objects.
 
void setPostRenderCallback (SoQtRenderAreaRenderCB *fcn, void *userData=NULL)
 Specifies a function to be called after the Open Inventor render traversal and immediately before the OpenGL buffer swap.
 
SoQtRenderAreaRenderCBgetPostRenderCallback (const void *&userData) const
 Gets the post-render callback function and data.
 
void setFloatingColorBuffer (SbBool enable, FloatColorBufferSize size=FLOAT_16_COLOR_BUFFER)
 Enables/disables floating point rendering using 16- or 32-bit components.
 
void getFloatingColorBuffer (SbBool &enable, FloatColorBufferSize &size)
 Returns TRUE if floating point rendering is used and its precision.
 
void sendEvent (QEvent *anEvent)
 Sends the event to be processed by the renderArea.
 
virtual void setMPEGRecorder (SoMPEGRenderer *recorder)
 Sets the recorder used for MPEG encoding.
 
virtual SoMPEGRenderergetMPEGRecorder () const
 Returns the recorder used for MPEG encoding.
 
- Public Member Functions inherited from SoQtGLWidget
int getColorMapSize ()
 Returns the color map size.
 
void setColorMapSize (int size)
 Sets the color map size.
 
virtual WindowQt getNormalWindow ()
 Gets the normal GL window (window system identifier of the widget), which is needed as an argument to glXMakeCurrent() (on Xt) or SbGlContextHelper::makeCurrent() (on Windows) when drawing in the normal planes.
 
QOpenGLContext * getQOpenGLContext ()
 Gets the current context, which is needed as an argument to glXMakeCurrent() (on Xt) or SbGlContextHelper::makeCurrent() (on Windows) when drawing in the normal planes.
 
SoGLContextgetNormalSoContext ()
 Gets the current context, which is needed as an argument to glXMakeCurrent() (on Xt) or SbGlContextHelper::makeCurrent() (on Windows) when drawing in the normal planes.
 
QWidget * getNormalWidget ()
 Gets the current normal widget.
 
QSurfaceFormat getQSurfaceFormat ()
 Returns the QSurfaceFormat currently used.
 
virtual void setNormalVisual (const SoGLFormat &format)
 Sets the visual/pixel format for the normal window.
 
virtual void show ()
 This shows the component.
 
virtual void setDoubleBuffer (SbBool onOrOff)
 Routine that dynamically changes between single and double buffering.
 
SbBool isDoubleBuffer ()
 Returns whether double buffering is on or off.
 
void setBorder (SbBool onOrOff)
 Included for portability only.
 
int getBorderSize ()
 Included for portability only.
 
SbBool isBorder () const
 Included for portability only.
 
void setDrawToFrontBufferEnable (SbBool enableFlag)
 Sets drawing to the front buffer.
 
SbBool isDrawToFrontBufferEnable () const
 Queries drawing to the front buffer.
 
virtual SbBool bindNormalContext ()
 Makes the normal rendering context the current context.
 
virtual SbBool unbindNormalContext ()
 unbind the current context (previously bind with bindNormalContext );
 
virtual SbBool swapNormalBuffers ()
 Swaps the normal front and back buffers.
 
virtual void setCursor (const QCursor &newCursor)
 Sets the current cursor.
 
QCursor getCursor () const
 Returns the current cursor.
 
void setAntialiasing (const float quality, const SoSceneManager::AntialiasingMode mode=SoSceneManager::AUTO)
 Enable (or disable) antialiasing with specified quality and mode.
 
void setAntialiasing (SoAntialiasingParameters *advancedParameters)
 Enable (or disable) antialiasing with specific parameters.
 
float getAntialiasingQuality () const
 Returns the antialiasing quality set using the setAntialiasing(float,AntialiasingMode) method.
 
SoSceneManager::AntialiasingMode getAntialiasingMode () const
 Returns the antialiasing mode set using the setAntialiasing(float,AntialiasingMode) method.
 
SoAntialiasingParametersgetAntialiasingParameters () const
 Returns the antialiasing parameters set using the setAntialiasing(SoAntialiasingParameters*) method.
 
bool saveSnapshot (const SbString &filename, bool overwrite=true)
 Save a snapshot of the current image displayed in the viewer.
 
- Public Member Functions inherited from SoQtComponent
SbBool isVisible ()
 Returns TRUE if this component is mapped onto the screen.
 
virtual QWidget * getWidget () const
 This returns the base widget handle for this component.
 
SbBool isTopLevelShell () const
 Returns TRUE if this component is a top level shell component (has its own window).
 
QWidget * getShellWidget () const
 Returns the topLevelShell widget handle (NULL if the topLevelShell hasn't been created by this component).
 
QWidget * getParentWidget () const
 Returns the parent widget handle.
 
void setSize (const SbVec2s &size)
 Convenience routine on the widget handle.
 
SbVec2s getSize ()
 Convenience routine on the widget handle.
 
virtual SbBool setFullScreen (const SbBool enable)
 Switches the viewer into (or out of) fullscreen mode.
 
SbBool isFullScreen (void) const
 Queries if the viewer is in fullscreen mode.
 
void setFullScreenEnable (const SbBool enable)
 Enables/disables fullscreen mode.
 
SbBool isFullScreenEnable (void) const
 Queries if it is possible to put the viewer in fullscreen mode.
 
SbGlContextHelper::Display getDisplay ()
 On UNIX, returns the X display associated with this components widget.
 
void setTitle (const char *newTitle)
 Sets window title.
 
void setTitle (const SbString &newTitle)
 Sets window title.
 
void setTitle (const QString &newTitle)
 Sets window title.
 
const QString getTitle () const
 Gets window title.
 
void setIconTitle (const QString &newIconTitle)
 Included for portability only.
 
const QString getIconTitle () const
 Included for portability only.
 
SbString getWidgetName () const
 Returns the widget handle name.
 
SbString getClassName () const
 Returns the class name.
 
void setWindowCloseCallback (SoQtComponentCB *func, void *data=NULL)
 Sets which callback to call when the user closes this component (double click in the upper left corner) - by default hide() is called on this component, unless a callback is set to something other than NULL.
 
- Public Member Functions inherited from SoStereoViewer
virtual ~SoStereoViewer ()
 Destructor.
 

Additional Inherited Members

- Static Public Member Functions inherited from SoQtRenderArea
static uint32_t getDefaultRedrawPriority ()
 Gets the default priority number of the redraw sensor.
 
static SbBool isFloatingColorBufferSupported ()
 Returns TRUE if floating point rendering is available.
 
- Static Public Member Functions inherited from SoQtComponent
static SoQtComponentgetComponent (QWidget *widget)
 Returns the SoQtComponent for this widget handle.
 
- Public Attributes inherited from SoQtFullViewer
QPointer< QMenu > mainPopup
 Pointer to the root of the popup menu.
 
QPointer< QMenu > funcPopup
 Pointer to the Functions submenu.
 
QPointer< QMenu > drawPopup
 Pointer to the Draw Style submenu.
 
QPointer< QMenu > prefPopup
 Pointer to the Preferences submenu.
 
QAction * curPopupDrawItem
 In this version we track the currently "check marked" menu item in the Draw Style submenu (only one checked at a time).
 
QAction * curPopupMoveItem
 
QAction * curPopupBufferItem
 
QPointer< QMenu > ClientPopup
 Popup menu provided by a client (i.e.
 
- Public Attributes inherited from SoQtComponent
SbString helpFileName
 Name of help file to open when the viewer Help button is pressed.
 
- Protected Slots inherited from SoQtViewer
void processCommonEnterEvents (unsigned int state)
 Process common enter events of the viewer.
 

Detailed Description

VSG extension Viewer component which uses a virtual trackball to view the data.

The Examiner viewer component allows you to rotate the view around a point of interest using a virtual trackball. The viewer uses the camera focalDistance field to figure out the point of rotation, which is usually set to be at the center of the scene. In addition to allowing you to rotate the camera around the point of interest, this viewer also allows you to translate the camera in the viewer plane, as well as dolly (move forward and backward) to get closer to or further away from the point of interest. The viewer seek capability can be used to position the camera towards a selected object or point.

Focal point:

The center of rotation for the ExaminerViewer, called the focalPoint, is defined as a point that is focalDistance from the camera position, along the viewVector, where the viewVector is (indirectly) defined by the camera orientation. You can compute the focalPoint for the current camera settings like this:
mx = pCamera->orientation.getValue();
SbVec3f viewVec(-mx[2][0], -mx[2][1], -mx[2][2]);
SbVec3f camPos = pCamera->position.getValue();
float focDist = pCamera->focalDistance.getValue();
SbVec3f focalPt = camPos + (focDist * viewVec);
4x4 matrix class.
Definition SbMatrix.h:309
void getValue(SbMat &m) const
Returns matrix as a 4x4 array of elements.
3D vector class.
Definition SbVec.h:932
const float * getValue() const
Returns vector components.
Definition SbVec.h:977
To better understand the above code, remember that the "=" operator will automatically convert an SbRotation to an SbMatrix; since orientation is a pure rotation matrix we can consider the first three columns of this matrix to be the orthogonal X, Y and Z vectors defining the rotated coordinate system, therefore the view vector is the inversion of the Z axis vector; and finally because this vector is already normalized, an offset of "dist" along this vector is simply "dist * vector". Of course if you have a focalPoint in mind, you can work backward to compute camera position or focalDistance depending on which parameters you want to keep constant.

Viewer components:

For applications that need more flexibility, we recommend using the "viewer component" classes to build exactly the viewing behaviors that your application needs. Please see the SoCameraInteractor, SceneInteractor and SceneExaminer classes.

USAGE

    (For 3-button mouse only.)

    Left Mouse: Rotate the virtual trackball.

    Middle Mouse or Ctrl + Left Mouse: Translate up, down, left, right.

    Ctrl + Middle Mouse or
    Left + Middle Mouse:
    Dolly in and out (gets closer to and further away from the object).

    's' + Left Mouse: Alternative to the Seek button. Press (but do not hold down) the 's' key, then click on a target object.

    Right Mouse: Open the popup menu.

    ALT: When the viewer is in selection (a.k.a. pick) mode, pressing and holding the ALT key temporarily switches the viewer to viewing mode. When the ALT key is released, the viewer returns to selection mode.
    Note 1: If any of the mouse buttons are currently depressed, the ALT key has no effect.
    Note 2: On UNIX, Open Inventor may lose track of the ALT key state (up or down) if you release the key outside of the Inventor window. Pressing and releasing the key inside the Inventor window will allow Open Inventor to once again know the key's correct state.
    Note 3: If your QtExaminerViewer is encapsulated in a QMain window, the QMenuBar may receive the ALT key press event before the QtExaminerViewer. If this happens, the ALT key won't have any effect on the viewer's viewing mode.

    Mouse Wheel: Dolly/zoom camera
    Rotating the mouse wheel does a camera "dolly" operation on a perspective camera (moving the camera closer or farther away from the scene, which visually zoom) or a camera "zoom" operation on an orthographic camera (changing the view volume height).

    Note that many users find the default dolly speed with the mouse wheel to be too slow. The user can hold down the Shift key to make the mouse wheel dolly go 2X faster. To increase the base speed set the environment variable OIV_WHEEL_DELTA. Mouse wheel events contain a "delta" that is a multiple of 120. The viewer divides this value by OIV_WHEEL_DELTA to compute the camera dolly increment. The default value for OIV_WHEEL_DELTA is 120. So, for example, setting OIV_WHEEL_DELTA to 12 makes the mouse wheel dolly go 10X faster.

SEE ALSO

SoQtFullViewer, SoQtViewer, SoQtComponent, SoQtRenderArea, SoQtWalkViewer, SoQtFlyViewer, SoQtPlaneViewer

Definition at line 187 of file SoQtExaminerViewer.h.

Member Enumeration Documentation

◆ ConstrainedViewingMode

Constrained viewing mode.

Enumerator
NONE 

No axis constraints.

CONSTRAINED_VIEWING_MODE_X 

Constrains camera rotation around X axis.

CONSTRAINED_VIEWING_MODE_Y 

Constrains camera rotation around Y axis.

CONSTRAINED_VIEWING_MODE_Z 

Constrains camera rotation around Z axis.

Definition at line 235 of file SoQtExaminerViewer.h.

◆ ViewingMode

Viewing mode.

Enumerator
VIEWING_MODE_SPIN 

Rotate the camera around the point of interest.

VIEWING_MODE_SPIN_CONSTRAINED 

Same as VIEWING_MODE_SPIN but add also constrained camera rotation.

It modifies the viewer usage described previously as follow:

  • Ctrl + Left Mouse : Rotation around the Z axis
  • Shift + Left Mouse or : Rotation around the X or the Y axis.

    If the mouse movement is globally from the left to the right (resp. from up to down) the Y axis (resp. X axis) is chosen.

VIEWING_MODE_PAN 

Translate the camera in the viewer plane.

VIEWING_MODE_ROLL 

Roll the camera in the viewer plane.

VIEWING_MODE_ZOOM 

Dolly/Zoom (move forward and backward) to get closer to or further away from the point of interest.

Definition at line 197 of file SoQtExaminerViewer.h.

Constructor & Destructor Documentation

◆ SoQtExaminerViewer()

SoQtExaminerViewer::SoQtExaminerViewer ( QWidget *  parent = NULL,
const char *  name = NULL,
SbBool  buildInsideParent = TRUE,
SoQtFullViewer::BuildFlag  flag = SoQtFullViewer::BUILD_ALL,
SoQtViewer::Type  type = SoQtViewer::BROWSER 
)

Constructor which specifies the viewer type.

Please refer to SoQtViewer for a description of the viewer types.

◆ ~SoQtExaminerViewer()

SoQtExaminerViewer::~SoQtExaminerViewer ( )

Destructor.

Member Function Documentation

◆ activateDolly()

virtual void SoQtExaminerViewer::activateDolly ( const SbVec2s newLocator)
virtual

Sets the start locator for dolly camera animation.

This method should be called fisrt, before to start a dolly camera animation.

Parameters
newLocatorThe start mouse position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left.

Since Open Inventor 9.2.1

◆ activatePanning()

virtual void SoQtExaminerViewer::activatePanning ( const SbVec2s newLocator)
virtual

Sets the start locator for pan camera animation.

This method should be called fisrt, before to start a pan camera animation.

Parameters
newLocatorThe start mouse position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left.

Since Open Inventor 9.2.1

◆ activateRoll()

virtual void SoQtExaminerViewer::activateRoll ( const SbVec2s newLocator)
virtual

Sets the start locator for roll camera animation.

This method should be called fisrt, before to start a roll camera animation.

Parameters
newLocatorThe start mouse position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left.

Since Open Inventor 9.2.1

◆ activateSpinning()

virtual void SoQtExaminerViewer::activateSpinning ( const SbVec2s newLocator)
virtual

Sets the start locator for spin camera animation.

This method should be called fisrt, before to start a spin camera animation.

Parameters
newLocatorThe start mouse position in pixels. The coordinates must be defined with x in the range [0,window width] and y in the range [0,window height] with min y at the bottom and min x on the left.

Since Open Inventor 9.2.1

◆ dollyCamera()

virtual void SoQtExaminerViewer::dollyCamera ( const SbVec2s newLocator)
virtual

Move the camera on the z axis based on cursor motion.

This corresponds to pressing left and middle mouse buttons, pressing control + shift + left mouse button or using the mouse wheel.

Parameters
newLocatorThe new cursor position. The coordinates are in pixels with x in the range [0,window width-1] and y in the range [0,window height-1] with min y at the bottom and min x on the left.

◆ getConstrainedViewingMode()

ConstrainedViewingMode SoQtExaminerViewer::getConstrainedViewingMode ( ) const
inline

Returns the current constrained viewing mode.

Definition at line 300 of file SoQtExaminerViewer.h.

◆ getFeedbackSize()

int SoQtExaminerViewer::getFeedbackSize ( ) const
inline

Returns the point of rotation feedback size in pixels.

Definition at line 322 of file SoQtExaminerViewer.h.

◆ getViewingMode()

ViewingMode SoQtExaminerViewer::getViewingMode ( ) const
inline

Gets the current viewing mode.

Definition at line 282 of file SoQtExaminerViewer.h.

◆ isAnimating()

SbBool SoQtExaminerViewer::isAnimating ( )
inline

Queries if the viewer is currently animating.

Definition at line 346 of file SoQtExaminerViewer.h.

◆ isAnimationEnabled()

SbBool SoQtExaminerViewer::isAnimationEnabled ( )
inline

Returns whether spin animation is enabled.

Definition at line 336 of file SoQtExaminerViewer.h.

◆ isFeedbackVisible()

SbBool SoQtExaminerViewer::isFeedbackVisible ( ) const
inline

Returns the rotation feedback flag.

Definition at line 312 of file SoQtExaminerViewer.h.

◆ panCamera()

virtual void SoQtExaminerViewer::panCamera ( const SbVec2f newLocator)
virtual

Pans the camera based on cursor motion.

Parameters
newLocatorThe new cursor position. The coordinates are in normalized device coordinates with x and y in the range [0,1] with min y at the bottom and min x on the left.

◆ resetToHomePosition()

virtual void SoQtExaminerViewer::resetToHomePosition ( )
virtual

Restores the camera values.

Reimplemented from SoQtViewer.

◆ reverseDollyCamera()

virtual void SoQtExaminerViewer::reverseDollyCamera ( const SbVec2s newLocator)
virtual

Same as dollyCamera but reversed.

Parameters
newLocatorThe new cursor position. The coordinates are in pixels with x in the range [0,window width-1] and y in the range [0,window height-1] with min y at the bottom and min x on the left.

◆ rollCamera()

virtual void SoQtExaminerViewer::rollCamera ( const SbVec2s newLocator)
virtual

Roll the camera based on cursor motion.

Parameters
newLocatorThe new cursor position. The coordinates are in pixels with x in the range [0,window width-1] and y in the range [0,window height-1] with min y at the bottom and min x on the left.

◆ setAnimationEnabled()

void SoQtExaminerViewer::setAnimationEnabled ( SbBool  onOrOff)

Enables/disables the spin animation feature of the viewer (enabled by default).



The default value can be set using the environment variable OIV_VIEWER_ANIMATION (0 = OFF, 1 = ON).

◆ setCamera()

virtual void SoQtExaminerViewer::setCamera ( SoCamera cam)
virtual

Sets the edited camera.

Setting the camera is only needed if the first camera found in the scene when setting the scene graph isn't the one the user really wants to edit.

Reimplemented from SoQtFullViewer.

◆ setConstrainedViewingMode()

void SoQtExaminerViewer::setConstrainedViewingMode ( ConstrainedViewingMode  mode)

Sets the constrained viewing mode.

This method is useful to associate a key combination with a constrained mode. Notes:

  • There is no need to set the viewing mode to VIEWING_MODE_SPIN_CONSTRAINED to apply a constraint.
  • When the constrained mode is set to NONE, the automatic constraints apply if VIEWING_MODE_SPIN_CONSTRAINED is set.
  • This setting is a "one shot". It only applies to the next mouse button down event.

◆ setCursorEnabled()

virtual void SoQtExaminerViewer::setCursorEnabled ( SbBool  onOrOff)
virtual

Sets whether the viewer is allowed to change the cursor over the renderArea window.

When disabled, the cursor is not defined by the viewer and will not change as the mode of the viewer changes. When re-enabled, the viewer will reset it to the appropriate icon.

Disabling the cursor enables the application to set the cursor directly on the viewer window or on any parent widget of the viewer. This can be used when setting a busy cursor on the application shell.

Reimplemented from SoQtViewer.

◆ setFeedbackSize()

void SoQtExaminerViewer::setFeedbackSize ( int  newSize)

Sets the point of rotation feedback size in pixels (default 20 pix).

◆ setFeedbackVisibility()

void SoQtExaminerViewer::setFeedbackVisibility ( SbBool  onOrOff)

Shows/hides the point of rotation feedback, which only appears while in viewing mode (default is off).

◆ setSeekMode()

virtual void SoQtExaminerViewer::setSeekMode ( SbBool  onOrOff)
virtual

Set the viewer into/out of seek mode (default OFF).

Actual seeking will not happen until the viewer decides to, for example, on a mouse click.

Note: Setting the viewer out of seek mode while the camera is being animated will stop the animation at the current location.

Reimplemented from SoQtViewer.

◆ setViewing()

virtual void SoQtExaminerViewer::setViewing ( SbBool  onOrOff)
virtual

Sets whether the viewer is turned on or off.

When turned on, events are consumed by the viewer. When viewing is off, events are processed by the viewer's render area. This means events will be sent down to the scene graph for processing (i.e. picking can occur). Note that if the application has registered an event callback, it will be invoked on every message, whether viewing is turned on or not. However, the return value of this callback (which specifies whether the callback handled the event or not) is ignored when viewing is on. That is, the viewer will process the event even if the callback already did. This is to ensure that the viewing paradigm is not broken (default viewing is on).

Reimplemented from SoQtFullViewer.

◆ setViewingMode()

void SoQtExaminerViewer::setViewingMode ( ViewingMode  viewingMode)

Sets the viewing mode.

This method specifies what is the viewing behavior when the left mouse is pressed. The default value is SPIN_VIEWING_MODE.

◆ spinCamera()

virtual void SoQtExaminerViewer::spinCamera ( const SbVec2f newLocator)
virtual

Spin the camera based on cursor motion.

Parameters
newLocatorThe new cursor position. The coordinates are in normalized device coordinates with x and y in the range [0,1] with min y at the bottom and min x on the left.

◆ spinConstrainedCamera()

virtual void SoQtExaminerViewer::spinConstrainedCamera ( const SbVec2f newLocator,
int  axisIndex 
)
virtual

Spin the constrained camera based on cursor motion.

Parameters
newLocatorThe new cursor position. The coordinates are in normalized device coordinates with x and y in the range [0,1] with min y at the bottom and min x on the left.
axisIndexthe axis index:
  • X = 0
  • Y = 1
  • Z = 2

◆ stopAnimating()

void SoQtExaminerViewer::stopAnimating ( )

Stops animation, if it is occurring.

◆ viewAll()

virtual void SoQtExaminerViewer::viewAll ( )
virtual

Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).

The viewer applies an SoGetBoundingBoxAction to the scene graph to get the bounding box of the entire scene. The bounding box will only include shapes that are actually traversed. For example the bounding box will not include shapes under an SoSwitch with whichChild set to SO_SWITCH_NONE. The action does not consider the visibility of shapes that are traversed. In other words the bounding box will include shapes that are invisible (SoDrawStyle), shapes that are clipped (SoClipPlane), etc. Use an SoBBox node to exclude shapes from the bounding box computation. Bounding boxes are automatically cached at SoSeparator nodes, so getting the bounding box is very fast when the scene graph has not been changed.

See all SoCamera::viewAll(). This method allows the application to adjust the camera based on a specific sub-graph or path in the scene graph.

Reimplemented from SoQtViewer.


The documentation for this class was generated from the following file: