38#include <Inventor/SbBasic.h>
39#include <Inventor/SbString.h>
41#include <Inventor/errors/SoDebugError.h>
52 SbVec2f(
const float v[2]) { vec[0] = v[0]; vec[1] = v[1]; }
53 SbVec2f(
float x,
float y) { vec[0] = x; vec[1] = y; }
59 SbVec2f &
setValue(
const float v[2]) { vec[0] = v[0]; vec[1] = v[1];
return *
this; }
66 const float *
getValue(
void)
const {
return vec; }
67 void getValue(
float & x,
float & y)
const { x = vec[0]; y = vec[1]; }
72 float dot(
const SbVec2f & v)
const {
return vec[0] * v[0] + vec[1] * v[1]; }
73 SbBool equals(
const SbVec2f & v,
float tolerance)
const;
74 float length(
void)
const;
75 float sqrLength(
void)
const {
return vec[0] * vec[0] + vec[1] * vec[1]; }
76 void negate(
void) { vec[0] = -vec[0]; vec[1] = -vec[1]; }
77 float normalize(
void);
86 SbBool fromString(
const SbString & str);
88 void print(
FILE * fp)
const;
104 SbDividerChk(
"operator/(SbVec2f,float)", d);
117 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
SbVec2f(const SbVec2i32 &v)
Definition SbVec2f.h:57
SbVec2f(void)
Definition SbVec2f.h:51
SbVec2f & setValue(float x, float y)
Definition SbVec2f.h:60
float sqrLength(void) const
Definition SbVec2f.h:75
void negate(void)
Definition SbVec2f.h:76
const float * getValue(void) const
Definition SbVec2f.h:66
SbVec2f(const SbVec2d &v)
Definition SbVec2f.h:54
void getValue(float &x, float &y) const
Definition SbVec2f.h:67
SbVec2f & setValue(const float v[2])
Definition SbVec2f.h:59
SbVec2f(const SbVec2b &v)
Definition SbVec2f.h:55
SbVec2f(float x, float y)
Definition SbVec2f.h:53
float dot(const SbVec2f &v) const
Definition SbVec2f.h:72
SbVec2f(const SbVec2s &v)
Definition SbVec2f.h:56
SbVec2f(const float v[2])
Definition SbVec2f.h:52
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