SoCylinder(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸŽ€ NAME πŸŽ€

SoCylinder β€” bestie, this is the Coin manual page for it, section 3, and it's the class that renders cylinder shapes. That's the whole vibe. πŸ’–


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoCylinder.h>

Inherits SoShape. So it's a shape node, it knows the shape node lore, and it's about to make your cylinders look gorgeous. 🫢

πŸ’– Public Types πŸ’–

Here's the enum that decides which bits of the cylinder even show up:

enum Part { SIDES = 0x1, TOP = 0x2, BOTTOM = 0x4, ALL = SIDES|TOP|BOTTOM }

So like, SIDES is 0x1, TOP is 0x2, BOTTOM is 0x4, and ALL is SIDES|TOP|BOTTOM β€” the whole package, the full fit, head to toe. πŸ‘‘

πŸ¦‹ Public Types inherited from SoShape πŸ¦‹

enum TriangleShape { TRIANGLE_STRIP, TRIANGLE_FAN, TRIANGLES, POLYGON,
    QUADS, QUAD_STRIP, POINTS, LINES, LINE_STRIP }

πŸ¦‹ Public Types inherited from SoNode πŸ¦‹

enum NodeType { INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
    INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
    INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
    COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400, COIN_2_3 =
    0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000, COIN_2_5 = 0x4000,
    COIN_3_0 = 0x8000, INVENTOR_6_0 = 0x10000, COIN_4_0 = 0x20000 }

Look at all those little hex numbers. Ancestry check passed, no notes. πŸ’…

πŸ’… Public Member Functions πŸ’…

  • virtual SoType getTypeId (void) const β€” the type-id getter, she knows who she is.
  • SoCylinder (void) β€” the constructor. Birth of a cylinder, iconic. 🌈
  • void addPart (SoCylinder::Part part) β€” adds a part.
  • void removePart (SoCylinder::Part part) β€” removes a part.
  • SbBool hasPart (SoCylinder::Part part) const β€” asks whether she's got that part. Yes or no, no games.
  • virtual void rayPick (SoRayPickAction *action) β€” the ray-pick handler.
  • virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action) β€” the primitive-count handler.
  • virtual void GLRender (SoGLRenderAction *action) β€” the GL render handler. Main character energy, literally rendering. ✨

🌸 Public Member Functions inherited from SoShape 🌸

  • virtual SbBool affectsState (void) const β€” the affects-state query.
  • virtual void notify (SoNotList *nl) β€” the notify.
  • virtual void getBoundingBox (SoGetBoundingBoxAction *action) β€” the bounding-box action handler.
  • virtual void callback (SoCallbackAction *action) β€” the callback action handler.
  • const SoBoundingBoxCache * getBoundingBoxCache (void) const β€” grabs the bounding box cache.

🌸 Public Member Functions inherited from SoNode 🌸

  • void setOverride (const SbBool state) β€” sets the override state.
  • SbBool isOverride (void) const β€” is it override? enquiring minds.
  • void setNodeType (const NodeType type) β€” sets the node type.
  • NodeType getNodeType (void) const β€” gets the node type.
  • virtual SoNode * copy (SbBool copyconnections=FALSE) const β€” the copy.
  • virtual void doAction (SoAction *action) β€” does the action.
  • virtual void GLRenderBelowPath (SoGLRenderAction *action) β€” GL render, below path.
  • virtual void GLRenderInPath (SoGLRenderAction *action) β€” GL render, in path.
  • virtual void GLRenderOffPath (SoGLRenderAction *action) β€” GL render, off path.
  • virtual void getMatrix (SoGetMatrixAction *action) β€” the get-matrix action.
  • virtual void handleEvent (SoHandleEventAction *action) β€” handles the event.
  • virtual void pick (SoPickAction *action) β€” picks.
  • virtual void search (SoSearchAction *action) β€” searches.
  • virtual void write (SoWriteAction *action) β€” writes.
  • virtual void audioRender (SoAudioRenderAction *action) β€” the audio render action.
  • virtual void grabEventsSetup (void) β€” grab-events setup.
  • virtual void grabEventsCleanup (void) β€” grab-events cleanup.
  • virtual void startNotify (void) β€” starts the notify.
  • SbUniqueId getNodeId (void) const β€” gets the node id.
  • virtual SoChildList * getChildren (void) const β€” gets the children.
  • virtual void writeInstance (SoOutput *out) β€” writes the instance.
  • virtual SoNode * addToCopyDict (void) const β€” adds to the copy dict.
  • virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections) β€” copies contents.
  • virtual SoFieldContainer * copyThroughConnection (void) const β€” copies through the connection.

🌸 Public Member Functions inherited from SoFieldContainer 🌸

  • void setToDefaults (void) β€” sets everything back to defaults.
  • SbBool hasDefaultValues (void) const β€” does it have default values?
  • SbBool fieldsAreEqual (const SoFieldContainer *container) const β€” are the fields equal?
  • void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE) β€” copies field values.
  • SbBool set (const char *const fielddata) β€” the set.
  • void get (SbString &fielddata) β€” the get.
  • virtual int getFields (SoFieldList &l) const β€” gets the fields.
  • virtual int getAllFields (SoFieldList &l) const β€” gets all the fields, she's thorough.
  • virtual SoField * getField (const SbName &name) const β€” gets a field by name.
  • virtual SoField * getEventIn (const SbName &name) const β€” gets an event in.
  • virtual SoField * getEventOut (const SbName &name) const β€” gets an event out.
  • SbBool getFieldName (const SoField *const field, SbName &name) const β€” gets the field name.
  • SbBool enableNotify (const SbBool flag) β€” enables notify.
  • SbBool isNotifyEnabled (void) const β€” is notify enabled?
  • SbBool set (const char *fielddata, SoInput *input) β€” the set, but with an SoInput.
  • void get (SbString &fielddata, SoOutput *out) β€” the get, but with an SoOutput.
  • virtual SbBool validateNewFieldValue (SoField *field, void *newval) β€” validates a new field value.
  • virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE) β€” adds a write reference.
  • SbBool getIsBuiltIn (void) const β€” is it built in?
  • virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) const β€” gets the fields' memory size.
  • void setUserData (void *userdata) const β€” sets the user data.
  • void * getUserData (void) const β€” gets the user data.

🌸 Public Member Functions inherited from SoBase 🌸

  • void ref (void) const β€” refs it.
  • void unref (void) const β€” unrefs it.
  • void unrefNoDelete (void) const β€” unrefs without deleting.
  • int32_t getRefCount (void) const β€” gets the ref count.
  • void touch (void) β€” touches it.
  • SbBool isOfType (SoType type) const β€” Returns TRUE if the type of this object is either of the same type or inherited from type.
  • virtual SbName getName (void) const β€” gets the name.
  • virtual void setName (const SbName &newname) β€” sets the name.
  • void addAuditor (void *const auditor, const SoNotRec::Type type) β€” adds an auditor.
  • void removeAuditor (void *const auditor, const SoNotRec::Type type) β€” removes an auditor.
  • const SoAuditorList & getAuditors (void) const β€” gets the auditors.
  • SbBool shouldWrite (void) β€” should it write?
  • void assertAlive (void) const β€” asserts it's alive. πŸ’€

πŸ‘‘ Static Public Member Functions πŸ‘‘

  • static SoType getClassTypeId (void) β€” gets the class type id.
  • static void initClass (void) β€” initializes the class.

🧚 Static Public Member Functions inherited from SoShape 🧚

  • static SoType getClassTypeId (void) β€” gets the class type id.
  • static void initClass (void) β€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.
  • static void getScreenSize (SoState *const state, const SbBox3f &boundingbox, SbVec2s &rectsize) β€” gets the screen size.
  • static float getDecimatedComplexity (SoState *state, float complexity) β€” gets the decimated complexity.

🧚 Static Public Member Functions inherited from SoNode 🧚

  • static uint32_t getCompatibilityTypes (const SoType &nodetype) β€” gets the compatibility types.
  • static SoType getClassTypeId (void) β€” gets the class type id.
  • static SoNode * getByName (const SbName &name) β€” gets a node by name.
  • static int getByName (const SbName &name, SoNodeList &l) β€” gets by name, into a list.
  • static void initClass (void) β€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.
  • static void initClasses (void) β€” initializes the classes (plural, she's ambitious).
  • static SbUniqueId getNextNodeId (void) β€” gets the next node id.
  • static int getActionMethodIndex (const SoType type) β€” gets the action method index.
  • static void getBoundingBoxS (SoAction *action, SoNode *node) β€” the static bounding-box getter.
  • static void GLRenderS (SoAction *action, SoNode *node) β€” the static GL render.
  • static void callbackS (SoAction *action, SoNode *node) β€” the static callback.
  • static void getMatrixS (SoAction *action, SoNode *node) β€” the static get-matrix.
  • static void handleEventS (SoAction *action, SoNode *node) β€” the static event handler.
  • static void pickS (SoAction *action, SoNode *node) β€” the static pick.
  • static void rayPickS (SoAction *action, SoNode *node) β€” the static ray pick.
  • static void searchS (SoAction *action, SoNode *node) β€” the static search.
  • static void writeS (SoAction *action, SoNode *node) β€” the static write.
  • static void audioRenderS (SoAction *action, SoNode *node) β€” the static audio render.
  • static void getPrimitiveCountS (SoAction *action, SoNode *node) β€” the static primitive count.

🧚 Static Public Member Functions inherited from SoFieldContainer 🧚

  • static void initClass (void) β€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.
  • static SoType getClassTypeId (void) β€” This static method returns the SoType object associated with objects of this class.
  • static void cleanupClass (void) β€” cleans up the class.
  • static void initCopyDict (void) β€” initializes the copy dict.
  • static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy) β€” adds a copy.
  • static SoFieldContainer * checkCopy (const SoFieldContainer *orig) β€” checks a copy.
  • static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections) β€” finds a copy.
  • static void copyDone (void) β€” copy done, we're finished, bye. 🫑

🧚 Static Public Member Functions inherited from SoBase 🧚

  • static void initClass (void) β€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.
  • static SoType getClassTypeId (void) β€” This static method returns the SoType object associated with objects of this class.
  • static void addName (SoBase *const base, const char *const name) β€” adds a name.
  • static void removeName (SoBase *const base, const char *const name) β€” removes a name.
  • static void incrementCurrentWriteCounter (void) β€” increments the current write counter.
  • static void decrementCurrentWriteCounter (void) β€” decrements the current write counter.
  • static SoBase * getNamedBase (const SbName &name, SoType type) β€” gets a named base.
  • static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type) β€” gets the named bases.
  • static SbBool read (SoInput *input, SoBase *&base, SoType expectedtype) β€” reads.
  • static void setInstancePrefix (const SbString &c) β€” sets the instance prefix.
  • static void setTraceRefs (SbBool trace) β€” sets trace refs.
  • static SbBool getTraceRefs (void) β€” gets trace refs.
  • static SbBool connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname) β€” connects a route.
  • static SbBool readRoute (SoInput *input) β€” reads a route.

πŸ“ Public Attributes πŸ“

  • SoSFFloat radius β€” the radius. How round she is.
  • SoSFFloat height β€” the height. How tall she is.
  • SoSFBitMask parts β€” the parts bitmask. Which bits of her you're getting.

πŸŽ€ Protected Member Functions πŸŽ€

  • virtual const SoFieldData * getFieldData (void) const β€” gets the field data.
  • virtual ~SoCylinder () β€” the destructor. Rest easy, queen. 😭
  • virtual void generatePrimitives (SoAction *action) β€” generates the primitives.
  • virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center) β€” computes the bounding box.

✨ Protected Member Functions inherited from SoShape ✨

bestie these are the hand-me-downs from SoShape β€” protected, so they're for the family (subclasses) only, not for random strangers poking at your node. here's the whole squad, no cuts:

SoShape (void)
virtual ~SoShape ()
float getComplexityValue (SoAction *action)
virtual SbBool shouldGLRender (SoGLRenderAction *action)
void beginSolidShape (SoGLRenderAction *action)
void endSolidShape (SoGLRenderAction *action)
void GLRenderBoundingBox (SoGLRenderAction *action)
SbBool shouldPrimitiveCount (SoGetPrimitiveCountAction *action)
SbBool shouldRayPick (SoRayPickAction *const action)
void computeObjectSpaceRay (SoRayPickAction *const action)
void computeObjectSpaceRay (SoRayPickAction *const action, const SbMatrix &matrix)
virtual SoDetail * createTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp)
virtual SoDetail * createLineSegmentDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, SoPickedPoint *pp)
virtual SoDetail * createPointDetail (SoRayPickAction *action, const SoPrimitiveVertex *v, SoPickedPoint *pp)
void invokeTriangleCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2, const SoPrimitiveVertex *const v3)
void invokeLineSegmentCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2)
void invokePointCallbacks (SoAction *const action, const SoPrimitiveVertex *const v)
void beginShape (SoAction *const action, const TriangleShape shapetype, SoDetail *const detail=NULL)
void shapeVertex (const SoPrimitiveVertex *const v)
void endShape (void)
void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoMultiTextureCoordinateElement *const tce, const float s, const float t, const SbVec3f &normal)
void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoMultiTextureCoordinateElement *const tce, const float s, const float t, const float r, const SbVec3f &normal)
SbBool startVertexArray (SoGLRenderAction *action, const SoCoordinateElement *coords, const SbVec3f *pervertexnormals, const SbBool texpervertex, const SbBool colorpervertex)
void finishVertexArray (SoGLRenderAction *action, const SbBool vbo, const SbBool normpervertex, const SbBool texpervertex, const SbBool colorpervertex)

note the two generateVertex overloads β€” yes there are literally two, one with an extra const float r in the middle. they're not a typo, they're twins. πŸ’…

πŸ¦‹ Protected Member Functions inherited from SoNode πŸ¦‹

SoNode (void)
virtual ~SoNode ()
virtual SbBool readInstance (SoInput *in, unsigned short flags)

🌸 Protected Member Functions inherited from SoFieldContainer 🌸

SoFieldContainer (void)
virtual ~SoFieldContainer ()

πŸ’œ Protected Member Functions inherited from SoBase πŸ’œ

SoBase (void)
virtual ~SoBase ()
virtual void destroy (void)
SbBool hasMultipleWriteRefs (void) const
SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const
void writeFooter (SoOutput *out) const
virtual const char * getFileFormatName (void) const
virtual SoNotRec createNotRec (void)

⭐ Static Protected Member Functions ⭐

static const SoFieldData ** getFieldDataPtr (void)

⭐ Static Protected Member Functions inherited from SoShape ⭐

static const SoFieldData ** getFieldDataPtr (void)

⭐ Static Protected Member Functions inherited from SoNode ⭐

static const SoFieldData ** getFieldDataPtr (void)
static void setNextActionMethodIndex (int index)
static int getNextActionMethodIndex (void)
static void incNextActionMethodIndex (void)
static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)

⭐ Static Protected Member Functions inherited from SoBase ⭐

static uint32_t getCurrentWriteCounter (void)
static void staticDataLock (void)
static void staticDataUnlock (void)

πŸŽ€ Additional Inherited Members πŸŽ€

Protected Types inherited from SoBase

enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }

Protected Attributes inherited from SoNode

SbUniqueId uniqueId

Protected Attributes inherited from SoFieldContainer

SbBool isBuiltIn

Static Protected Attributes inherited from SoNode

static SbUniqueId nextUniqueId = 1
static int nextActionMethodIndex = 0

πŸ’– Detailed Description πŸ’–

okay so SoCylinder is the class that renders cylinder shapes. that's it. that's the whole vibe. but let me give you the full tea.

you drop a cylinder shape into your scene graph, and it gets rendered using whatever the current material, texture and draw style settings are β€” and if there aren't any set, the default settings get used instead. no cap.

the whole point of SoCylinder is that it's a convenient abstraction for you, the application programmer. you get to use these "complex" shapes of this type without having to do the tessellation to polygons and all that other low level programming yourself. she's doing the work so you don't have to. πŸ’…

here's how it actually goes down: the underlying rendering system visualizes a cylinder by first tessellating the conceptual cylinder into a set of polygons. now, there's a trade-off between the visual appearance of the cylinder being as correct as possible versus fast rendering β€” and you control it with an SoComplexity node, which influences how many polygons get generated from the tessellation process. the higher the complexity value, the more polygons will be generated, and the more rounded the sides of the cylinder will look. ✨ so set the SoComplexity::value field to whatever you think is a good trade-off between correctness and speed for your particular application. you got this.

cute trick alert πŸŽ€ a nice trick for rendering a disc is to render an SoCylinder with SoCylinder::height set to zero:
#Inventor V2.1 ascii

ShapeHints { # to get two-sided lighting on the disc
   vertexOrdering COUNTERCLOCKWISE
   shapeType UNKNOWN_SHAPE_TYPE
}

Cylinder {
   height 0
   parts TOP
}

that's the moment. the ShapeHints is there so you get two-sided lighting on the disc, and the cylinder is squashed flat with height 0 and only the TOP part turned on. iconic.

FILE FORMAT/DEFAULTS:

Cylinder {
    radius 1
    height 2
    parts (SIDES | TOP | BOTTOM)
}

See also

SoCone, SoSphere, SoCube β€” the rest of the shape girlies. 🫢


🌈 Member Enumeration Documentation 🌈

enum SoCylinder::Part

this enum lists out the various parts of the cylinder, so you can set whether each one is included or excluded from the shape. pick your fighters.

Enumerator

  • SIDES β€” sides of cylinder.
  • TOP β€” top of cylinder.
  • BOTTOM β€” bottom of cylinder.
  • ALL β€” all parts.

πŸ’€ Constructor & Destructor Documentation πŸ’€

SoCylinder::SoCylinder (void )

constructor. that's it, that's the description. she's born. πŸ‘‘

SoCylinder::~SoCylinder () [protected], [virtual]

destructor. protected and virtual, so she goes out on her own terms. 😭


πŸ‘‘ Member Function Documentation πŸ‘‘

SoType SoCylinder::getClassTypeId (void ) [static]

this static method returns the SoType object associated with objects of this class.

SoType SoCylinder::getTypeId (void ) const [virtual]

returns the type identification of an object derived from a class inheriting SoBase. this is what's used for runtime type checking and "downward" casting.

reimplemented from SoShape.

const SoFieldData ** SoCylinder::getFieldDataPtr (void ) [static], [protected]

this API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

returns the SoFieldData class which holds information about fields in this node.

const SoFieldData * SoCylinder::getFieldData (void ) const [protected], [virtual]

returns a pointer to the class-wide field data storage object for this instance. if no fields are present, returns NULL.

reimplemented from SoShape.

void SoCylinder::initClass (void ) [static]

the page gives this one no blurb, bestie β€” it's just there, hanging out in the static section, doing whatever initClass does. πŸ™ˆ

void SoCylinder::addPart (SoCylinder::Part part)

add a part to the cylinder.

see also: removePart(), hasPart()

void SoCylinder::removePart (SoCylinder::Part part)

remove a part from the cylinder.

see also: addPart(), hasPart()

SbBool SoCylinder::hasPart (SoCylinder::Part part) const

returns TRUE if rendering of the given part is currently turned on.

see also: addPart(), removePart()

void SoCylinder::rayPick (SoRayPickAction * action) [virtual]

calculates picked point based on primitives generated by subclasses.

reimplemented from SoShape.

void SoCylinder::getPrimitiveCount (SoGetPrimitiveCountAction * action) [virtual]

action method for the SoGetPrimitiveCountAction.

calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the action.

nodes influencing how geometry nodes calculate their primitive count also override this method to change the relevant state variables.

reimplemented from SoShape.

void SoCylinder::GLRender (SoGLRenderAction * action) [virtual]

action method for the SoGLRenderAction.

this is called during rendering traversals. nodes influencing the rendering state in any way, or that want to throw geometry primitives at OpenGL, override this method.

reimplemented from SoShape.

void SoCylinder::generatePrimitives (SoAction * action) [protected], [virtual]

the method implements action behavior for shape nodes for SoCallbackAction. it is invoked from SoShape::callback(). (subclasses should not override SoNode::callback().)

the subclass implementations use the convenience methods SoShape::beginShape(), SoShape::shapeVertex(), and SoShape::endShape(), with SoDetail instances, to pass the primitives making up the shape back to the caller.

implements SoShape.

void SoCylinder::computeBBox (SoAction * action, SbBox3f & box, SbVec3f & center) [protected], [virtual]

implemented by SoShape subclasses to let the SoShape superclass know the exact size and weighted center point of the shape's bounding box.

the bounding box and center point should be calculated and returned in the local coordinate system.

the method implements action behavior for shape nodes for SoGetBoundingBoxAction. it is invoked from SoShape::getBoundingBox(). (subclasses should not override SoNode::getBoundingBox().)

the box parameter sent in is guaranteed to be an empty box, while center is undefined upon function entry.

implements SoShape.

πŸ“ Member Data Documentation πŸ“

  • SoSFFloat SoCylinder::radius β€” radius of cylinder. default value 1.0.
  • SoSFFloat SoCylinder::height β€” height of cylinder. default is 2.0.
  • SoSFBitMask SoCylinder::parts β€” which parts to use for rendering, picking, etc. defaults to SoCylinder::ALL.

🌸 Author 🌸

generated automatically by Doxygen for Coin from the source code. (not a human, not a girlie, just a doc generator doing her thing. respect. 🫑)


and that's the whole page, bestie! this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and you just read SoCylinder(3). go tessellate something gorgeous. πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from