SoQtExaminerViewer(3)
okay so bestie, this is SoQtExaminerViewer(3) from the SoQt manual, and she is literally the main character of 3D model examination ๐
โจ. Think of her as your fave viewer for looking at 3D stuff, and she's about to spill every single public and protected member function. No cap, we're keeping every signature exactly as it is, just with way more sparkle. ๐ฆ
โจ NAME โจ
The SoQtExaminerViewer class is a 3D-model examination viewer. That's the whole vibe: she examines 3D models. ๐
๐ธ SYNOPSIS ๐ธ
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
Inherits SoQtFullViewer.
๐ Public Member Functions ๐
SoQtExaminerViewer (QWidget *parent=NULL, const char *name=NULL, SbBool embed=TRUE, SoQtFullViewer::BuildFlag flag=BUILD_ALL, SoQtViewer::Type type=BROWSER)โ the constructor, aka how you birth this icon. Takes a parent widget, a name, an embed flag, a build flag, and a viewer type. ๐void setAnimationEnabled (const SbBool enable)โ turns animation on or off based onenable.SbBool isAnimationEnabled (void) constโ returns whether animation is enabled, as anSbBool.void stopAnimating (void)โ stops the animation, periodt. ๐SbBool isAnimating (void) constโ checks if it's currently animating.void setFeedbackVisibility (const SbBool enable)โ shows or hides feedback based onenable.SbBool isFeedbackVisible (void) constโ tells you if feedback is visible.void setFeedbackSize (const int size)โ sets the feedback size tosize.int getFeedbackSize (void) constโ returns the feedback size as anint.virtual void setViewing (SbBool enable)โ virtual; turns viewing mode on or off based onenable.virtual void setCamera (SoCamera *camera)โ virtual; sets the camera tocamera.virtual void setCursorEnabled (SbBool enable)โ virtual; enables or disables the cursor based onenable.
๐ Public Member Functions inherited from SoQtFullViewer ๐
these are all about decorations, buttons, and menus, and they're iconic.
void setDecoration (const SbBool on)โ turns decoration on or off based onon.SbBool isDecoration (void) constโ checks if decoration is on.void setPopupMenuEnabled (const SbBool on)โ enables or disables the popup menu based onon.SbBool isPopupMenuEnabled (void) constโ checks if the popup menu is enabled.QWidget * getAppPushButtonParent (void) constโ returns the parent widget for app push buttons.void addAppPushButton (QWidget *newButton)โ addsnewButtonas an app push button.void insertAppPushButton (QWidget *newButton, int index)โ insertsnewButtonatindexin the app push button list.void removeAppPushButton (QWidget *oldButton)โ removesoldButtonfrom the app push buttons.int findAppPushButton (QWidget *oldButton) constโ findsoldButtonin the app push buttons and returns its index.int lengthAppPushButton (void) constโ returns how many app push buttons there are.QWidget * getRenderAreaWidget (void) constโ returns the render area widget.virtual void setComponentCursor (const SoQtCursor &cursor)โ virtual; sets the component cursor tocursor.
๐ Public Member Functions inherited from SoQtViewer ๐
camera stuff, stereo stuff, seek stuff, and more, all here.
SoCamera * getCamera (void) constโ returns the current camera.virtual void setCameraType (SoType type)โ virtual; sets the camera type totype.SoType getCameraType (void) constโ returns the camera type.virtual void toggleCameraType (void)โ virtual; toggles the camera type.virtual void viewAll (void)โ virtual; views all the things.virtual void saveHomePosition (void)โ virtual; saves the home position.virtual void resetToHomePosition (void)โ virtual; resets to the home position.virtual void setHeadlight (SbBool enable)โ virtual; turns the headlight on or off based onenable.SbBool isHeadlight (void) constโ checks if the headlight is on.SoDirectionalLight * getHeadlight (void) constโ returns the headlight as anSoDirectionalLight *.virtual void setDrawStyle (SoQtViewer::DrawType type, SoQtViewer::DrawStyle style)โ virtual; sets the draw style fortypetostyle.SoQtViewer::DrawStyle getDrawStyle (const SoQtViewer::DrawType type) constโ returns the draw style fortype.virtual void setBufferingType (SoQtViewer::BufferType type)โ virtual; sets the buffering type totype.SoQtViewer::BufferType getBufferingType (void) constโ returns the buffering type.SbBool isViewing (void) constโ checks if viewing is on.SbBool isCursorEnabled (void) constโ checks if the cursor is enabled.void setAutoClipping (SbBool enable)โ turns auto clipping on or off based onenable.SbBool isAutoClipping (void) constโ checks if auto clipping is on.void setAutoClippingStrategy (const AutoClippingStrategy strategy, const float value=0.6f, SoQtAutoClippingCB *cb=NULL, void *cbuserdata=NULL)โ sets the auto clipping strategy tostrategy, with optionalvalue=0.6f,cb=NULL, andcbuserdata=NULL.virtual void setStereoViewing (SbBool enable)โ virtual; turns stereo viewing on or off based onenable.SbBool isStereoViewing (void) constโ checks if stereo viewing is on.virtual void setStereoOffset (const float dist)โ virtual; sets the stereo offset todist.float getStereoOffset (void) constโ returns the stereo offset as afloat.SbBool setStereoType (SoQtViewer::StereoType s)โ sets the stereo type tosand returns anSbBool.SoQtViewer::StereoType getStereoType (void) constโ returns the stereo type.void setAnaglyphStereoColorMasks (const SbBool left[3], const SbBool right[3])โ sets the anaglyph stereo color masks fromleft[3]andright[3].void getAnaglyphStereoColorMasks (SbBool left[3], SbBool right[3])โ gets the anaglyph stereo color masks intoleft[3]andright[3].void setDetailSeek (const SbBool enable)โ turns detail seek on or off based onenable.SbBool isDetailSeek (void) constโ checks if detail seek is on.void setSeekTime (const float seconds)โ sets the seek time toseconds.float getSeekTime (void) constโ returns the seek time as afloat.void addStartCallback (SoQtViewerCB *func, void *data=NULL)โ addsfuncas a start callback with optionaldata=NULL.void addFinishCallback (SoQtViewerCB *func, void *data=NULL)โ addsfuncas a finish callback with optionaldata=NULL.void removeStartCallback (SoQtViewerCB *func, void *data=NULL)โ removesfuncfrom the start callbacks with optionaldata=NULL.void removeFinishCallback (SoQtViewerCB *func, void *data=NULL)โ removesfuncfrom the finish callbacks with optionaldata=NULL.void setWireframeOverlayColor (const SbColor &color)โ sets the wireframe overlay color tocolor.const SbColor & getWireframeOverlayColor (void) constโ returns the wireframe overlay color as aconst SbColor &.virtual void setDoubleBuffer (const SbBool enable)โ virtual; turns double buffering on or off based onenable.virtual void setSceneGraph (SoNode *root)โ virtual; sets the scene graph toroot.virtual SoNode * getSceneGraph (void)โ virtual; returns the scene graph as anSoNode *.
๐ฆ Public Member Functions inherited from SoQtRenderArea ๐ฆ
render area bestie, with colors, viewports, transparency, redraws, and GL actions.
SoQtRenderArea (QWidget *parent=NULL, const char *name=NULL, SbBool embed=TRUE, SbBool mouseInput=TRUE, SbBool keyboardInput=TRUE)โ constructor with optional parent, name, embed, mouse input, and keyboard input flags.~SoQtRenderArea ()โ destructor.void setOverlaySceneGraph (SoNode *scene)โ sets the overlay scene graph toscene.SoNode * getOverlaySceneGraph (void)โ returns the overlay scene graph.void setBackgroundColor (const SbColor &color)โ sets the background color tocolor.const SbColor & getBackgroundColor (void) constโ returns the background color.void setBackgroundIndex (int idx)โ sets the background index toidx.int getBackgroundIndex (void) constโ returns the background index.void setOverlayBackgroundIndex (int idx)โ sets the overlay background index toidx.int getOverlayBackgroundIndex (void) constโ returns the overlay background index.void setColorMap (int start, int num, const SbColor *colors)โ sets the color map starting atstartwithnumcolors fromcolors.void setOverlayColorMap (int start, int num, const SbColor *colors)โ sets the overlay color map starting atstartwithnumcolors fromcolors.void setViewportRegion (const SbViewportRegion &newRegion)โ sets the viewport region tonewRegion.const SbViewportRegion & getViewportRegion (void) constโ returns the viewport region.void setTransparencyType (SoGLRenderAction::TransparencyType type)โ sets the transparency type totype.SoGLRenderAction::TransparencyType getTransparencyType (void) constโ returns the transparency type.void setAntialiasing (SbBool smoothing, int numPasses)โ sets antialiasing withsmoothingandnumPasses.void getAntialiasing (SbBool &smoothing, int &numPasses) constโ gets antialiasing settings intosmoothingandnumPasses.void setClearBeforeRender (SbBool enable, SbBool zbEnable=TRUE)โ sets clear before render withenableand optionalzbEnable=TRUE.SbBool isClearBeforeRender (void) constโ checks if clear before render is on.SbBool isClearZBufferBeforeRender (void) constโ checks if clear Z buffer before render is on.void setClearBeforeOverlayRender (SbBool enable)โ sets clear before overlay render based onenable.SbBool isClearBeforeOverlayRender (void) constโ checks if clear before overlay render is on.void setAutoRedraw (SbBool enable)โ turns auto redraw on or off based onenable.SbBool isAutoRedraw (void) constโ checks if auto redraw is on.void setRedrawPriority (uint32_t priority)โ sets the redraw priority topriority.uint32_t getRedrawPriority (void) constโ returns the redraw priority asuint32_t.void render (void)โ renders, periodt.void renderOverlay (void)โ renders the overlay.void scheduleRedraw (void)โ schedules a redraw.void scheduleOverlayRedraw (void)โ schedules an overlay redraw.void redrawOnSelectionChange (SoSelection *selection)โ redraws whenselectionchanges.void redrawOverlayOnSelectionChange (SoSelection *selection)โ redraws the overlay whenselectionchanges.void setEventCallback (SoQtRenderAreaEventCB *func, void *user=NULL)โ sets the event callback tofuncwith optionaluser=NULL.void setSceneManager (SoSceneManager *manager)โ sets the scene manager tomanager.SoSceneManager * getSceneManager (void) constโ returns the scene manager.void setOverlaySceneManager (SoSceneManager *manager)โ sets the overlay scene manager tomanager.SoSceneManager * getOverlaySceneManager (void) constโ returns the overlay scene manager.void setGLRenderAction (SoGLRenderAction *action)โ sets the GL render action toaction.SoGLRenderAction * getGLRenderAction (void) constโ returns the GL render action.void setOverlayGLRenderAction (SoGLRenderAction *action)โ sets the overlay GL render action toaction.SoGLRenderAction * getOverlayGLRenderAction (void) constโ returns the overlay GL render action.SbBool sendSoEvent (const SoEvent *event)โ sendseventas an SoEvent.void registerDevice (SoQtDevice *device)โ registersdevice.void unregisterDevice (SoQtDevice *device)โ unregistersdevice.
๐ง Public Member Functions inherited from SoQtGLWidget ๐ง
GL widget energy: borders, buffers, stereo, samples, and focus stealing.
void setBorder (const SbBool enable)โ turns border on or off based onenable.SbBool isBorder (void) constโ checks if border is on.SbBool isDoubleBuffer (void) constโ checks if double buffer is on.void setDrawToFrontBufferEnable (const SbBool enable)โ sets draw to front buffer enable based onenable.SbBool isDrawToFrontBufferEnable (void) constโ checks if draw to front buffer enable is on.void setQuadBufferStereo (const SbBool enable)โ turns quad buffer stereo on or off based onenable.SbBool isQuadBufferStereo (void) constโ checks if quad buffer stereo is on.void setAccumulationBuffer (const SbBool enable)โ turns accumulation buffer on or off based onenable.SbBool getAccumulationBuffer (void) constโ gets the accumulation buffer state.void setStencilBuffer (const SbBool enable)โ turns stencil buffer on or off based onenable.SbBool getStencilBuffer (void) constโ gets the stencil buffer state.void setAlphaChannel (const SbBool enable)โ turns alpha channel on or off based onenable.SbBool getAlphaChannel (void) constโ gets the alpha channel state.void setOverlayRender (const SbBool onoff)โ turns overlay render on or off based ononoff.SbBool isOverlayRender (void) constโ checks if overlay render is on.void setSampleBuffers (const int numsamples)โ sets sample buffers tonumsamples.int getSampleBuffers (void) constโ returns the number of sample buffers.void setStealFocus (SbBool enable)โ turns steal focus on or off based onenable.SbBool isStealFocus (void) constโ checks if steal focus is on.QWidget * getGLWidget (void) constโ returns the GL widget.QWidget * getNormalWidget (void) constโ returns the normal widget.QWidget * getOverlayWidget (void) constโ returns the overlay widget.SbBool hasOverlayGLArea (void) constโ checks if there is an overlay GL area.SbBool hasNormalGLArea (void) constโ checks if there is a normal GL area.unsigned long getOverlayTransparentPixel (void)โ returns the overlay transparent pixel as anunsigned long.void getPointSizeLimits (SbVec2f &range, float &granularity)โ gets point size limits intorangeandgranularity.void getLineWidthLimits (SbVec2f &range, float &granularity)โ gets line width limits intorangeandgranularity.
๐ Public Member Functions inherited from SoQtComponent ๐
component basics: showing, hiding, sizes, titles, and close callbacks.
virtual SoType getTypeId (void) constโ virtual; returns the type ID.virtual ~SoQtComponent ()โ virtual destructor.virtual void show (void)โ virtual; shows the component.virtual void hide (void)โ virtual; hides the component.SbBool isFullScreen (void) constโ checks if full screen.SbBool setFullScreen (const SbBool onoff)โ sets full screen based ononoffand returns anSbBool.SbBool isVisible (void)โ checks if visible.SbBool isTopLevelShell (void) constโ checks if top level shell.QWidget * getWidget (void) constโ returns the widget.QWidget * getBaseWidget (void) constโ returns the base widget.QWidget * getShellWidget (void) constโ returns the shell widget.QWidget * getParentWidget (void) constโ returns the parent widget.void setSize (const SbVec2s size)โ sets the size tosize.SbVec2s getSize (void) constโ returns the size asSbVec2s.void setTitle (const char *const title)โ sets the title totitle.const char * getTitle (void) constโ returns the title.void setIconTitle (const char *const title)โ sets the icon title totitle.const char * getIconTitle (void) constโ returns the icon title.const char * getWidgetName (void) constโ returns the widget name.const char * getClassName (void) constโ returns the class name.void setWindowCloseCallback (SoQtComponentCB *const func, void *const user=NULL)โ sets the window close callback tofuncwith optionaluser=NULL.
โญ Public Member Functions inherited from SoQtObject โญ
SbBool isOfType (SoType type) constโ checks if the object is oftype.
๐ฅ Protected Member Functions ๐ฅ
these are the protected ones, so handle with care but know they exist.
SoQtExaminerViewer (QWidget *parent, const char *name, SbBool embed, SoQtFullViewer::BuildFlag flag, SoQtViewer::Type type, SbBool build)โ protected constructor withparent,name,embed,flag,type, andbuild.virtual void leftWheelMotion (float val)โ virtual; handles left wheel motion withval.virtual void bottomWheelMotion (float val)โ virtual; handles bottom wheel motion withval.virtual void rightWheelMotion (float val)โ virtual; handles right wheel motion withval.virtual void createViewerButtons (QWidget *parent, SbPList *buttonlist)โ virtual; creates viewer buttons inparentwithbuttonlist.virtual const char * getDefaultWidgetName (void) constโ virtual; returns the default widget name.virtual const char * getDefaultTitle (void) constโ virtual; returns the default title.virtual const char * getDefaultIconTitle (void) constโ virtual; returns the default icon title.virtual SbBool processSoEvent (const SoEvent *const event)โ virtual; processeseventas an SoEvent.virtual void setSeekMode (SbBool enable)โ virtual; sets seek mode based onenable.virtual void actualRedraw (void)โ virtual; does the actual redraw.virtual void afterRealizeHook (void)โ virtual; the after realize hook.
๐ธ Protected Member Functions inherited from SoQtFullViewer ๐ธ
more protected energy, now with wheels and trims and popup menus.
SoQtFullViewer (QWidget *parent, const char *name, SbBool embed, BuildFlag flag, Type type, SbBool build)โ protected constructor withparent,name,embed,flag,type, andbuild.~SoQtFullViewer ()โ destructor.virtual void sizeChanged (const SbVec2s &size)โ virtual; handles size changes withsize.QWidget * buildWidget (QWidget *parent)โ builds the widget inparent.virtual void buildDecoration (QWidget *parent)โ virtual; builds decoration inparent.virtual QWidget * buildLeftTrim (QWidget *parent)โ virtual; builds left trim inparent.virtual QWidget * buildBottomTrim (QWidget *parent)โ virtual; builds bottom trim inparent.virtual QWidget * buildRightTrim (QWidget *parent)โ virtual; builds right trim inparent.QWidget * buildAppButtons (QWidget *parent)โ builds app buttons inparent.QWidget * buildViewerButtons (QWidget *parent)โ builds viewer buttons inparent.virtual void buildPopupMenu (void)โ virtual; builds the popup menu.virtual void setPopupMenuString (const char *title)โ virtual; sets the popup menu string totitle.virtual void openPopupMenu (const SbVec2s position)โ virtual; opens the popup menu atposition.virtual void leftWheelStart (void)โ virtual; starts left wheel.virtual void leftWheelFinish (void)โ virtual; finishes left wheel.float getLeftWheelValue (void) constโ returns the left wheel value as afloat.void setLeftWheelValue (const float value)โ sets the left wheel value tovalue.virtual void bottomWheelStart (void)โ virtual; starts bottom wheel.virtual void bottomWheelFinish (void)โ virtual; finishes bottom wheel.float getBottomWheelValue (void) constโ returns the bottom wheel value as afloat.void setBottomWheelValue (const float value)โ sets the bottom wheel value tovalue.virtual void rightWheelStart (void)โ virtual; starts right wheel.virtual void rightWheelFinish (void)โ virtual; finishes right wheel.float getRightWheelValue (void) constโ returns the right wheel value as afloat.void setRightWheelValue (const float value)โ sets the right wheel value tovalue.void setLeftWheelString (const char *const name)โ sets the left wheel string toname.QWidget * getLeftWheelLabelWidget (void) constโ returns the left wheel label widget.void setBottomWheelString (const char *const name)โ sets the bottom wheel string toname.QWidget * getBottomWheelLabelWidget (void) constโ returns the bottom wheel label widget.void setRightWheelString (const char *const name)โ sets the right wheel string toname.const char * getRightWheelString () constโ returns the right wheel string.QWidget * getRightWheelLabelWidget (void) constโ returns the right wheel label widget.
okay that's part 1 of 4 bestie, and it's already giving main character energy ๐โจ more parts incoming, no cap.
๐
Protected Member Functions inherited from SoQtViewer ๐
These are the ones you get handed down from the SoQtViewer parent โ protected, so they're family-only, but they're yours:
SoQtViewer(QWidget *parent, const char *name, SbBool embed, Type type, SbBool build)โ the constructor you inherit.~SoQtViewer()โ the destructor.SbBool isSeekMode(void) constโ are we in seek mode rn?SbBool seekToPoint(const SoVec2s screenpos)โ seek to a screen position. (as written:const SbVec2s screenpos)void seekToPoint(const SbVec3f &scenepos)โ seek to a point in the scene instead.virtual void computeSeekFinalOrientation(void)โ figures out where the camera should end up, virtual so you can override it.void interactiveCountInc(void)โ bump the interactive counter.void interactiveCountDec(void)โ decrement it.int getInteractiveCount(void) constโ read it.void setSeekDistance(const float distance)โ set how far the seek goes.float getSeekDistance(void) constโ read that distance.void setSeekValueAsPercentage(const SbBool on)โ toggle whether the seek value is treated as a percentage.SbBool isSeekValuePercentage(void) constโ is it a percentage tho?virtual void changeCameraValues(SoCamera *camera)โ swap out camera values, virtual.void addSuperimposition(SoNode *scene)โ add an overlay scene.void removeSuperimposition(SoNode *scene)โ take one away.void setSuperimpositionEnabled(SoNode *scene, const SbBool enable)โ turn an overlay on or off.SbBool getSuperimpositionEnabled(SoNode *scene) constโ check if it's enabled.
๐ Protected Member Functions inherited from SoQtRenderArea ๐
SoQtRenderArea(QWidget *parent, const char *name, SbBool embed, SbBool mouseInput, SbBool keyboardInput, SbBool build)โ constructor, and yes it takes that many args.virtual void redraw(void)โ redraw, virtual.virtual void redrawOverlay(void)โ redraw just the overlay.virtual void actualOverlayRedraw(void)โ the actual doing of the overlay redraw.virtual void processEvent(QEvent *event)โ handle an event.virtual void initGraphic(void)โ set up the graphics.virtual void initOverlayGraphic(void)โ set up the overlay graphics.virtual void widgetChanged(QWidget *widget)โ notified when the widget changes.QWidget * buildWidget(QWidget *parent)โ builds the widget, hands it back.virtual SbBool glScheduleRedraw(void)โ schedule a redraw via GL.
๐ฆ Protected Member Functions inherited from SoQtGLWidget ๐ฆ
SoQtGLWidget(QWidget *const parent=NULL, const char *const name=NULL, const SbBool embed=TRUE, const int glmodes=SO_GL_RGB, const SbBool build=TRUE)โ constructor with a whole vibe of defaults.~SoQtGLWidget()โ destructor.QWidget * buildWidget(QWidget *parent)โ build it.void setGLSize(const SbVec2s size)โ set the GL size.SbVec2s getGLSize(void) constโ get the GL size.float getGLAspectRatio(void) constโ get the GL aspect ratio.void setGlxSize(const SbVec2s size)โ set the Glx size.SbVec2s getGlxSize(void) constโ get the Glx size.float getGlxAspectRatio(void) constโ get the Glx aspect ratio.void setStereoBuffer(SbBool flag)โ toggle the stereo buffer.SbBool isStereoBuffer(void) constโ is the stereo buffer on?SbBool isRGBMode(void)โ RGB mode check.void glLockNormal(void)โ lock, normal mode.void glUnlockNormal(void)โ unlock, normal mode.void glLockOverlay(void)โ lock, overlay mode.void glUnlockOverlay(void)โ unlock, overlay mode.void glSwapBuffers(void)โ swap those buffers bestie.void glFlushBuffer(void)โ flush the buffer.
๐ธ Protected Member Functions inherited from SoQtComponent ๐ธ
SoQtComponent(QWidget *const parent=NULL, const char *const name=NULL, const SbBool embed=TRUE)โ constructor.void setClassName(const char *const name)โ set the class name.void setBaseWidget(QWidget *widget)โ set the base widget.void registerWidget(QWidget *widget)โ register a widget.void unregisterWidget(QWidget *widget)โ unregister it.void addVisibilityChangeCallback(SoQtComponentVisibilityCB *const func, void *const user=NULL)โ hook a visibility-change callback.void removeVisibilityChangeCallback(SoQtComponentVisibilityCB *const func, void *const user=NULL)โ unhook it.
โญ Additional Inherited Members โญ
๐ Public Types inherited from SoQtFullViewer ๐
enum BuildFlag { BUILD_NONE = 0x00, BUILD_DECORATION = 0x01, BUILD_POPUP = 0x02, BUILD_ALL = (BUILD_DECORATION | BUILD_POPUP) }โ the build-flag enum, values copied exactly, no notes.
๐ Public Types inherited from SoQtViewer ๐
enum Type { BROWSER, EDITOR }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, VIEW_WIREFRAME_OVERLAY }enum DrawType { STILL = 0, INTERACTIVE }enum BufferType { BUFFER_SINGLE, BUFFER_DOUBLE, BUFFER_INTERACTIVE }enum AutoClippingStrategy { VARIABLE_NEAR_PLANE, CONSTANT_NEAR_PLANE }enum StereoType { STEREO_NONE, STEREO_ANAGLYPH, STEREO_QUADBUFFER, STEREO_INTERLEAVED_ROWS, STEREO_INTERLEAVED_COLUMNS }
๐ง Static Public Member Functions inherited from SoQtRenderArea ๐ง
static uint32_t getDefaultRedrawPriority(void)โ the default redraw priority.
๐ Static Public Member Functions inherited from SoQtComponent ๐
static void initClass(void)static SoType getClassTypeId(void)static void setWidgetCursor(QWidget *w, const SoQtCursor &cursor)static SoQtComponent * getComponent(QWidget *widget)static void initClasses(void)
โญ Static Public Member Functions inherited from SoQtObject โญ
static void initClass(void)static SoType getClassTypeId(void)static void init(void)
๐ Protected Attributes inherited from SoQtFullViewer ๐
QWidget * leftWheelQWidget * rightWheelQWidget * bottomWheelQWidget * leftDecorationQWidget * rightDecorationQWidget * bottomDecorationQWidget * leftWheelLabelchar * leftWheelStrfloat leftWheelValQWidget * rightWheelLabelchar * rightWheelStrfloat rightWheelValQWidget * bottomWheelLabelchar * bottomWheelStrfloat bottomWheelValSoQtPopupMenu * prefmenu
๐ฅ Protected Attributes inherited from SoQtGLWidget ๐ฅ
SbBool waitForExposeSbBool drawToFrontBuffer
๐ Detailed Description ๐
Okay so the SoQtExaminerViewer class? It's a 3D-model examination viewer. That's the whole vibe. ๐
This is the viewer everybody calls the most "general purpose" one, and it's constantly being used in rapid prototyping โ like, to examine simple models, but also complete scenes (though ngl, for the complete-scene situation you might be better off with one of the other viewer classes ๐).
Here's a complete, stand-alone example that shows how to set up an SoQtExaminerViewer as a model viewer that loads Inventor and VRML files from disk and places them inside the viewer for the end-user to examine โ full code, no cuts:
#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#include <Inventor/nodes/SoBaseColor.h>
#include <Inventor/nodes/SoCone.h>
#include <Inventor/nodes/SoSeparator.h>
int
main(int argc, char ** argv)
{
if (argc < 2) {
(void)fprintf(stderr, "\n\n\tUsage: %s <modelfilename>\n\n",
argc > 0 ? argv[0] : "viewerapp");
exit(1);
}
// Initialize SoQt and Inventor API libraries. This returns a main
// window to use.
QWidget* mainwin = SoQt::init(argc, argv, argv[0]);
// Open the argument file..
SoInput in;
SbBool ok = in.openFile(argv[1]);
if (!ok) { exit(1); }
// ..and import it.
SoSeparator * root = SoDB::readAll(&in);
if (root == NULL) { exit(1); }
root->ref();
// Use the ExaminerViewer, for a nice interface for 3D model
// inspection.
SoQtExaminerViewer * viewer = new SoQtExaminerViewer(mainwin);
viewer->setSceneGraph(root);
viewer->show();
// Pop up the main window.
SoQt::show(mainwin);
// Loop until exit.
SoQt::mainLoop();
// Clean up resources.
delete viewer;
root->unref();
return 0;
}
So SoQtExaminerViewer has a genuinely convenient interface for repositioning and reorienting the camera, by panning, rotating and zooming its position. The controls, bestie, are these:
- hold down left mouse button and move mouse pointer to rotate the camera around its current focal point (the focal point can be changed by doing a seek operation)
- hold middle mouse button to pan (or a CTRL-key plus left mouse button, or a SHIFT-key plus left mouse button)
- hold down left + middle mouse button to zoom / dolly, or CTRL + middle mouse button, or CTRL + SHIFT + the left mouse button
- click
's', then pick with the left mouse button to seek - right mouse button opens the pop-up menu
- click
'ESC'key to switch to and from 'camera interaction' mode and 'scene graph interaction' mode (seesetViewing()documentation) - hold down the
'ALT'key to temporary toggle from camera-interaction mode to scene graph-interaction mode
The SoQtExaminerViewer also provides a user decoration's button for toggling between orthographic or perspective camera view volumes and projection methods. Where is it? It's the bottom-most click button on the right decoration border. ๐
It also inherits the decoration buttons from SoQtFullViewer, and they are iconic:
- the arrow for switching to "scene graph interaction" mode
- the hand for setting back to "camera interaction" mode
- the house for "resetcamera to home position"
- the blueprint house for "set new camerahome position"
- the eye for "zoom camera out to view full scene"
- the flashlight for setting "click to seek" mode
โ ๏ธ Okay so there's a common faulty assumption about all the viewer-classes and I need you to hear me: people think user interaction (in the "examine"-mode, not the scene graph-interaction mode) influences the model or 3D-scene in the view. It does not. That is not correct. It is always the viewer's camera that is translated and rotated. Always. Periodt. ๐
The initial position of the camera is placed such that all of the scene graph's geometry fits within its view. โจ
See also: SoQtFlyViewer, SoQtPlaneViewer
๐ ๏ธ Constructor & Destructor Documentation ๐ ๏ธ
SoQtExaminerViewer::SoQtExaminerViewer(QWidget * parent = NULL, const char * name = NULL, SbBool embed = TRUE, SoQtFullViewer::BuildFlag flag = BUILD_ALL, SoQtViewer::Type type = BROWSER)
Constructor. See parent class for explanation of arguments. Calling this constructor will make sure the examiner viewer widget will be built immediately โ like, no waiting around, it's built on the spot. โก
SoQtExaminerViewer::SoQtExaminerViewer(QWidget * parent, const char * name, SbBool embed, SoQtFullViewer::BuildFlag flag, SoQtViewer::Type type, SbBool build) [protected]
Constructor. See parent class for explanation of arguments. (Protected one, so this is the family-recipe version ๐ซถ)
๐ Member Function Documentation ๐
void SoQtExaminerViewer::setAnimationEnabled(const SbBool enable)
Decide if it should be possible to start a spin animation of the model in the viewer by releasing the mouse button while dragging.
If the enable flag is FALSE and we're currently animating, the spin will be stopped. Full stop, no spin, we're done. โ
See also: isAnimationEnabled
SbBool SoQtExaminerViewer::isAnimationEnabled(void) const
Query whether or not it's possible to start a spinning animation by releasing the left mouse button while dragging the mouse. ๐
See also: setAnimationEnabled
void SoQtExaminerViewer::stopAnimating(void)
Stop the model from spinning. That's it. That's the function. โ
SbBool SoQtExaminerViewer::isAnimating(void) const
Query if the model in the viewer is currently in spinning mode after a user drag.
See also: setAnimationEnabled
void SoQtExaminerViewer::setFeedbackVisibility(const SbBool enable)
Set the flag deciding whether or not to show the axis cross. ๐งญ
See also: isFeedbackVisible, getFeedbackSize, setFeedbackSize
SbBool SoQtExaminerViewer::isFeedbackVisible(void) const
Check if the feedback axis cross is visible. ๐
See also: setFeedbackVisibility, getFeedbackSize, setFeedbackSize
void SoQtExaminerViewer::setFeedbackSize(const int size)
Set the size of the feedback axis cross. Heads up on how the value reads: it's interpreted as an approximate percentage chunk of the dimensions of the total canvas. So it's relative, not pixels โ k? ๐
See also: getFeedbackSize, isFeedbackVisible, setFeedbackVisibility
int SoQtExaminerViewer::getFeedbackSize(void) const
Return the size of the feedback axis cross. Default is 25. ๐
See also: setFeedbackSize, isFeedbackVisible, setFeedbackVisibility
See also:setFeedbackSize,isFeedbackVisible,setFeedbackVisibilityโ thatโs the tail end of the function above, bestie, carry on ๐
void SoQtExaminerViewer::setViewing (SbBool enable) [virtual] ๐
okay so this one flips the viewer into or out of view mode.
If view mode is on, user events get caught and used to influence the camera position / orientation. If view mode is off, all events in the viewer canvas โ like keypresses or mouse clicks and -movements โ get passed along to the scene graph.
Default is to have the view mode active.
See also: isViewing()
Reimplemented from SoQtFullViewer.
void SoQtExaminerViewer::setCamera (SoCamera * cam) [virtual] ๐ธ
Set the camera we want the viewer to manipulate when interacting with the viewer controls.
The camera passed in as an argument to this method must already be part of the viewerโs scene graph. You do not inject viewpoint cameras to the viewer with this method.
You should rather insert a camera into the scene graph first (if necessary, often one will be present already), then register it as the camera used by the viewer controls with this method.
If the application code doesnโt explicitly set up a camera through this method, the viewer will automatically scan through the scene graph to find a camera to use. If no camera is available in the scene graph at all, it will set up its own camera.
See also: getCamera()
Reimplemented from SoQtViewer.
void SoQtExaminerViewer::setCursorEnabled (SbBool enable) [virtual] ๐ฑ๏ธ
Decide whether or not the mouse pointer cursor should be visible in the rendering canvas.
Reimplemented from SoQtViewer.
void SoQtExaminerViewer::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 from SoQtFullViewer.
void SoQtExaminerViewer::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 from SoQtFullViewer.
void SoQtExaminerViewer::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 from SoQtFullViewer.
void SoQtExaminerViewer::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 its 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 its 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 from SoQtFullViewer.
const char * SoQtExaminerViewer::getDefaultWidgetName (void ) const [protected], [virtual] ๐ท๏ธ
This method returns the default name of a component widget class.
It should be overridden by derived non-abstract classes for the topmost widget in the component to have a proper name.
Reimplemented from SoQtRenderArea.
const char * SoQtExaminerViewer::getDefaultTitle (void ) const [protected], [virtual] ๐ช
This method returns the default window caption string of the component.
It should be overridden by derived non-abstract classes so the window and pop-up menu will get a proper title.
Reimplemented from SoQtRenderArea.
const char * SoQtExaminerViewer::getDefaultIconTitle (void ) const [protected], [virtual] ๐ผ๏ธ
This method returns the default icon title of the component.
It should be overridden by derived non-abstract classes so icons will get proper titles.
Reimplemented from SoQtRenderArea.
SbBool SoQtExaminerViewer::processSoEvent (const SoEvent *const event) [protected], [virtual] ๐ฎ
Toolkit-native events are tried to convert 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 its subclasses to catch events of particular interest to the viewer classes, for instance.
Return TRUE if 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 SoQtFullViewer.
void SoQtExaminerViewer::setSeekMode (SbBool enable) [protected], [virtual] ๐
Put the viewer in or out of โwaiting-to-seekโ mode.
If the user performs a mouse button click when the viewer is in โwaiting-to-seekโ mode, the camera will be repositioned so the camera focal point lies on the point of the geometry under the mouse cursor.
See also: isSeekMode(), setDetailSeek()
Reimplemented from SoQtViewer.
void SoQtExaminerViewer::actualRedraw (void ) [protected], [virtual] ๐จ
This method instantly redraws the normal (non-overlay) scene graph by calling SoSceneManager::render().
Subclasses may override this method to add their own rendering before or after Coin renders its scene graph.
The following is a complete example that demonstrates one way of adding both a background image and foreground (overlay) geometry to the โnormalโ rendering:
// This example shows how to put a permanent background image on
// your viewer canvas, below the 3D graphics, plus overlay
// foreground geometry. Written by mortene.
// Copyright Kongsberg Oil & Gas Technologies 2002.
// *************************************************************************
#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#include <Inventor/nodes/SoBaseColor.h>
#include <Inventor/nodes/SoCone.h>
#include <Inventor/nodes/SoCube.h>
#include <Inventor/nodes/SoImage.h>
#include <Inventor/nodes/SoLightModel.h>
#include <Inventor/nodes/SoOrthographicCamera.h>
#include <Inventor/nodes/SoRotationXYZ.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoTranslation.h>
#include <GL/gl.h>
// *************************************************************************
class MyExaminerViewer : public SoQtExaminerViewer {
public:
MyExaminerViewer(QWidget* parent, const char * filename);
~MyExaminerViewer();
protected:
virtual void actualRedraw(void);
private:
SoSeparator * bckgroundroot;
SoSeparator * foregroundroot;
SoRotationXYZ * arrowrotation;
};
MyExaminerViewer::MyExaminerViewer(QWidget* parent, const char * filename)
: SoQtExaminerViewer(parent)
{
// Coin should not clear the pixel-buffer, so the background image
// is not removed.
this->setClearBeforeRender(FALSE, TRUE);
// Set up background scene graph with image in it.
this->bckgroundroot = new SoSeparator;
this->bckgroundroot->ref();
SoOrthographicCamera * cam = new SoOrthographicCamera;
cam->position = SbVec3f(0, 0, 1);
cam->height = 1;
// SoImage will be at z==0.0.
cam->nearDistance = 0.5;
cam->farDistance = 1.5;
SoImage * img = new SoImage;
img->vertAlignment = SoImage::HALF;
img->horAlignment = SoImage::CENTER;
img->filename = filename;
this->bckgroundroot->addChild(cam);
this->bckgroundroot->addChild(img);
// Set up foreground, overlaid scene graph.
this->foregroundroot = new SoSeparator;
this->foregroundroot->ref();
SoLightModel * lm = new SoLightModel;
lm->model = SoLightModel::BASE_COLOR;
SoBaseColor * bc = new SoBaseColor;
bc->rgb = SbColor(1, 1, 0);
cam = new SoOrthographicCamera;
cam->position = SbVec3f(0, 0, 5);
cam->height = 10;
cam->nearDistance = 0;
cam->farDistance = 10;
const double ARROWSIZE = 2.0;
SoTranslation * posit = new SoTranslation;
posit->translation = SbVec3f(-2.5 * ARROWSIZE, 1.5 * ARROWSIZE, 0);
arrowrotation = new SoRotationXYZ;
arrowrotation->axis = SoRotationXYZ::Z;
SoTranslation * offset = new SoTranslation;
offset->translation = SbVec3f(ARROWSIZE/2.0, 0, 0);
SoCube * cube = new SoCube;
cube->width = ARROWSIZE;
cube->height = ARROWSIZE/15.0;
this->foregroundroot->addChild(cam);
this->foregroundroot->addChild(lm);
this->foregroundroot->addChild(bc);
this->foregroundroot->addChild(posit);
this->foregroundroot->addChild(arrowrotation);
this->foregroundroot->addChild(offset);
this->foregroundroot->addChild(cube);
}
MyExaminerViewer::~MyExaminerViewer()
{
this->bckgroundroot->unref();
this->foregroundroot->unref();
}
// Must set up the OpenGL viewport manually, as upon resize
// operations, Coin won't set it up until the SoGLRenderAction is
// applied again. And since we need to do glClear() before applying
// the action..
const SbViewportRegion vp = this->getViewportRegion();
SbVec2s origin = vp.getViewportOriginPixels();
SbVec2s size = vp.getViewportSizePixels();
glViewport(origin[0], origin[1], size[0], size[1]);
const SbColor col = this->getBackgroundColor();
glClearColor(col[0], col[1], col[2], 0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Render our scene graph with the image.
SoGLRenderAction * glra = this->getGLRenderAction();
glra->apply(this->bckgroundroot);
// Render normal scene graph.
SoQtExaminerViewer::actualRedraw();
// Increase arrow angle with 1/1000 degrees every frame.
arrowrotation->angle = arrowrotation->angle.getValue() + (0.001 / M_PI * 180);
// Render overlay front scene graph.
glClear(GL_DEPTH_BUFFER_BIT);
glra->apply(this->foregroundroot);
}
// *************************************************************************
int
main(int argc, char ** argv)
{
if (argc != 2) {
(void)fprintf(stderr, "\n\n\tUsage: %s <image-filename>\n\n", argv[0]);
exit(1);
}
QWidget* window = SoQt::init(argv[0]);
MyExaminerViewer * viewer = new MyExaminerViewer(window, argv[1]);
viewer->setSceneGraph(new SoCone);
viewer->show();
SoQt::show(window);
SoQt::mainLoop();
delete viewer;
return 0;
}
// *************************************************************************
okay so this whole thing is giving custom viewer main character energy ๐
โ you grab the viewport region, you set the GL viewport by hand because Coin won't do it for you until the SoGLRenderAction gets applied again, you clear, you render the background root, you let the parent class do its thing, then you spin that arrow by 0.001 / M_PI * 180 degrees every frame and draw the foreground overlay. Inheritance, but make it fashion. โจ
And main()? Iconic. It's <italic>very</italic> strict about arguments โ anything that isn't exactly one <image-filename> gets the usage message and exit(1), no cap ๐ญ. Then SoQt::init, build the viewer, setSceneGraph(new SoCone) (a cone!! our little star ๐ธ), show(), SoQt::show(window), SoQt::mainLoop(), delete viewer, return 0. Wrapped. Periodt. ๐
Reimplemented from SoQtViewer.
๐ฆ void SoQtExaminerViewer::afterRealizeHook(void) [protected], [virtual]
This one's a function "hook" / callback that gets invoked just after the window for the component has been realized. Basically the moment right after your widget becomes a real, visible, on-screen thing ๐
Override it if you need specific initialization for your own component or viewer class to happen right after it's been made visible โ but bestie, remember to call upwards in the inheritance hierarchy, fr fr, or you're gonna have a bad time ๐:
void
MyLittleViewer::afterRealizeHook(void)
{
<superclass>::afterRealizeHook();
// [own initialization here]
}
Reimplemented from SoQtRenderArea.
๐ Author
Generated automatically by Doxygen for SoQt from the source code. (the robots wrote this one, we just gave it a glow-up โจ)
and that's a wrap on the whole page, bestie!! ๐ซถ This lil' beauty is Version 1.6.2, dated Sat Jan 6 2024 12:20:55, and it's your SoQtExaminerViewer(3) page in full โ go forth and examine some views, you gorgeous Unix gremlin ๐๐๐ฆ
๐ฆ where this page comes from
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 ยท BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 ยท BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 ยท BSD-3-Clause
- opensuse-leap 16.0: SoQt-devel 1.6.2-bp160.1.13 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms