1 #ifndef COIN_SBVEC2I32_H
2 #define COIN_SBVEC2I32_H
29 #include <Inventor/SbBasic.h>
30 #include <Inventor/system/inttypes.h>
32 #include <Inventor/errors/SoDebugError.h>
44 SbVec2i32(
const int32_t v[2]) { vec[0] = v[0]; vec[1] = v[1]; }
45 SbVec2i32(int32_t x, int32_t y) { vec[0] = x; vec[1] = y; }
60 const int32_t *
getValue(
void)
const {
return vec; }
61 void getValue(int32_t & x, int32_t & y)
const { x = vec[0]; y = vec[1]; }
63 int32_t & operator [] (
const int i) {
return vec[i]; }
64 const int32_t & operator [] (
const int i)
const {
return vec[i]; }
66 int32_t
dot(
const SbVec2i32 & v)
const {
return vec[0] * v[0] + vec[1] * v[1]; }
67 void negate(
void) { vec[0] = -vec[0]; vec[1] = -vec[1]; }
69 SbVec2i32 & operator *= (
int d) { vec[0] *= d; vec[1] *= d;
return *
this; }
71 SbVec2i32 & operator /= (
int d) { SbDividerChk(
"SbVec2i32::operator/=(int)", d); vec[0] /= d; vec[1] /= d;
return *
this; }
72 SbVec2i32 & operator /= (
double d) { SbDividerChk(
"SbVec2i32::operator/=(double)", d);
return operator *= (1.0 / d); }
77 void print(FILE * fp)
const;
101 SbDividerChk(
"operator/(SbVec2i32,int)", d);
106 SbDividerChk(
"operator/(SbVec2i32,double)", d);
119 return ((v1[0] == v2[0]) && (v1[1] == v2[1]));
126 #endif // !COIN_SBVEC2I32_H