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_) \
107SO_ENGINE_SOURCE(_class_); \
109_class_::_class_(void) \
111 PRIVATE_SO_INTERPOLATE_CONSTRUCTOR(_class_, _type_, _valtype_, _default0_, _default1_); \
112 this->isBuiltIn = FALSE; \
115PRIVATE_SO_INTERPOLATE_DESTRUCTOR(_class_) \
116PRIVATE_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"); \
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>
The SoEngineOutput class is the output slots in SoEngine instances.
Definition SoEngineOutput.h:36
SoEngine is the base class for Coin engines.
Definition SoEngine.h:34
static void initClasses(void)
Definition SoEngine.cpp:163
The SoInterpolate class is the base class for all interpolator engines.
Definition SoInterpolate.h:32
SoEngineOutput output
Definition SoInterpolate.h:41
SoSFFloat alpha
Definition SoInterpolate.h:40
The SoSFFloat class is a container for a floating point value.
Definition SoSFFloat.h:30
Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.