1 #ifndef COIN_SBVEC2I32_H 2 #define COIN_SBVEC2I32_H 27 #include <Inventor/SbBasic.h> 28 #include <Inventor/system/inttypes.h> 30 #include <Inventor/errors/SoDebugError.h> 42 SbVec2i32(
const int32_t v[2]) { vec[0] = v[0]; vec[1] = v[1]; }
43 SbVec2i32(int32_t x, int32_t y) { vec[0] = x; vec[1] = y; }
58 const int32_t *
getValue(
void)
const {
return vec; }
59 void getValue(int32_t & x, int32_t & y)
const { x = vec[0]; y = vec[1]; }
61 int32_t & operator [] (
int i) {
return vec[i]; }
62 const int32_t & operator [] (
int i)
const {
return vec[i]; }
64 int32_t
dot(
const SbVec2i32 & v)
const {
return vec[0] * v[0] + vec[1] * v[1]; }
65 void negate(
void) { vec[0] = -vec[0]; vec[1] = -vec[1]; }
67 SbVec2i32 & operator *= (
int d) { vec[0] *= d; vec[1] *= d;
return *
this; }
69 SbVec2i32 & operator /= (
int d) { SbDividerChk(
"SbVec2i32::operator/=(int)", d); vec[0] /= d; vec[1] /= d;
return *
this; }
70 SbVec2i32 & operator /= (
double d) { SbDividerChk(
"SbVec2i32::operator/=(double)", d);
return operator *= (1.0 / d); }
97 SbDividerChk(
"operator/(SbVec2i32,int)", d);
102 SbDividerChk(
"operator/(SbVec2i32,double)", d);
115 return ((v1[0] == v2[0]) && (v1[1] == v2[1]));
122 #endif // !COIN_SBVEC2I32_H The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
SbVec2i32(const SbVec2ui32 &v)
Definition: SbVec2i32.h:44
SbVec2i32(const SbVec2b &v)
Definition: SbVec2i32.h:46
SbVec2i32(const SbVec2s &v)
Definition: SbVec2i32.h:45
The SbVec2b class is a 2 dimensional vector with 8-bit integer coordinates.
Definition: SbVec2b.h:37
int32_t dot(const SbVec2i32 &v) const
Definition: SbVec2i32.h:64
void getValue(int32_t &x, int32_t &y) const
Definition: SbVec2i32.h:59
void negate(void)
Definition: SbVec2i32.h:65
The SbVec2ub class is a 2 dimensional vector with unsigned 32-bit integer coordinates.
Definition: SbVec2ui32.h:37
SbVec2i32(const SbVec2f &v)
Definition: SbVec2i32.h:47
SbVec2i32(int32_t x, int32_t y)
Definition: SbVec2i32.h:43
The SbVec2d class is a 2 dimensional vector with double precision floating point coordinates.
Definition: SbVec2d.h:36
The SbVec2i32 class is a 2 dimensional vector with 32-bit integer coordinates.
Definition: SbVec2i32.h:39
SbVec2i32(const int32_t v[2])
Definition: SbVec2i32.h:42
const int32_t * getValue(void) const
Definition: SbVec2i32.h:58
SbVec2i32(const SbVec2d &v)
Definition: SbVec2i32.h:48
SbVec2i32 & setValue(const int32_t v[2])
Definition: SbVec2i32.h:50
SbVec2i32 & setValue(int32_t x, int32_t y)
Definition: SbVec2i32.h:51
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:37
SbVec2i32(void)
Definition: SbVec2i32.h:41