24 #ifndef COIN_SOINTERPOLATE_H
25 #define COIN_SOINTERPOLATE_H
28 #include <Inventor/engines/SoSubEngine.h>
29 #include <Inventor/engines/SoEngineOutput.h>
30 #include <Inventor/fields/SoSFFloat.h>
37 static void initClass(
void);
53 #define SO_INTERPOLATE_HEADER(_class_) \
54 SO_ENGINE_HEADER(_class_); \
57 static void initClass(); \
61 virtual void evaluate()
64 #define PRIVATE_SO_INTERPOLATE_CONSTRUCTOR(_class_, _type_, _valtype_, _default0_, _default1_) \
65 SO_ENGINE_CONSTRUCTOR(_class_); \
66 SO_ENGINE_ADD_INPUT(alpha, (0.0f)); \
67 SO_ENGINE_ADD_INPUT(input0, _default0_); \
68 SO_ENGINE_ADD_INPUT(input1, _default1_); \
69 SO_ENGINE_ADD_OUTPUT(output, _type_)
71 #define PRIVATE_SO_INTERPOLATE_DESTRUCTOR(_class_) \
76 #define PRIVATE_SO_INTERPOLATE_EVALUATE(_class_, _type_, _valtype_, _interpexp_) \
78 _class_::evaluate(void) \
80 int n0 = this->input0.getNum(); \
81 int n1 = this->input1.getNum(); \
82 float a = this->alpha.getValue(); \
83 for (int i = SbMax(n0, n1) - 1; i >= 0; i--) { \
84 _valtype_ v0 = this->input0[SbMin(i, n0-1)]; \
85 _valtype_ v1 = this->input1[SbMin(i, n1-1)]; \
86 SO_ENGINE_OUTPUT(output, _type_, set1Value(i, _interpexp_)); \
105 #define SO_INTERPOLATE_SOURCE(_class_, _type_, _valtype_, _default0_, _default1_, _interpexp_) \
107 SO_ENGINE_SOURCE(_class_); \
109 _class_::_class_(void) \
111 PRIVATE_SO_INTERPOLATE_CONSTRUCTOR(_class_, _type_, _valtype_, _default0_, _default1_); \
112 this->isBuiltIn = FALSE; \
115 PRIVATE_SO_INTERPOLATE_DESTRUCTOR(_class_) \
116 PRIVATE_SO_INTERPOLATE_EVALUATE(_class_, _type_, _valtype_, _interpexp_)
119 #define SO_INTERPOLATE_INITCLASS(_class_, _classname_) \
122 _class_::initClass(void) \
124 SO_ENGINE_INIT_CLASS(_class_, SoInterpolate, "SoInterpolate"); \
131 #ifndef COIN_INTERNAL
133 #include <Inventor/engines/SoInterpolateFloat.h>
134 #include <Inventor/engines/SoInterpolateVec2f.h>
135 #include <Inventor/engines/SoInterpolateVec3f.h>
136 #include <Inventor/engines/SoInterpolateVec4f.h>
137 #include <Inventor/engines/SoInterpolateRotation.h>
138 #endif // !COIN_INTERNAL
141 #endif // !COIN_SOINTERPOLATE_H
The SoInterpolate class is the base class for all interpolator engines.Interpolators are used to line...
Definition: SoInterpolate.h:32
SoEngine is the base class for Coin engines.Engines enables the application programmers to make compl...
Definition: SoEngine.h:34
The SoFieldContainer class is a base class for all classes that contain fields.The classes containing...
Definition: SoFieldContainer.h:34
SoEngineOutput output
Definition: SoInterpolate.h:41
SoSFFloat alpha
Definition: SoInterpolate.h:40
static void initClasses(void)
Definition: SoEngine.cpp:163
The SoEngineOutput class is the output slots in SoEngine instances.SoEngineOutput has methods for con...
Definition: SoEngineOutput.h:36
The SoSFFloat class is a container for a floating point value.This field is used where nodes...
Definition: SoSFFloat.h:30