38#include <Inventor/SbBasic.h>
39#include <Inventor/system/inttypes.h>
40#include <Inventor/SbString.h>
42#include <Inventor/errors/SoDebugError.h>
54 SbVec2s(
const short v[2]) { vec[0] = v[0]; vec[1] = v[1]; }
55 SbVec2s(
short x,
short y) { vec[0] = x; vec[1] = y; }
62 SbVec2s &
setValue(
const short v[2]) { vec[0] = v[0]; vec[1] = v[1];
return *
this; }
70 const short *
getValue(
void)
const {
return vec; }
71 void getValue(
short & x,
short & y)
const { x = vec[0]; y = vec[1]; }
76 int32_t
dot(
SbVec2s v)
const {
return vec[0] * v[0] + vec[1] * v[1]; }
77 void negate(
void) { vec[0] = -vec[0]; vec[1] = -vec[1]; }
79 SbVec2s &
operator *= (
int d) { vec[0] = short(vec[0] * d); vec[1] = short(vec[1] * d);
return *
this; }
81 SbVec2s &
operator /= (
int d) { SbDividerChk(
"SbVec2s::operator/=(int)", d); vec[0] = short(vec[0] / d); vec[1] = short(vec[1] / d);
return *
this; }
88 SbBool fromString(
const SbString & str);
90 void print(
FILE * fp)
const;
114 SbDividerChk(
"operator/(SbVec2s,int)", d);
119 SbDividerChk(
"operator/(SbVec2s,double)", d);
132 return ((
v1[0] ==
v2[0]) && (
v1[1] ==
v2[1]));
The SbList class is a template container class for lists.
Definition SbList.h:70
SbList(const int sizehint=DEFAULTSIZE)
Definition SbList.h:78
Type operator[](const int index) const
Definition SbList.h:195
The SbString class is a string class with convenience functions for string operations.
Definition SbString.h:52
a vector class for containing two byte integers.
Definition SbVec2b.h:48
The SbVec2d class is a 2 dimensional vector with double precision floating point coordinates.
Definition SbVec2d.h:48
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:49
The SbVec2i32 class is a 2 dimensional vector with 32-bit signed integer coordinates.
Definition SbVec2i32.h:50
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:51
SbVec2s(short x, short y)
Definition SbVec2s.h:55
SbVec2s(const SbVec2b &v)
Definition SbVec2s.h:57
const short * getValue(void) const
Definition SbVec2s.h:70
void getValue(short &x, short &y) const
Definition SbVec2s.h:71
SbVec2s(const SbVec2i32 &v)
Definition SbVec2s.h:58
SbVec2s & setValue(const short v[2])
Definition SbVec2s.h:62
SbVec2s & setValue(short x, short y)
Definition SbVec2s.h:63
SbVec2s(const short v[2])
Definition SbVec2s.h:54
SbVec2s(const SbVec2f &v)
Definition SbVec2s.h:59
SbVec2s(void)
Definition SbVec2s.h:53
SbVec2s(const SbVec2d &v)
Definition SbVec2s.h:60
void negate(void)
Definition SbVec2s.h:77
int32_t dot(SbVec2s v) const
Definition SbVec2s.h:76
SbVec2s(const SbVec2us &v)
Definition SbVec2s.h:56