.TH "SoNormalGenerator" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoNormalGenerator \- The \fBSoNormalGenerator\fP class is used to generate normals\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSoNormalGenerator\fP (\fBconst\fP SbBool ccw, \fBconst\fP int \fBapproxVertices\fP=64)" .br .ti -1c .RI "\fB~SoNormalGenerator\fP ()" .br .ti -1c .RI "\fBvoid\fP \fBreset\fP (\fBconst\fP SbBool ccw)" .br .ti -1c .RI "\fBvoid\fP \fBbeginPolygon\fP ()" .br .ti -1c .RI "\fBvoid\fP \fBpolygonVertex\fP (\fBconst\fP \fBSbVec3f\fP &v)" .br .ti -1c .RI "\fBvoid\fP \fBendPolygon\fP ()" .br .ti -1c .RI "\fBvoid\fP \fBtriangle\fP (\fBconst\fP \fBSbVec3f\fP &\fBv0\fP, \fBconst\fP \fBSbVec3f\fP &\fBv1\fP, \fBconst\fP \fBSbVec3f\fP &\fBv2\fP)" .br .ti -1c .RI "\fBvoid\fP \fBquad\fP (\fBconst\fP \fBSbVec3f\fP &\fBv0\fP, \fBconst\fP \fBSbVec3f\fP &\fBv1\fP, \fBconst\fP \fBSbVec3f\fP &\fBv2\fP, \fBconst\fP \fBSbVec3f\fP &\fBv3\fP)" .br .ti -1c .RI "\fBvoid\fP \fBgenerate\fP (\fBconst\fP float creaseAngle, \fBconst\fP int32_t *\fBstriplens\fP=\fBNULL\fP, \fBconst\fP int \fBnumstrips\fP=0)" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerStrip\fP (\fBconst\fP int32_t *\fBstriplens\fP, \fBconst\fP int \fBnumstrips\fP)" .br .ti -1c .RI "\fBvoid\fP \fBgeneratePerFace\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBgenerateOverall\fP (\fBvoid\fP)" .br .ti -1c .RI "int \fBgetNumNormals\fP () \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetNumNormals\fP (\fBconst\fP int num)" .br .ti -1c .RI "\fBconst\fP \fBSbVec3f\fP * \fBgetNormals\fP () \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSbVec3f\fP & \fBgetNormal\fP (\fBconst\fP int32_t \fBi\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetNormal\fP (\fBconst\fP int32_t index, \fBconst\fP \fBSbVec3f\fP &normal)" .br .in -1c .SH "Detailed Description" .PP The \fBSoNormalGenerator\fP class is used to generate normals\&. FIXME: document properly .SH "Constructor & Destructor Documentation" .PP .SS "SoNormalGenerator::SoNormalGenerator (\fBconst\fP SbBool isccw, \fBconst\fP int approxVertices = \fC64\fP)" Constructor with \fIisccw\fP indicating if polygons are specified in counterclockwise order\&. The \fIapproxVertices\fP can be used to optimize normal generation\&. .SS "SoNormalGenerator::~SoNormalGenerator ()" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBvoid\fP SoNormalGenerator::reset (\fBconst\fP SbBool ccwarg)" Resets the normal generator, making it possible to reuse it without allocating a new one\&. .PP This function is an extension for Coin, and it is not available in the original SGI Open Inventor \fBv2\&.1\fP API\&. .br .PP \fBSince\fP .RS 4 Coin \fB2\&.0\fP .RE .PP .SS "\fBvoid\fP SoNormalGenerator::beginPolygon (\fBvoid\fP)" Signals the start of a new polygon\&. .PP \fBSee also\fP .RS 4 \fBSoNormalGenerator::polygonVertex()\fP .PP \fBSoNormalGenerator::endPolygon()\fP .RE .PP .SS "\fBvoid\fP SoNormalGenerator::polygonVertex (\fBconst\fP \fBSbVec3f\fP & v)" Adds a vertex to the current polygon\&. .PP \fBSee also\fP .RS 4 \fBSoNormalGenerator::beginPolygon()\fP .PP \fBSoNormalGenerator::endPolygon()\fP .RE .PP .SS "\fBvoid\fP SoNormalGenerator::endPolygon (\fBvoid\fP)" Signals the end of a polygon\&. .PP \fBSee also\fP .RS 4 \fBSoNormalGenerator::beginPolygon()\fP .PP \fBSoNormalGenerator::polygonVertex()\fP .RE .PP .SS "\fBvoid\fP SoNormalGenerator::triangle (\fBconst\fP \fBSbVec3f\fP & v0, \fBconst\fP \fBSbVec3f\fP & v1, \fBconst\fP \fBSbVec3f\fP & v2)" Convenience method for adding a triangle\&. .SS "\fBvoid\fP SoNormalGenerator::quad (\fBconst\fP \fBSbVec3f\fP & v0, \fBconst\fP \fBSbVec3f\fP & v1, \fBconst\fP \fBSbVec3f\fP & v2, \fBconst\fP \fBSbVec3f\fP & v3)" Convenience method for adding a quad .SS "\fBvoid\fP SoNormalGenerator::generate (\fBconst\fP float creaseAngle, \fBconst\fP int32_t * striplens = \fC\fBNULL\fP\fP, \fBconst\fP int numstrips = \fC0\fP)" Triggers the normal generation\&. Normals are generated using \fIcreaseAngle\fP to find which edges should be flat-shaded and which should be smooth-shaded\&. .PP If normals are generated for triangle strips, the \fIstriplens\fP and \fInumstrips\fP must be supplied\&. See \fBsrc/nodes/SoTriangleStripSet\&.cpp\fP (generateDefaultNormals()) for an example on how you send triangle strip information to this generator\&. It's not trivial, since you have to know how OpenGL/Coin generate triangles from triangle strips\&. .SS "\fBvoid\fP SoNormalGenerator::generatePerStrip (\fBconst\fP int32_t * striplens, \fBconst\fP int numstrips)" Generates one normal per strip by averaging face normals\&. .SS "\fBvoid\fP SoNormalGenerator::generatePerFace (\fBvoid\fP)" Generates the normals per face\&. Use this when PER_FACE normal binding is needed\&. This method is not part of the OIV API\&. .SS "\fBvoid\fP SoNormalGenerator::generateOverall (\fBvoid\fP)" Generates one overall normal by averaging all face normals\&. Use when normal binding is OVERALL\&. This method is not part of the OIV API\&. .SS "int SoNormalGenerator::getNumNormals (\fBvoid\fP) const" Returns the number of normals generated\&. .SS "\fBvoid\fP SoNormalGenerator::setNumNormals (\fBconst\fP int num)" Sets the number of generated normals\&. This method is not supported in Coin, and is provided for API compatibility only\&. .SS "\fBconst\fP \fBSbVec3f\fP * SoNormalGenerator::getNormals (\fBvoid\fP) const" Returns a pointer to the generated normals\&. .SS "\fBconst\fP \fBSbVec3f\fP & SoNormalGenerator::getNormal (\fBconst\fP int32_t i) const" Returns the normal at index \fIi\fP\&. .PP \fBSee also\fP .RS 4 \fBSoNormalGenerator::getNumNormals()\fP .RE .PP .SS "\fBvoid\fP SoNormalGenerator::setNormal (\fBconst\fP int32_t index, \fBconst\fP \fBSbVec3f\fP & normal)" Sets the normal at index \fIindex\fP to \fInormal\fP\&. This method is not supported in Coin, and is provided for API compatibility only\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.