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>
46 static void initClass(
void);
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_) \
116 SO_ENGINE_SOURCE(_class_); \
118 _class_::_class_(void) \
120 PRIVATE_SO_INTERPOLATE_CONSTRUCTOR(_class_, _type_, _valtype_, _default0_, _default1_); \
121 this->isBuiltIn = FALSE; \
124 PRIVATE_SO_INTERPOLATE_DESTRUCTOR(_class_) \
125 PRIVATE_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"); \
140 #ifndef COIN_INTERNAL
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>
147 #endif // !COIN_INTERNAL
150 #endif // !COIN_SOINTERPOLATE_H
The SoEngineOutput class is the output slots in SoEngine instances.
Definition: SoEngineOutput.h:45
SoSFFloat alpha
Definition: SoInterpolate.h:49
The SoInterpolate class is the base class for all interpolator engines.
Definition: SoInterpolate.h:41
The SoFieldContainer class is a base class for all classes that contain fields.
Definition: SoFieldContainer.h:43
static void initClasses(void)
Definition: SoEngine.cpp:173
The SoSFFloat class is a container for a floating point value.
Definition: SoSFFloat.h:39
SoEngineOutput output
Definition: SoInterpolate.h:50
SoEngine is the base class for Coin engines.
Definition: SoEngine.h:43