SoNormalCache(3)

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

✨ NAME ✨

SoNormalCache β€” bestie, this class has ONE job and it's holding onto cached normals. That's the whole personality. No notes. πŸ‘‘

This is the SoNormalCache(3) page from the Coin manual (section 3, iykyk), so that's where you'd go hunting for it on your system. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Inventor/caches/SoNormalCache.h>

It inherits SoCache, so it's got that whole cache-family inheritance situation going on. Family business. πŸ’…

πŸ‘‘ Public Member Functions

SoNormalCache (SoState *const state)
virtual ~SoNormalCache ()
void set (const int num, const SbVec3f *const normals)
void set (SoNormalGenerator *generator)
int getNum (void) const
const SbVec3f * getNormals (void) const
int getNumIndices (void) const
const int32_t * getIndices (void) const
void generatePerVertex (const SbVec3f *const coords, const unsigned int
    numcoords, const int32_t *coordindices, const int numcoordindices,
    const float crease_angle, const SbVec3f *facenormals=NULL, const int
    numfacenormals=-1, const SbBool ccw=TRUE, const SbBool
    tristrip=FALSE)
void generatePerFace (const SbVec3f *const coords, const unsigned int
    numcoords, const int32_t *coordindices, const int numcoorindices,
    const SbBool ccw)
void generatePerFaceStrip (const SbVec3f *const coords, const unsigned
    int numcoords, const int32_t *coordindices, const int
    numcoorindices, const SbBool ccw)
void generatePerStrip (const SbVec3f *const coords, const unsigned int
    numcoords, const int32_t *coordindices, const int numcoorindices,
    const SbBool ccw)
void generatePerVertexQuad (const SbVec3f *const coords, const unsigned
    int numcoords, const int vPerRow, const int vPerColumn, const SbBool
    ccw)
void generatePerFaceQuad (const SbVec3f *const coords, const unsigned
    int numcoords, const int vPerRow, const int vPerColumn, const SbBool
    ccw)
void generatePerRowQuad (const SbVec3f *const coords, const unsigned int
    numcoords, const int vPerRow, const int vPerColumn, const SbBool
    ccw)

πŸŽ€ Public Member Functions inherited from SoCache

SoCache (SoState *const state)
void ref (void)
void unref (SoState *state=NULL)
void addElement (const SoElement *const elem)
virtual void addCacheDependency (const SoState *state, SoCache *cache)
virtual SbBool isValid (const SoState *state) const
const SoElement * getInvalidElement (const SoState *const state) const
void invalidate (void)

🧚 Additional Inherited Members

🌸 Protected Member Functions inherited from SoCache

virtual void destroy (SoState *state)
virtual ~SoCache ()

πŸ’– DETAILED DESCRIPTION πŸ’–

SoNormalCache is the class that holds your cached normals. That's the whole vibe. 🌈

As a lil extension on top of the original SGI Open Inventor v2.1 API, you can also generate normals with this class. Glow-up behavior. ✨

It's more powerful and easier to use than the SoNormalGenerator class β€” lowkey it ate. You can generate normals per vertex with indices (which uses way less memory than plain per-vertex normals, no cap 🧠), and it's got special methods just for generating normals for triangle strips and quads. Specialized queen. πŸ‘‘


πŸŽ€ CONSTRUCTOR & DESTRUCTOR DOCUMENTATION πŸŽ€

SoNormalCache::SoNormalCache (SoState *const state)

Constructor, with state being the current state. You gotta hand it the state, that's the entry fee. 🎟️

SoNormalCache::~SoNormalCache () [virtual]

Destructor. Say bye bestie. πŸ‘‹


πŸ’… MEMBER FUNCTION DOCUMENTATION πŸ’…

void SoNormalCache::set (const int num, const SbVec3f *const normals)

Sets an array of normals for this cache. Heads up though β€” the normals will not be deleted when the instance is deleted. So that memory is yours to deal with, fr fr. πŸ™ˆ

void SoNormalCache::set (SoNormalGenerator * generator)

Uses a normal generator in this cache. This one's different from the other set: the normal generator will be deleted when the cache is deleted or reset. It's not your problem, she handles it. πŸ’…

int SoNormalCache::getNum (void ) const

Returns the number of normals in the cache. Just a count. Very demure. πŸŽ€

const SbVec3f * SoNormalCache::getNormals (void ) const

Returns a pointer to the normals in this cache. Here, take the pointer. 🫴

int SoNormalCache::getNumIndices (void ) const

Returns the number of indices in this cache. Oh and important β€” normals are generated with PER_VERTEX_INDEXED binding. Remember that. πŸ“Œ

const int32_t * SoNormalCache::getIndices (void ) const

Returns the normal indices. That's it, that's the function. πŸ¦‹

void SoNormalCache::generatePerVertex (const SbVec3f *const coords, const unsigned int numcoords, const int32_t * vindex, const int numvi, const float crease_angle, const SbVec3f * facenormals = NULL, const int numfacenormals = -1, const SbBool ccw = TRUE, const SbBool tristrip = FALSE)

Generates normals for each vertex for each face. You can specify face normals if you already calculated them somewhere else β€” otherwise the face normals get calculated first, before the vertex normals get calculated. Order matters, bestie. ✨ And tristrip should be TRUE if the geometry consists of triangle strips. Don't forget or it'll be giving chaos. πŸ’€

void SoNormalCache::generatePerFace (const SbVec3f *const coords, const unsigned int numcoords, const int32_t * cind, const int nv, const SbBool ccw)

Generates face normals for the faceset defined by coords and cind. 🧚

void SoNormalCache::generatePerFaceStrip (const SbVec3f *const coords, const unsigned int numcoords, const int32_t * cind, const int nv, const SbBool ccw)

Generates face normals for triangle strips. Strips get their own special treatment, as they should. πŸ‘‘

void SoNormalCache::generatePerStrip (const SbVec3f *const coords, const unsigned int numcoords, const int32_t * cind, const int nv, const SbBool ccw)

Generates one normal per triangle strip β€” and it averages all the triangle normals to get it. Math girlies rise. πŸ”₯

void SoNormalCache::generatePerVertexQuad (const SbVec3f *const coords, const unsigned int numcoords, const int vPerRow, const int vPerColumn, const SbBool ccw)

Generates PER_VERTEX normals for quad data. Quads deserve love too. πŸ’œ

void SoNormalCache::generatePerFaceQuad (const SbVec3f *const coords, const unsigned int numcoords, const int vPerRow, const int vPerColumn, const SbBool ccw)

Generates per face normals for quad data. 🌸

void SoNormalCache::generatePerRowQuad (const SbVec3f *const coords, const unsigned int numcoords, const int vPerRow, const int vPerColumn, const SbBool ccw)

Generates per row normals for quad data. Row by row, iconic behavior. ⭐


🌸 AUTHOR 🌸

Generated automatically by Doxygen for Coin from the source code. (Not a human author moment, it's a robot-authored banger. πŸ€–βœ¨)


Version 4.0.10 Β· Thu Jun 25 2026 00:00:00 Β· SoNormalCache(3)

That's the whole page bestie β€” normals cached, indices returned, quads fully respected. Go forth and render something gorgeous. πŸ¦‹πŸ’– periodt.

πŸ“¦ where this page comes from