24 #ifndef COIN_SBBASIC_H 25 #define COIN_SBBASIC_H 29 #include <Inventor/C/basic.h> 31 #include <Inventor/C/errors/debugerror.h> 39 #error You are not compiling C++ - maybe your source file is named <file>.c 61 inline Type SbAbs( Type Val ) {
62 return (Val < 0) ? 0 - Val : Val;
66 inline Type SbMax(
const Type A,
const Type B ) {
67 return (A < B) ? B : A;
71 inline Type SbMin(
const Type A,
const Type B ) {
72 return (A < B) ? A : B;
76 inline Type SbClamp(
const Type Val,
const Type Min,
const Type Max ) {
77 return (Val < Min) ? Min : (Val > Max) ? Max : Val;
81 inline void SbSwap( Type & A, Type & B ) {
82 Type T; T = A; A = B; B = T;
86 inline Type SbSqr(
const Type val) {
92 template <
typename Type>
93 inline void SbDividerChk(
const char * funcname, Type divider) {
95 if (!(divider != static_cast<Type>(0)))
96 cc_debugerror_post(funcname,
"divide by zero error.", divider);
140 #define SUN_CC_4_0_SOTYPE_INIT_BUG 0 142 #if SUN_CC_4_0_SOTYPE_INIT_BUG 143 #define STATIC_SOTYPE_INIT 145 #define STATIC_SOTYPE_INIT = SoType::badType()