SOXTCONSTRAINEDVIEWER(3iv)

πŸ’– SoXtConstrainedViewer πŸ’–

okay bestie, welcome to SoXtConstrainedViewer(3IV) β€” the base viewer class that adds camera constraints given a world up direction. she's the blueprint, the moment, the blueprint-moment ✨


πŸŽ€ INHERITS FROM πŸŽ€

the family tree is giving legacy royalty, no cap:

SoXtComponent > SoXtGLWidget > SoXtRenderArea > SoXtViewer >
SoXtFullViewer > SoXtConstrainedViewer

she is deeply descended, iykyk πŸ’…


✨ SYNOPSIS ✨

first things first, you gotta let her in:

#include <Inventor/Xt/viewers/SoXtConstrainedViewer.h>

🌸 Methods from class SoXtConstrainedViewer 🌸

these are hers, the ones she actually brings to the group chat:

void                setUpDirection(const SbVec3f &newUpDirection)
SbVec3f             getUpDirection()

πŸ¦‹ Methods from class SoXtFullViewer πŸ¦‹

inherited, still iconic:

void                setDecoration(SbBool onOrOff)
SbBool              isDecoration()
void                setPopupMenuEnabled(SbBool trueOrFalse)
SbBool              isPopupMenuEnabled()
Widget              getAppPushButtonParent() const
void                addAppPushButton(Widget newButton)
void                insertAppPushButton(Widget newButton, int index)
void                removeAppPushButton(Widget oldButton)
int                 findAppPushButton(Widget oldButton)
int                 lengthAppPushButton()
Widget              getRenderAreaWidget()

πŸ’œ Methods from class SoXtViewer πŸ’œ

the whole camera-ops department, fr fr:

virtual void            setCamera(SoCamera *cam)
SoCamera *              getCamera()
virtual void            setCameraType(SoType type)
SoType                  getCameraType()
virtual void            viewAll()
virtual void            saveHomePosition()
virtual void            resetToHomePosition()
virtual void            setHeadlight(SbBool onOrOff)
SbBool                  isHeadlight()
SoDirectionalLight *    getHeadlight()
virtual void            setDrawStyle(SoXtViewer::DrawType type,
                             SoXtViewer::DrawStyle style)
SoXtViewer::DrawStyle   getDrawStyle(SoXtViewer::DrawType type)
virtual void            setBufferingType(SoXtViewer::BufferType type)
SoXtViewer::BufferType  getBufferingType()
virtual void            setViewing(SbBool onOrOff)
SbBool                  isViewing() const
virtual void            setCursorEnabled(SbBool onOrOff)
SbBool                  isCursorEnabled() const
void                    setAutoClipping(SbBool onOrOff)
SbBool                  isAutoClipping() const
virtual void            setStereoViewing(SbBool onOrOff)
virtual SbBool          isStereoViewing()
void                    setStereoOffset(float dist)
float                   getStereoOffset()
void                    setDetailSeek(SbBool onOrOff)
SbBool                  isDetailSeek()
void                    setSeekTime(float seconds)
float                   getSeekTime()
void                    addStartCallback(SoXtViewerCB *f, void *userData =
                             NULL)
void                    addFinishCallback(SoXtViewerCB *f, void *userData
                             = NULL)
void                    removeStartCallback(SoXtViewerCB *f, void
                             *userData = NULL)
void                    removeFinishCallback(SoXtViewerCB *f, void
                             *userData = NULL)
void                    copyView(Time eventTime)
void                    pasteView(Time eventTime)
virtual void            recomputeSceneSize()

πŸ’… Methods from class SoXtRenderArea πŸ’…

she said render, and she meant it:

virtual void              setSceneGraph(SoNode *newScene)
virtual SoNode *          getSceneGraph()
void                      setOverlaySceneGraph(SoNode *newScene)
SoNode *                  getOverlaySceneGraph()
void                      registerDevice(SoXtDevice *)
void                      unregisterDevice(SoXtDevice *)
void                      setBackgroundColor(const SbColor &c)
const SbColor &           getBackgroundColor() const
void                      setBackgroundIndex(int index)
int                       getBackgroundIndex() const
void                      setOverlayBackgroundIndex(int index)
int                       getOverlayBackgroundIndex() const
void                      setColorMap(int startIndex, int num, const
                                SbColor *colors)
void                      setOverlayColorMap(int startIndex, int num,
                                const SbColor *colors)
void                      setViewportRegion(const SbViewportRegion
                                &newRegion)
const SbViewportRegion &  getViewportRegion() const
void                      setTransparencyType(SoGLRenderAction::TransparencyType
                                type)
SoGLRenderAction::TransparencyType
                          getTransparencyType() const
void                      setAntialiasing(SbBool smoothing, int numPasses)
void                      getAntialiasing(SbBool &smoothing, int
                                &numPasses) const
void                      setClearBeforeRender(SbBool trueOrFalse)
SbBool                    isClearBeforeRender() const
void                      setClearBeforeOverlayRender(SbBool trueOrFalse)
SbBool                    isClearBeforeOverlayRender() const
void                      setAutoRedraw(SbBool trueOrFalse)
SbBool                    isAutoRedraw() const
void                      setRedrawPriority(uint32_t priority)
uint32_t                  getRedrawPriority() const
static uint32_t           getDefaultRedrawPriority()
void                      render()
void                      renderOverlay()
void                      scheduleRedraw()
void                      scheduleOverlayRedraw()
void                      redrawOnSelectionChange(SoSelection *s)
void                      redrawOverlayOnSelectionChange(SoSelection *s)
void                      setEventCallback(SoXtRenderAreaEventCB *fcn,
                                void *userData = NULL)
void                      setGLRenderAction(SoGLRenderAction *ra)
SoGLRenderAction *        getGLRenderAction() const
void                      setOverlayGLRenderAction(SoGLRenderAction *ra)
SoGLRenderAction *        getOverlayGLRenderAction() const
void                      setSceneManager(SoSceneManager *sm)
SoSceneManager *          getSceneManager() const
void                      setOverlaySceneManager(SoSceneManager *sm)
SoSceneManager *          getOverlaySceneManager() const

πŸŽ€ Methods from class SoXtGLWidget πŸŽ€

GL widgets, window stuff, visual vibes:

void                setBorder(SbBool onOrOff)
SbBool              isBorder() const
virtual void        setDoubleBuffer(SbBool onOrOff)
SbBool              isDoubleBuffer()
Window              getNormalWindow()
Window              getOverlayWindow()
GLXContext          getNormalContext()
GLXContext          getOverlayContext()
Widget              getNormalWidget()
Widget              getOverlayWidget()
virtual void        setNormalVisual(XVisualInfo *vis)
XVisualInfo *       getNormalVisual()
virtual void        setOverlayVisual(XVisualInfo *vis)
XVisualInfo *       getOverlayVisual()
void                setDrawToFrontBufferEnable(SbBool enableFlag)
SbBool              isDrawToFrontBufferEnable() const

⭐ Methods from class SoXtComponent ⭐

the great-grandmother of them all, still serving:

virtual void            show()
virtual void            hide()
SbBool                  isVisible()
Widget                  getWidget() const
SbBool                  isTopLevelShell() const
Widget                  getShellWidget() const
Widget                  getParentWidget() const
void                    setSize(const SbVec2s &size)
SbVec2s                 getSize()
Display *               getDisplay()
void                    setTitle(const char *newTitle)
const char *            getTitle() const
void                    setIconTitle(const char *newIconTitle)
const char *            getIconTitle() const
void                    setWindowCloseCallback(SoXtComponentCB *func, void
                             *data = NULL)
static SoXtComponent *  getComponent(Widget w)
const char *            getWidgetName() const
const char *            getClassName() const

🌈 DESCRIPTION 🌈

so. SoXtConstrainedViewer is a base class for the SoXtWalkViewer and SoXtFlyViewer component viewers πŸšΆβ™€οΈπŸ›Έ

what she does is add methods and convenience routines that are available to her subclasses, so they can constrain the camera given a world up direction. translation for the besties: it stops the camera from looking upside down 😭 like, imagine tilting so far you're basically viewing the world from inside-out. not the vibe. we don't do that here πŸ’€

and by default? the +Y direction is used. periodt ✨


🧚 METHODS 🧚

void                setUpDirection(const SbVec3f &newUpDirection)
SbVec3f             getUpDirection()

these two set the upward direction of the viewer πŸ‘‘

that up direction is the whole point of her existence, honestly β€” the viewers use it to constrain the camera when tilting up/down, and it's also used when rotating the camera right/left. so she's holding the whole orientation situation together, lowkey the backbone of the operation 🫢

the default is the +Y (0,1,0) direction. if you don't say anything, that's what you get πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

go give these queens a read too, they're all connected:

  • SoXtFullViewer
  • SoXtViewer
  • SoXtComponent
  • SoXtRenderArea
  • SoXtWalkViewer
  • SoXtFlyViewer

that's the whole page bestie, and shoutout to the fine print at the bottom: this one's filed under the SoXtConstrainedViewer(3IV) manual, no version or date stamp riding along with it, just pure unfiltered viewer-constraint energy 🌸✨ go constrain a camera, you've got this πŸ’…πŸ¦‹