Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoArithmetic.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#if !defined SOARITHMETIC_H
24#define SOARITHMETIC_H
25
26#include <Inventor/SbDataType.h>
27#include <Inventor/SbLinear.h>
28
29#include <Inventor/algorithms/SoAlgorithmsDefs.h>
30
31class SoBufferObject;
33
49{
50private:
51 virtual ~SoArithmetic();
52
54 static void initClass();
55
57 static void exitClass();
58
59public:
62
72 virtual int add( SoBufferObject* inputBufferA, const SbDataType typeA,
73 SoBufferObject* inputBufferB, const SbDataType typeB,
74 SoBufferObject* outputBufferC, const SbDataType typeC );
80 int add(
81 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
82 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
83 SoCpuBufferObject* outputBufferC, const SbDataType typeC
84 );
85
86
95 virtual int mult(
96 SoBufferObject* inputBufferA, const SbDataType typeA,
97 SoBufferObject* inputBufferB, const SbDataType typeB,
98 SoBufferObject* outputBufferC, const SbDataType typeC
99 );
100
106 int mult(
107 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
108 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
109 SoCpuBufferObject* outputBufferC, const SbDataType typeC
110 );
111
119 virtual int scale(
120 SoBufferObject* inputBufferA, const SbDataType typeA,
121 SoBufferObject* outputBufferB, const SbDataType typeB,
122 const float scaleValue
123 );
124
130 int scale(
131 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
132 SoCpuBufferObject* outputBufferB, const SbDataType typeB,
133 const float scaleValue
134 );
135
143 virtual int shift(
144 SoBufferObject* inputBufferA, const SbDataType typeA,
145 SoBufferObject* outputBufferB, const SbDataType typeB,
146 const float shiftFactor
147 );
148
154 int shift(
155 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
156 SoCpuBufferObject* outputBufferB, const SbDataType typeB,
157 const float shiftFactor
158 );
159
167 virtual int madd(
168 SoBufferObject* inputBufferA, const SbDataType typeA,
169 SoBufferObject* inputBufferB, const SbDataType typeB,
170 SoBufferObject* outputBufferC, const SbDataType typeC,
171 const float scaleValue
172 );
173
179 int madd(
180 SoCpuBufferObject* inputBufferA, const SbDataType typeA,
181 SoCpuBufferObject* inputBufferB, const SbDataType typeB,
182 SoCpuBufferObject* outputBufferC, const SbDataType typeC,
183 const float scaleValue
184 );
185
194 virtual void computeMinMax(
195 SoBufferObject* inputBuffer, const SbDataType dataType,
196 double& min, double& max
197 );
198
215 virtual void computeMinMax(
216 SoBufferObject* inputBuffer, const SbDataType dataType,
217 const SbVec3i32& arrayDim, const SbBox3i32& range,
218 double& min, double& max
219 );
220
227 SoCpuBufferObject* inputBuffer, const SbDataType dataType,
228 const SbVec3i32& arrayDim, const SbBox3i32& range,
229 double& min, double& max
230 );
231
243 SoBufferObject* inputBuffer, const SbDataType dataType, const double undefinedValue,
244 double& min, double& max
245 );
246
266 SoBufferObject* inputBuffer, const SbDataType dataType,
267 const SbVec3i32& arrayDim, const SbBox3i32& range, const double undefinedValue,
268 double& min, double& max
269 );
270
278 SoCpuBufferObject* inputBuffer, const SbDataType dataType,
279 const SbVec3i32& arrayDim, const SbBox3i32& range, const double undefinedValue,
280 double& min, double& max
281 );
282
283private:
284 template<typename T>
285 void computeMinMaxTemplate(
286 SoCpuBufferObject* inputBuffer,
287 const SbVec3i32& arrayDim,
288 const SbBox3i32& range,
289 double& min, double& max);
290
291 template<typename T>
292 void computeMinMaxWithUndefinedValueTemplate(
293 SoCpuBufferObject* inputBuffer,
294 const SbVec3i32& arrayDim,
295 const SbBox3i32& range,
296 const double undefinedValue,
297 double& min, double& max);
298
299};
300
301#endif // SOARITHMETIC_H
302
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Definition SbBox.h:96
Class encoding a data type.
Definition SbDataType.h:58
3D vector class.
Definition SbVec.h:1517
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Arithmetic funct...
SoArithmetic()
Constructor.
int scale(SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *outputBufferB, const SbDataType typeB, const float scaleValue)
B = A * scaleFactor Fast version for Cpu buffers.
virtual int madd(SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC, const float scaleValue)
C = A * scale + B Note: C can be a reference to A or B Limitation: typeA and typeB must be the ...
virtual int shift(SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *outputBufferB, const SbDataType typeB, const float shiftFactor)
B = A + shiftFactor Note: B can be a reference to A Limitation: typeA must be the same as typeC...
virtual void computeMinMaxWithUndefinedValue(SoBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, const double undefinedValue, double &min, double &max)
Compute min max of values contained in the specified range of the buffer that are not equal to the sp...
void computeMinMax(SoCpuBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, double &min, double &max)
Compute min max of values contained in the specified range of the buffer.
int mult(SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC)
Multiply two buffers into a third one.
virtual void computeMinMaxWithUndefinedValue(SoBufferObject *inputBuffer, const SbDataType dataType, const double undefinedValue, double &min, double &max)
Compute min max of all values contained in a buffer that are not equal to the specified undefined val...
void computeMinMaxWithUndefinedValue(SoCpuBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, const double undefinedValue, double &min, double &max)
Compute min max of values contained in the specified range of the buffer that are not equal to the sp...
virtual int scale(SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *outputBufferB, const SbDataType typeB, const float scaleValue)
B = A * scaleFactor Note: B can be a reference to A Limitation: typeA must be the same as typeC...
int shift(SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *outputBufferB, const SbDataType typeB, const float shiftFactor)
B = A + shiftFactor Fast version for Cpu buffers.
virtual void computeMinMax(SoBufferObject *inputBuffer, const SbDataType dataType, double &min, double &max)
Compute min max of all values contained in a buffer.
virtual int add(SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC)
Add two buffers into a third one.
virtual void computeMinMax(SoBufferObject *inputBuffer, const SbDataType dataType, const SbVec3i32 &arrayDim, const SbBox3i32 &range, double &min, double &max)
Compute min max of values contained in the specified range of the buffer.
virtual int mult(SoBufferObject *inputBufferA, const SbDataType typeA, SoBufferObject *inputBufferB, const SbDataType typeB, SoBufferObject *outputBufferC, const SbDataType typeC)
Multiply two buffers into a third one.
int add(SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC)
Add two buffers into a third one.
int madd(SoCpuBufferObject *inputBufferA, const SbDataType typeA, SoCpuBufferObject *inputBufferB, const SbDataType typeB, SoCpuBufferObject *outputBufferC, const SbDataType typeC, const float scaleValue)
C = A * scale + B Fast version for Cpu buffers.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> CPU buffer objec...