33#ifndef COIN_SOINTERPOLATE_H
34#define COIN_SOINTERPOLATE_H
37#include <Inventor/engines/SoSubEngine.h>
38#include <Inventor/engines/SoEngineOutput.h>
39#include <Inventor/fields/SoSFFloat.h>
62#define SO_INTERPOLATE_HEADER(_class_) \
63 SO_ENGINE_HEADER(_class_); \
66 static void initClass(); \
70 virtual void evaluate()
73#define PRIVATE_SO_INTERPOLATE_CONSTRUCTOR(_class_, _type_, _valtype_, _default0_, _default1_) \
74 SO_ENGINE_CONSTRUCTOR(_class_); \
75 SO_ENGINE_ADD_INPUT(alpha, (0.0f)); \
76 SO_ENGINE_ADD_INPUT(input0, _default0_); \
77 SO_ENGINE_ADD_INPUT(input1, _default1_); \
78 SO_ENGINE_ADD_OUTPUT(output, _type_)
80#define PRIVATE_SO_INTERPOLATE_DESTRUCTOR(_class_) \
85#define PRIVATE_SO_INTERPOLATE_EVALUATE(_class_, _type_, _valtype_, _interpexp_) \
87_class_::evaluate(void) \
89 int n0 = this->input0.getNum(); \
90 int n1 = this->input1.getNum(); \
91 float a = this->alpha.getValue(); \
92 for (int i = SbMax(n0, n1) - 1; i >= 0; i--) { \
93 _valtype_ v0 = this->input0[SbMin(i, n0-1)]; \
94 _valtype_ v1 = this->input1[SbMin(i, n1-1)]; \
95 SO_ENGINE_OUTPUT(output, _type_, set1Value(i, _interpexp_)); \
114#define SO_INTERPOLATE_SOURCE(_class_, _type_, _valtype_, _default0_, _default1_, _interpexp_) \
116SO_ENGINE_SOURCE(_class_); \
118_class_::_class_(void) \
120 PRIVATE_SO_INTERPOLATE_CONSTRUCTOR(_class_, _type_, _valtype_, _default0_, _default1_); \
121 this->isBuiltIn = FALSE; \
124PRIVATE_SO_INTERPOLATE_DESTRUCTOR(_class_) \
125PRIVATE_SO_INTERPOLATE_EVALUATE(_class_, _type_, _valtype_, _interpexp_)
128#define SO_INTERPOLATE_INITCLASS(_class_, _classname_) \
131_class_::initClass(void) \
133 SO_ENGINE_INIT_CLASS(_class_, SoInterpolate, "SoInterpolate"); \
142#include <Inventor/engines/SoInterpolateFloat.h>
143#include <Inventor/engines/SoInterpolateVec2f.h>
144#include <Inventor/engines/SoInterpolateVec3f.h>
145#include <Inventor/engines/SoInterpolateVec4f.h>
146#include <Inventor/engines/SoInterpolateRotation.h>
The SoEngineOutput class is the output slots in SoEngine instances.
Definition SoEngineOutput.h:45
SoEngine is the base class for Coin engines.
Definition SoEngine.h:43
static void initClass(void)
Sets up initialization for data common to all instances of this class, like submitting necessary info...
Definition SoEngine.cpp:162
static void initClasses(void)
Definition SoEngine.cpp:175
The SoInterpolate class is the base class for all interpolator engines.
Definition SoInterpolate.h:41
SoEngineOutput output
Definition SoInterpolate.h:50
SoSFFloat alpha
Definition SoInterpolate.h:49
The SoSFFloat class is a container for a floating point value.
Definition SoSFFloat.h:39