00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined SOARITHMETIC_H
00024 #define SOARITHMETIC_H
00025
00026 #include <Inventor/SbDataType.h>
00027 #include <Inventor/SbLinear.h>
00028
00029 #include <Inventor/algorithms/SoAlgorithmsDefs.h>
00030
00031 class SoBufferObject;
00032 class SoCpuBufferObject;
00033
00049 class SoArithmetic
00050 {
00051 private:
00052 virtual ~SoArithmetic();
00053
00055 static void initClass();
00056
00058 static void exitClass();
00059
00060 public:
00062 SoArithmetic();
00063
00073 virtual int add( SoBufferObject* inputBufferA, const SbDataType typeA,
00074 SoBufferObject* inputBufferB, const SbDataType typeB,
00075 SoBufferObject* outputBufferC, const SbDataType typeC );
00081 int add(
00082 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00083 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
00084 SoCpuBufferObject* outputBufferC, const SbDataType typeC
00085 );
00086
00087
00096 virtual int mult(
00097 SoBufferObject* inputBufferA, const SbDataType typeA,
00098 SoBufferObject* inputBufferB, const SbDataType typeB,
00099 SoBufferObject* outputBufferC, const SbDataType typeC
00100 );
00101
00107 int mult(
00108 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00109 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
00110 SoCpuBufferObject* outputBufferC, const SbDataType typeC
00111 );
00112
00120 virtual int scale(
00121 SoBufferObject* inputBufferA, const SbDataType typeA,
00122 SoBufferObject* outputBufferB, const SbDataType typeB,
00123 const float scaleValue
00124 );
00125
00131 int scale(
00132 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00133 SoCpuBufferObject* outputBufferB, const SbDataType typeB,
00134 const float scaleValue
00135 );
00136
00144 virtual int shift(
00145 SoBufferObject* inputBufferA, const SbDataType typeA,
00146 SoBufferObject* outputBufferB, const SbDataType typeB,
00147 const float shiftFactor
00148 );
00149
00155 int shift(
00156 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00157 SoCpuBufferObject* outputBufferB, const SbDataType typeB,
00158 const float shiftFactor
00159 );
00160
00168 virtual int madd(
00169 SoBufferObject* inputBufferA, const SbDataType typeA,
00170 SoBufferObject* inputBufferB, const SbDataType typeB,
00171 SoBufferObject* outputBufferC, const SbDataType typeC,
00172 const float scaleValue
00173 );
00174
00180 int madd(
00181 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00182 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
00183 SoCpuBufferObject* outputBufferC, const SbDataType typeC,
00184 const float scaleValue
00185 );
00186
00195 virtual void computeMinMax(
00196 SoBufferObject* inputBuffer, const SbDataType dataType,
00197 double& min, double& max
00198 );
00199
00216 virtual void computeMinMax(
00217 SoBufferObject* inputBuffer, const SbDataType dataType,
00218 const SbVec3i32& arrayDim, const SbBox3i32& range,
00219 double& min, double& max
00220 );
00221
00227 void computeMinMax(
00228 SoCpuBufferObject* inputBuffer, const SbDataType dataType,
00229 const SbVec3i32& arrayDim, const SbBox3i32& range,
00230 double& min, double& max
00231 );
00232
00243 virtual void computeMinMaxWithUndefinedValue(
00244 SoBufferObject* inputBuffer, const SbDataType dataType, const double undefinedValue,
00245 double& min, double& max
00246 );
00247
00266 virtual void computeMinMaxWithUndefinedValue(
00267 SoBufferObject* inputBuffer, const SbDataType dataType,
00268 const SbVec3i32& arrayDim, const SbBox3i32& range, const double undefinedValue,
00269 double& min, double& max
00270 );
00271
00278 void computeMinMaxWithUndefinedValue(
00279 SoCpuBufferObject* inputBuffer, const SbDataType dataType,
00280 const SbVec3i32& arrayDim, const SbBox3i32& range, const double undefinedValue,
00281 double& min, double& max
00282 );
00283
00284 private:
00285 template<typename T>
00286 void computeMinMaxTemplate(
00287 SoCpuBufferObject* inputBuffer,
00288 const SbVec3i32& arrayDim,
00289 const SbBox3i32& range,
00290 double& min, double& max);
00291
00292 template<typename T>
00293 void computeMinMaxWithUndefinedValueTemplate(
00294 SoCpuBufferObject* inputBuffer,
00295 const SbVec3i32& arrayDim,
00296 const SbBox3i32& range,
00297 const double undefinedValue,
00298 double& min, double& max);
00299
00300 };
00301
00302 #endif // SOARITHMETIC_H
00303
00304