14#ifndef OSG_BOUNDSCHECKING
15#define OSG_BOUNDSCHECKING 1
26inline void clampGEQUAL(T& value,
const T minValue,
const char* valueName)
30 notify(
WARN) <<
"Warning: "<<valueName<<
" of "<<value<<
" is below permitted minimum, clamping to "<<minValue<<
"."<< std::endl;
39inline void clampLEQUAL(T& value,
const T maxValue,
const char* valueName)
43 notify(
WARN) <<
"Warning: "<<valueName<<
" of "<<value<<
" is above permitted maximum, clamping to "<<maxValue<<
"."<< std::endl;
54inline void clampBetweenRange(T& value,
const T minValue,
const T maxValue,
const char* valueName)
58 notify(
WARN) <<
"Warning: "<<valueName<<
" of "<<value<<
" is below permitted minimum, clamping to "<<minValue<<
"."<< std::endl;
64 notify(
WARN) <<
"Warning: "<<valueName<<
" of "<<value<<
" is above permitted maximum, clamping to "<<maxValue<<
"."<< std::endl;
73template <
typename A,
typename T>
76 if (value[i]<minValue)
78 notify(
WARN) <<
"Warning: "<<valueName<<
"["<<i<<
"] of "<<value[i]<<
" is below permitted minimum, clamping to "<<minValue<<
"."<< std::endl;
86template <
typename A,
typename T>
89 if (value[i]>maxValue)
91 notify(
WARN) <<
"Warning: "<<valueName<<
"["<<i<<
"] of "<<value[i]<<
" is above permitted maximum, clamping to "<<maxValue<<
"."<< std::endl;
101template <
typename A,
typename T>
104 if (value[i]<minValue)
106 notify(
WARN) <<
"Warning: "<<valueName<<
"["<<i<<
"] of "<<value[i]<<
" is below permitted minimum, clamping to "<<minValue<<
"."<< std::endl;
110 if (value[i]>maxValue)
112 notify(
WARN) <<
"Warning: "<<valueName<<
"["<<i<<
"] of "<<value[i]<<
" is above permitted maximum, clamping to "<<maxValue<<
"."<< std::endl;
121template <
typename A,
typename T>
124 for(
unsigned int i=first;i<=last;++i)
131template <
typename A,
typename T>
134 for(
unsigned int i=first;i<=last;++i)
144template <
typename A,
typename T>
147 for(
unsigned int i=first;i<=last;++i)
155template <
typename A,
typename T>
164template <
typename A,
typename T>
176template <
typename A,
typename T>
187template <
typename A,
typename T>
196template <
typename A,
typename T>
208template <
typename A,
typename T>
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
void clampArrayElementGEQUAL(A &value, unsigned int i, const T minValue, const char *valueName)
If value[i] is greater than or equal to minValue do nothing - legal value, Otherwise set value[i] to ...
Definition BoundsChecking:74
void clampArray4GEQUAL(A &value, const T minValue, const char *valueName)
For each element of the four-element array value[], if the element is greater than or equal to minVal...
Definition BoundsChecking:188
@ WARN
Definition Notify:33
void clampArray3GEQUAL(A &value, const T minValue, const char *valueName)
For each element of the three-element array value[], if the element is greater than or equal to minVa...
Definition BoundsChecking:156
void clampArrayElementBetweenRange(A &value, unsigned int i, const T minValue, const T maxValue, const char *valueName)
If value[i] is between or equal to minValue and maxValue do nothing - legal value,...
Definition BoundsChecking:102
void clampArrayElementsBetweenRange(A &value, unsigned int first, unsigned int last, const T minValue, const T maxValue, const char *valueName)
For each element of value[] in the range (first,last), if the element is between or equal to minValue...
Definition BoundsChecking:145
void clampArray3BetweenRange(A &value, const T minValue, const T maxValue, const char *valueName)
For each element of the three-element array value[], if the element is between or equal to minValue a...
Definition BoundsChecking:177
void clampArray3LEQUAL(A &value, const T maxValue, const char *valueName)
For each element of the three-element array value[], if the element is less than or equal to maxValue...
Definition BoundsChecking:165
void clampArrayElementsLEQUAL(A &value, unsigned int first, unsigned int last, const T maxValue, const char *valueName)
For each element of value[] in the range (first,last), if the element is less than or equal to maxVal...
Definition BoundsChecking:132
void clampArrayElementsGEQUAL(A &value, unsigned int first, unsigned int last, const T minValue, const char *valueName)
For each element of value[] in the range (first,last), if the element is greater than or equal to min...
Definition BoundsChecking:122
void clampArray4LEQUAL(A &value, const T maxValue, const char *valueName)
For each element of the four-element array value[], if the element is less than or equal to maxValue ...
Definition BoundsChecking:197
void clampBetweenRange(T &value, const T minValue, const T maxValue, const char *valueName)
If value is between or equal to minValue and maxValue do nothing - legal value, Otherwise clamp value...
Definition BoundsChecking:54
void clampArrayElementLEQUAL(A &value, unsigned int i, const T maxValue, const char *valueName)
If value[i] is less than or equal to maxValue do nothing - legal value, Otherwise set value[i] to max...
Definition BoundsChecking:87
std::ostream & notify(void)
Definition Notify:80
void clampGEQUAL(T &value, const T minValue, const char *valueName)
If value is greater than or equal to minValue do nothing - legal value, Otherwise set value to minVal...
Definition BoundsChecking:26
void clampArray4BetweenRange(A &value, const T minValue, const T maxValue, const char *valueName)
For each element of the four-element array value[], if the element is between or equal to minValue an...
Definition BoundsChecking:209
void clampLEQUAL(T &value, const T maxValue, const char *valueName)
If value is less than or equal to maxValue do nothing - legal value, Otherwise set value to maxValue,...
Definition BoundsChecking:39