Open Inventor Reference
SoInterpolate.h File Reference

Go to the source code of this file.

Classes

class  SoInterpolate
 Base class for all interpolator engines. More...
 
class  SoInterpolateFloat
 Interpolaters for the builtin field types. More...
 
class  SoInterpolateRotation
 Interpolates rotation values. More...
 
class  SoInterpolateVec2f
 Interpolates 2D floating-point vectors. More...
 
class  SoInterpolateVec3f
 Interpolates 3D floating-point vectors. More...
 
class  SoInterpolateVec4f
 Interpolates 4D floating-point vectors. More...
 

Macros

#define SO_INTERPOLATE_HEADER(className)
 These macros can be used to easily define interpolater engine headers and source.
 
#define SO_INTERPOLATE_SOURCE(className, type, valType, defaultVal0, defaultVal1, interpVal)
 This macro is to be used within the class source.
 
#define SO_INTERPOLATE_INITCLASS(className, classPrintName)
 This macro defines the initClass method for Interpolators.
 

Macro Definition Documentation

◆ SO_INTERPOLATE_HEADER

#define SO_INTERPOLATE_HEADER (   className)
Value:
\
SO_ENGINE_HEADER(className); \
\
private: \
~className(); \
virtual void evaluate(); \
\
SoINTERNAL public: \
static void initClass(); \
\
public: \
className()
#define SoINTERNAL
Definition SbBasic.h:155

This macro is to be used within the class definition header. It declares variables and methods that all interpolaters support

Definition at line 150 of file SoInterpolate.h.

◆ SO_INTERPOLATE_INITCLASS

#define SO_INTERPOLATE_INITCLASS (   className,
  classPrintName 
)
Value:
\
void \
className::initClass() \
{ \
SO__ENGINE_INIT_CLASS(className, classPrintName, SoInterpolate); \
}
Base class for all interpolator engines.

It is separate from the _SOURCE macro so that we can put all of the engine's initClass methods near each other to reduce the number of pages touched on startup (decreasing startup time and the amount of memory used).

Definition at line 213 of file SoInterpolate.h.

◆ SO_INTERPOLATE_SOURCE

#define SO_INTERPOLATE_SOURCE (   className,
  type,
  valType,
  defaultVal0,
  defaultVal1,
  interpVal 
)
Value:
\
SO_ENGINE_SOURCE(className); \
\
className::className() \
{ \
SO_ENGINE_CONSTRUCTOR(className); \
SO_ENGINE_ADD_INPUT(alpha, (0.0)); \
SO_ENGINE_ADD_INPUT(input0, defaultVal0); \
SO_ENGINE_ADD_INPUT(input1, defaultVal1); \
SO_ENGINE_ADD_OUTPUT(output, type); \
isBuiltIn = TRUE; \
} \
\
className::~className() \
{ \
} \
\
void \
className::evaluate() \
{ \
int n0 = input0.getNum(); \
int n1 = input1.getNum(); \
float a = alpha.getValue(); \
for (int i=max(n0,n1)-1; i>=0; i--) { \
valType v0 = input0[clamp(i,n0)]; \
valType v1 = input1[clamp(i,n1)]; \
SO_ENGINE_OUTPUT(output, type, set1Value(i, interpVal)); \
} \
}
#define TRUE
Definition SbBasic.h:76

It defines the variables and methods declared in SO_INTERPOLATE_HEADER(). The "interpVal" argument should be an expression that returns the interpolation between local variables "v0" and "v1" of type "valType", based on local variable "a" which is a float.

Definition at line 172 of file SoInterpolate.h.