55#ifndef _SO_NORMAL_BUNDLE
56#define _SO_NORMAL_BUNDLE
106 { generator->beginPolygon(); }
108 { generator->polygonVertex(point); }
110 { generator->endPolygon(); }
116 { generator->triangle(p1, p2, p3); }
134 bool addToState=
TRUE);
138 {
return generator->getNormals(); }
140 {
return generator->getNumNormals(); }
153 const SbVec3f &
get(
int index)
const {
return normElt->get(index); }
156 void send(
int index)
const { GLNormElt->send(index); }
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Abstract base class for all actions.
This is the abstract base class for bundles.
Element that stores the current surface normals.
Abstract base class for all database nodes.
Bundle that allows shapes to deal with normals and normal bindings more easily.
const SbVec3f * getGeneratedNormals() const
Returns the generated normals.
const SbVec3f & get(int index) const
Returns indexed normal.
void initGenerator(int initialNum=100)
Initializes generation in the case where shouldGenerate() is not called.
bool shouldGenerate(int numNeeded)
Returns TRUE if normals need to be generated.
~SoNormalBundle()
Destructor.
SoNormalBundle(SoAction *action, bool forRendering)
Constructor - takes the action the bundle is used for and a flag to indicate whether the bundle is be...
void send(int index) const
Sends indexed normal to the GL, for use only during GL rendering.
void triangle(const SbVec3f &p1, const SbVec3f &p2, const SbVec3f &p3)
Send a triangle.
void polygonVertex(const SbVec3f &point)
SoNormalGenerator * generator
Normal generator.
void beginPolygon()
If shouldGenerate() returns TRUE, these methods can be used by shapes to specify the geometry to gene...
void set(int32_t numNormals, const SbVec3f *normals)
This allows shapes that generate their own normals (for efficiency) to store the resulting normals in...
int getNumGeneratedNormals() const
void generate(int startIndex=0, bool addToState=TRUE)
Calculates the normals once all vertices have been sent.
Element that stores the current surface normals.
This class can be used by polyhedral shape classes to generate surface normals when they do not have ...