SOXTDEVICE(3iv)

πŸ’– SoXtDevice(3IV) πŸ’–

okay bestie, welcome to the manual page for SoXtDevice, section 3IV. she's abstract, she's a base class, and she's literally the blueprint every device in the Inventor Xt component and utility library is built on. no cap.


✨ NAME ✨

SoXtDevice β€” abstract base class device for use with the SoXtRenderArea πŸ’…


πŸ¦‹ INHERITS FROM πŸ¦‹

SoXtDevice

(yes girl, she inherits from herself. it's giving abstract base class energy. don't question it, just accept it 🌸)


🌈 SYNOPSIS 🌈

#include <Inventor/Xt/devices/SoXtDevice.h>

Methods from class SoXtDevice:

virtual void             enable(Widget w, XtEventHandler f, XtPointer
                              data, Window win = NULL)
virtual void             disable(Widget w, XtEventHandler f, XtPointer
                              data)
virtual const SoEvent *  translateEvent(XAnyEvent *xevent)
void                     setWindowSize(const SbVec2s &size)
const SbVec2s &          getWindowSize() const

πŸ‘‘ DESCRIPTION πŸ‘‘

so. this is the abstract base class for devices in the Inventor Xt component and utility library. that's the whole vibe. she doesn't do much on her own β€” she's the blueprint, the template, the main character archetype that other device classes are born from. 🧚

the way that it works is: when a device gets registered with an SoXtRenderArea, that device becomes able to generate events in the render area window. that's the whole point of her existence, and honestly? iconic. ✨


πŸ’… METHODS πŸ’…

  • virtual void enable(Widget w, XtEventHandler f, XtPointer data, Window win = NULL)
  • virtual void disable(Widget w, XtEventHandler f, XtPointer data)

these two are the on/off switch, bestie. enable and disable turn the device on and off for the widget you pass in. once she's enabled, that callback function f gets invoked whenever events happen in the widget β€” and data is the clientData that gets passed along with it. simple as that. πŸ’–

  • virtual const SoEvent * translateEvent(XAnyEvent *xevent)

she's trying to convert the X event you hand her into an SoEvent. that's the mission. but listen β€” if that event was not generated by this device, then NULL comes back at you. so if you get NULL, it's not her event, periodt. πŸ™ˆ

  • void setWindowSize(const SbVec2s &size)
  • const SbVec2s & getWindowSize() const

set it and get it, the classic duo. these handle the window size of the widget this device is registered for. why do we care? because it lets the device correctly convert position info from X window coordinates (origin at top left) to Inventor window coordinates (origin at bottom left). two different corners, two different coordinate systems, one very important conversion. 🫢

and good news β€” you don't even have to remember to call setWindowSize yourself, because SoXtRenderArea will automatically call this method for every device registered on it whenever the window size changes. she's got you. no thoughts, head empty, window size handled. ⭐


πŸ”₯ SEE ALSO πŸ”₯

  • SoXtMouse
  • SoXtKeyboard
  • SoXtSpaceball
  • SoXtInputFocus
  • SoXtRenderArea

the whole friend group fr fr πŸ’œ go say hi.


heads up bestie: this class is abstract. she's a base class, so you don't instantiate her directly β€” you build your own device on top of her and let her do the heavy lifting. that's her whole thing. 🌸

and that's the page!! mwah πŸ’‹ this was SoXtDevice(3IV) from the Inventor Xt library, and the footer just says SoXtDevice(3IV)() with no version or date info attached β€” so like, mystery era, we don't know when she was born, we just know she slays. πŸŽ€πŸ’–βœ¨