.TH "SoNormalCache" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoNormalCache \- The \fBSoNormalCache\fP class is used to hold cached normals\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoCache\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSoNormalCache\fP (\fBSoState\fP *\fBconst\fP state)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoNormalCache\fP ()" .br .ti -1c .RI "\fBvoid\fP \fBset\fP (\fBconst\fP int num, \fBconst\fP \fBSbVec3f\fP *\fBconst\fP normals)" .br .ti -1c .RI "\fBvoid\fP \fBset\fP (\fBSoNormalGenerator\fP *generator)" .br .ti -1c .RI "int \fBgetNum\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSbVec3f\fP * \fBgetNormals\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetNumIndices\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP int32_t * \fBgetIndices\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerVertex\fP (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int32_t *\fBcoordindices\fP, \fBconst\fP int \fBnumcoordindices\fP, \fBconst\fP float \fBcrease_angle\fP, \fBconst\fP \fBSbVec3f\fP *\fBfacenormals\fP=\fBNULL\fP, \fBconst\fP int \fBnumfacenormals\fP=\-1, \fBconst\fP SbBool ccw=TRUE, \fBconst\fP SbBool \fBtristrip\fP=FALSE)" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerFace\fP (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int32_t *\fBcoordindices\fP, \fBconst\fP int \fBnumcoorindices\fP, \fBconst\fP SbBool ccw)" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerFaceStrip\fP (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int32_t *\fBcoordindices\fP, \fBconst\fP int \fBnumcoorindices\fP, \fBconst\fP SbBool ccw)" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerStrip\fP (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int32_t *\fBcoordindices\fP, \fBconst\fP int \fBnumcoorindices\fP, \fBconst\fP SbBool ccw)" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerVertexQuad\fP (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int \fBvPerRow\fP, \fBconst\fP int \fBvPerColumn\fP, \fBconst\fP SbBool ccw)" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerFaceQuad\fP (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int \fBvPerRow\fP, \fBconst\fP int \fBvPerColumn\fP, \fBconst\fP SbBool ccw)" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerRowQuad\fP (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int \fBvPerRow\fP, \fBconst\fP int \fBvPerColumn\fP, \fBconst\fP SbBool ccw)" .br .in -1c Public Member Functions inherited from \fBSoCache\fP .in +1c .ti -1c .RI "\fBSoCache\fP (\fBSoState\fP *\fBconst\fP state)" .br .ti -1c .RI "\fBvoid\fP \fBref\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBunref\fP (\fBSoState\fP *state=\fBNULL\fP)" .br .ti -1c .RI "\fBvoid\fP \fBaddElement\fP (\fBconst\fP \fBSoElement\fP *\fBconst\fP elem)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBaddCacheDependency\fP (\fBconst\fP \fBSoState\fP *state, \fBSoCache\fP *cache)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBisValid\fP (\fBconst\fP \fBSoState\fP *state) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSoElement\fP * \fBgetInvalidElement\fP (\fBconst\fP \fBSoState\fP *\fBconst\fP state) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBinvalidate\fP (\fBvoid\fP)" .br .in -1c .SS "Additional Inherited Members" Protected Member Functions inherited from \fBSoCache\fP .in +1c .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBdestroy\fP (\fBSoState\fP *state)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoCache\fP ()" .br .in -1c .SH "Detailed Description" .PP The \fBSoNormalCache\fP class is used to hold cached normals\&. As an extension to the original SGI Open Inventor \fBv2\&.1\fP API, it is also possible to generate normals using this class\&. .PP It is more powerful and easier to use than the \fBSoNormalGenerator\fP class\&. It is possible to generate normals per vertex with indices (using much less memory than plain per vertex normals), and it contains special methods to generate normals for triangle strips and quads\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoNormalCache::SoNormalCache (\fBSoState\fP *\fBconst\fP state)" Constructor with \fIstate\fP being the current state\&. .SS "SoNormalCache::~SoNormalCache ()\fC [virtual]\fP" Destructor .SH "Member Function Documentation" .PP .SS "\fBvoid\fP SoNormalCache::set (\fBconst\fP int num, \fBconst\fP \fBSbVec3f\fP *\fBconst\fP normals)" Sets an array of normals for this cache\&. The normals will not be deleted when the instance is deleted\&. .SS "\fBvoid\fP SoNormalCache::set (\fBSoNormalGenerator\fP * generator)" Uses a normal generator in this cache\&. The normal generator will be deleted when the cache is deleted or reset\&. .SS "int SoNormalCache::getNum (\fBvoid\fP) const" Returns the number of normals in the cache\&. .SS "\fBconst\fP \fBSbVec3f\fP * SoNormalCache::getNormals (\fBvoid\fP) const" Return a pointer to the normals in this cache\&. .SS "int SoNormalCache::getNumIndices (\fBvoid\fP) const" Returns the number of indices in this cache\&. Normals are generated with PER_VERTEX_INDEXED binding\&. .SS "\fBconst\fP int32_t * SoNormalCache::getIndices (\fBvoid\fP) const" Returns the normal indices\&. .SS "\fBvoid\fP SoNormalCache::generatePerVertex (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int32_t * vindex, \fBconst\fP int numvi, \fBconst\fP float crease_angle, \fBconst\fP \fBSbVec3f\fP * facenormals = \fC\fBNULL\fP\fP, \fBconst\fP int numfacenormals = \fC\-1\fP, \fBconst\fP SbBool ccw = \fCTRUE\fP, \fBconst\fP SbBool tristrip = \fCFALSE\fP)" Generates normals for each vertex for each face\&. It is possible to specify face normals if these have been calculated somewhere else, otherwise the face normals will be calculated before the vertex normals are calculated\&. \fItristrip\fP should be \fCTRUE\fP if the geometry consists of triangle strips\&. .SS "\fBvoid\fP SoNormalCache::generatePerFace (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int32_t * cind, \fBconst\fP int nv, \fBconst\fP SbBool ccw)" Generates face normals for the faceset defined by \fIcoords\fP and \fIcind\fP\&. .SS "\fBvoid\fP SoNormalCache::generatePerFaceStrip (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int32_t * cind, \fBconst\fP int nv, \fBconst\fP SbBool ccw)" Generates face normals for triangle strips\&. .SS "\fBvoid\fP SoNormalCache::generatePerStrip (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int32_t * cind, \fBconst\fP int nv, \fBconst\fP SbBool ccw)" Generates one normal per triangle strips (averages all triangle normals)\&. .SS "\fBvoid\fP SoNormalCache::generatePerVertexQuad (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int vPerRow, \fBconst\fP int vPerColumn, \fBconst\fP SbBool ccw)" Generates PER_VERTEX normals for quad data\&. .SS "\fBvoid\fP SoNormalCache::generatePerFaceQuad (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int vPerRow, \fBconst\fP int vPerColumn, \fBconst\fP SbBool ccw)" Generates per face normals for quad data\&. .SS "\fBvoid\fP SoNormalCache::generatePerRowQuad (\fBconst\fP \fBSbVec3f\fP *\fBconst\fP coords, \fBconst\fP \fBunsigned\fP int numcoords, \fBconst\fP int vPerRow, \fBconst\fP int vPerColumn, \fBconst\fP SbBool ccw)" Generates per row normals for quad data\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.