56#ifndef _SO_NORMAL_GENERATOR_
57#define _SO_NORMAL_GENERATOR_
150 SbVec3f *points, *faceNormals, *vertNormals;
151 int32_t numPoints, numVertNormals;
152 int32_t maxPoints, maxVertNormals;
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
This class can be used by polyhedral shape classes to generate surface normals when they do not have ...
void generate(float creaseAngle)
Calculate the normals once all vertices have been sent.
void beginPolygon()
Send a polygon's worth of vertices.
const SbVec3f * getNormals() const
Returns a pointer to the array of normals.
SoNormalGenerator(bool isCCW, int approxNumVertices)
SoNormalGenerator(bool isCCW)
Constructors and destructor.
int getNumNormals() const
The rest of the methods may be called only AFTER generate() has been called:
void polygonVertex(const SbVec3f &point)
void setNormal(int32_t index, const SbVec3f &newNormal)
Some shapes may need to adjust or reorder normals after generation.
void triangle(const SbVec3f &p1, const SbVec3f &p2, const SbVec3f &p3)
Send a triangle.
const SbVec3f & getNormal(int32_t i) const
Returns the i'th normal in the array.
void setNumNormals(int newNum)
Truncate the array so there are only the given number of normals.