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
00048 class SoArithmetic
00049 {
00050 private:
00051 virtual ~SoArithmetic();
00052
00054 static void initClass();
00055
00057 static void exitClass();
00058
00059 public:
00061 SoArithmetic();
00062
00072 virtual int add( SoBufferObject* inputBufferA, const SbDataType typeA,
00073 SoBufferObject* inputBufferB, const SbDataType typeB,
00074 SoBufferObject* outputBufferC, const SbDataType typeC );
00080 int add(
00081 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00082 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
00083 SoCpuBufferObject* outputBufferC, const SbDataType typeC
00084 );
00085
00086
00095 virtual int mult(
00096 SoBufferObject* inputBufferA, const SbDataType typeA,
00097 SoBufferObject* inputBufferB, const SbDataType typeB,
00098 SoBufferObject* outputBufferC, const SbDataType typeC
00099 );
00100
00106 int mult(
00107 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00108 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
00109 SoCpuBufferObject* outputBufferC, const SbDataType typeC
00110 );
00111
00119 virtual int scale(
00120 SoBufferObject* inputBufferA, const SbDataType typeA,
00121 SoBufferObject* outputBufferB, const SbDataType typeB,
00122 const float scaleValue
00123 );
00124
00130 int scale(
00131 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00132 SoCpuBufferObject* outputBufferB, const SbDataType typeB,
00133 const float scaleValue
00134 );
00135
00143 virtual int shift(
00144 SoBufferObject* inputBufferA, const SbDataType typeA,
00145 SoBufferObject* outputBufferB, const SbDataType typeB,
00146 const float shiftFactor
00147 );
00148
00154 int shift(
00155 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00156 SoCpuBufferObject* outputBufferB, const SbDataType typeB,
00157 const float shiftFactor
00158 );
00159
00167 virtual int madd(
00168 SoBufferObject* inputBufferA, const SbDataType typeA,
00169 SoBufferObject* inputBufferB, const SbDataType typeB,
00170 SoBufferObject* outputBufferC, const SbDataType typeC,
00171 const float scaleValue
00172 );
00173
00179 int madd(
00180 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
00181 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
00182 SoCpuBufferObject* outputBufferC, const SbDataType typeC,
00183 const float scaleValue
00184 );
00185
00194 virtual void computeMinMax(
00195 SoBufferObject* inputBuffer, const SbDataType dataType,
00196 double& min, double& max
00197 );
00198
00215 virtual void computeMinMax(
00216 SoBufferObject* inputBuffer, const SbDataType dataType,
00217 const SbVec3i32& arrayDim, const SbBox3i32& range,
00218 double& min, double& max
00219 );
00220
00226 void computeMinMax(
00227 SoCpuBufferObject* inputBuffer, const SbDataType dataType,
00228 const SbVec3i32& arrayDim, const SbBox3i32& range,
00229 double& min, double& max
00230 );
00231
00242 virtual void computeMinMaxWithUndefinedValue(
00243 SoBufferObject* inputBuffer, const SbDataType dataType, const double undefinedValue,
00244 double& min, double& max
00245 );
00246
00265 virtual void computeMinMaxWithUndefinedValue(
00266 SoBufferObject* inputBuffer, const SbDataType dataType,
00267 const SbVec3i32& arrayDim, const SbBox3i32& range, const double undefinedValue,
00268 double& min, double& max
00269 );
00270
00277 void computeMinMaxWithUndefinedValue(
00278 SoCpuBufferObject* inputBuffer, const SbDataType dataType,
00279 const SbVec3i32& arrayDim, const SbBox3i32& range, const double undefinedValue,
00280 double& min, double& max
00281 );
00282
00283 private:
00284 template<typename T>
00285 void computeMinMaxTemplate(
00286 SoCpuBufferObject* inputBuffer,
00287 const SbVec3i32& arrayDim,
00288 const SbBox3i32& range,
00289 double& min, double& max);
00290
00291 template<typename T>
00292 void computeMinMaxWithUndefinedValueTemplate(
00293 SoCpuBufferObject* inputBuffer,
00294 const SbVec3i32& arrayDim,
00295 const SbBox3i32& range,
00296 const double undefinedValue,
00297 double& min, double& max);
00298
00299 };
00300
00301 #endif // SOARITHMETIC_H
00302
00303