SODRAWSTYLE(3iv)

✨ SoDrawStyle ✨

okay bestie, listen UP πŸ’… this is the tea on SoDrawStyle, a page from the <hotpink>3IV</hotpink> manual β€” it's the node that decides how stuff gets drawn in your scene graph, and honestly? it's giving main character energy for something so small πŸŽ€


🌸 NAME 🌸

SoDrawStyle β€” the node that defines the style to use when rendering. literally it's the glow-up node for your shapes ✨


🧬 INHERITS FROM 🧬

SoBase > SoFieldContainer > SoNode > SoDrawStyle

so yeah, it's deep in the family tree, iykyk 🌳


πŸ“œ SYNOPSIS πŸ“œ

#include <Inventor/nodes/SoDrawStyle.h>

okay so first up, the enum that runs the whole vibe:

enum Style {
     SoDrawStyle::FILLED     Draw filled regions
     SoDrawStyle::LINES      Draw only outlines (wire frame)
     SoDrawStyle::POINTS     Draw points at vertices
     SoDrawStyle::INVISIBLE  Do not draw anything at all
}
INVISIBLE really said "not me existing today" 😭 iconic honestly.

Fields from class SoDrawStyle:

SoSFEnum            style
SoSFFloat           pointSize
SoSFFloat           lineWidth
SoSFUShort          linePattern

Methods from class SoDrawStyle:

                    SoDrawStyle()
static SoType       getClassTypeId()

Methods from class SoNode:

void                setOverride(SbBool state)
SbBool              isOverride() const
SoNode *            copy(SbBool copyConnections = FALSE) const
virtual SbBool      affectsState() const
static SoNode *     getByName(const SbName &name)
static int          getByName(const SbName &name, SoNodeList &list)

Methods from class SoFieldContainer:

void                setToDefaults()
SbBool              hasDefaultValues() const
SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
void                copyFieldValues(const SoFieldContainer *fc, SbBool
                         copyConnections = FALSE)
SbBool              set(const char *fieldDataString)
void                get(SbString &fieldDataString)
virtual int         getFields(SoFieldList &resultList) const
virtual SoField *   getField(const SbName &fieldName) const
SbBool              getFieldName(const SoField *field, SbName &fieldName)
                         const
SbBool              isNotifyEnabled() const
SbBool              enableNotify(SbBool flag)

Methods from class SoBase:

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
virtual SoType      getTypeId() const
SbBool              isOfType(SbType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

πŸ’– DESCRIPTION πŸ’–

okay so here's the whole point of this node, bestie: SoDrawStyle sets the current drawing style for every single shape node that comes after it in the scene graph. it's a state node, so it just kinda walks through and sets the vibe for everyone downstream 🌈

it specifies how primitives should be rendered. periodt.

⚠️ important, no cap: the drawing style has no effect on picking or callback primitive generation. so don't come for it about that, it literally doesn't do that πŸ’€

πŸŽ€ FIELDS πŸŽ€

  • SoSFEnum style β€” the drawing style itself. this is the moment, the whole lewk.
  • SoSFFloat pointSize β€” radius of points (this one's for POINTS style πŸ“).
  • SoSFFloat lineWidth β€” width of lines (for LINES style ✏️).
  • SoSFUShort linePattern β€” the stipple pattern for lines (again, LINES style). values can range from 0 (invisible πŸ‘») all the way up to 0xffff (solid πŸ’―). this is the field that decides how dashed or dotted your lines are gonna be. slay.

🧚 METHODS 🧚

  • SoDrawStyle() β€” creates a drawing style node with default settings. fresh out the box, defaults and all ✨
  • static SoType getClassTypeId() β€” returns the type identifier for this class. it's basically the node's legal name πŸͺͺ

πŸ”₯ ACTION BEHAVIOR πŸ”₯

  • SoGLRenderAction, SoCallbackAction β€” sets the current drawing style. that's it, that's the whole job, and it does it well πŸ‘‘

πŸ“ FILE FORMAT/DEFAULTS πŸ“

DrawStyle {
     style        FILLED
     pointSize    0
     lineWidth    0
     linePattern  0xffff
}

so by default it's FILLED, points are 0, lines are 0 wide, and the line pattern is fully solid at 0xffff. a perfectly respectable starting point, ngl 🫢


πŸ‘€ SEE ALSO πŸ‘€

SoLightModel, SoPickStyle, SoShapeHints

go read those too, bestie, they're all part of the same friend group 🌸


and that's the whole page, mwah πŸ’‹ this was SoDrawStyle(3IV)() β€” the <hotpink>3IV</hotpink> manual, version/date and all β€” so go forth and draw stylishly, you absolute icon πŸ‘‘πŸ’œ