SOSFBITMASK(3iv)
π SoSFBitMask π
okay bestie, so SoSFBitMask is from the 3IV manual, and it's literally a single-value field that holds a whole set of bit flags. like, one field, many flags, one iconic little integer. π
β¨ INHERITS FROM β¨
the family tree is giving legacy royalty:
SoField > SoSField > SoSFEnum > SoSFBitMask
πΈ SYNOPSIS πΈ
first things first, you gotta pull it in:
#include <Inventor/fields/SoSFBitMask.h>
π¦ Methods from class SoSFBitMask
these are the ones SoSFBitMask brings to the group chat:
static SoType getClassTypeId()
virtual void getTypeId() const
int getValue() const
void setValue(int newValue)
int operator =(int newValue)
int operator ==(const SoSFBitMask &f) const
int operator !=(const SoSFBitMask &f) const
π§ Methods from class SoField
and these are inherited from the mothership, SoField:
void setIgnored(SbBool ignore)
SbBool isIgnored() const
SbBool isDefault() const
virtual SbBool isOfType(SoType type) const
SbBool set(const char *valueString)
void get(SbString &valueString)
void touch()
SbBool connectFrom(SoField *fromField)
SbBool connectFrom(SoEngineOutput *fromEngine)
void disconnect()
SbBool isConnected() const
SbBool isConnectedFromField() const
SbBool getConnectedField(SoField *&writingField) const
SbBool isConnectedFromEngine() const
SbBool getConnectedEngine(SoEngineOutput *&engineOutput)
const
void enableConnection(SbBool flag)
SbBool isConnectionEnabled() const
int getForwardConnections(SoFieldList &list) const
SoFieldContainer * getContainer() const
π DESCRIPTION π
so basically: it's a single-value field holding a mask of bit flags, and it's stored as an integer. simple. elegant. lowkey genius.
the nodes that use this field class define mnemonic names for the bit flags. bestie, use those names when you're setting or testing the values of the field β even though the methods themselves treat everything as integers. iykyk.
when you're testing and setting flags in a mask, you want the bit-wise & and | operators. periodt. for example, say you wanna turn on the sides of a 3D text node and turn off the back β you'd write:
text3->parts = text3->parts.getValue() | SoText3::SIDES;
text3->parts = text3->parts.getValue() & ~SoText3::BACK;
and when they get written to file, SoSFBitMasks show up as one or more mnemonic enumerated type names, in this format:
( flag1 | flag2 | ... )
if there's only one flag in the mask, the parentheses are optional. no cap. but heads up β these names differ depending on where this field gets used across the various node or engine classes, so go check their man pages for the actual names. π
also, the field values can be represented as integers too, but that is not guaranteed to be portable. so like, do it if you want, but don't come crying to me when it breaks on another machine. π
π METHODS π
static SoType getClassTypeId()virtual void getTypeId() constβ returns the type for this class, or for a particular object of this class. the vibe check of types, basically.int getValue() constβ returns this field's value. that's it, that's the whole thing. π«Άvoid setValue(int newValue)int operator =(int newValue)β sets this field tonewValue. slay.int operator ==(const SoSFBitMask &f) constint operator !=(const SoSFBitMask &f) constβ returnsTRUEiffis of the same type and has the same value as this field. two conditions, both required, no exceptions bestie.
π SEE ALSO π
go read these next, they're all part of the same friend group:
SoFieldSoSFieldSoMFBitMask
and that's the whole page, bestie!! this was SoSFBitMask(3IV) from the 3IV manual, and the source/version + date info was sitting right there in the footer β so consider this my little sign-off: mwah, go forth and mask those bits responsibly. πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms