50#ifndef _SO_NORMAL_ELEMENT
51#define _SO_NORMAL_ELEMENT
55#include <Inventor/SbLinear.h>
56#include <Inventor/elements/SoReplacedElement.h>
57#include <Inventor/errors/SoDebugError.h>
83 int32_t numNormals,
const SbVec3f *normals);
89 {
return getConstElement<SoNormalElement>(state);}
94 int32_t
getNum()
const {
return numNormals; }
101 if (index < 0 || index >= numNormals)
105 "Index (%d) is out of range 0 - %d",
106 index, numNormals - 1);
108 return defaultNormal;
110 return normals[index];
121 virtual void init(
SoState *state);
125 static void initClass();
126 static void exitClass();
static void post(const char *methodName, const char *formatString ...)
Posts an error.
Abstract base class for all database nodes.
Allows read-only access to the top element in the state.
int32_t getNum() const
Returns the number of normal vectors in an instance.
static const SoNormalElement * getInstance(SoState *state)
Returns the top (current) instance of the element in the state.
virtual void print(FILE *fp) const
Prints element (for debugging).
static void set(SoState *state, SoNode *node, int32_t numNormals, const SbVec3f *normals)
Sets the current normals.
const SbVec3f & get(int index) const
Returns the indexed normal from an element.
Abstract base class for each state element whose value is replaced whenever it is set.