1
1
/**************************************************************************\
3
3
* This file is part of the Coin 3D visualization library.
4
* Copyright (C) 1998-2006 by Systems in Motion. All rights reserved.
4
* Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
6
6
* This library is free software; you can redistribute it and/or
7
7
* modify it under the terms of the GNU General Public License
25
25
\class SbVec2f SbLinear.h Inventor/SbLinear.h
26
\brief The SbVec2f class is a 2 dimensional vector with floating point coordinates.
27
\brief The SbVec2f class is a 2 dimensional vector with floating
29
This vector class is used by many other classes in
30
Coin. It provides storage for a vector in 2 dimensions aswell
31
as simple floating point arithmetic operations on this vector.
32
This vector class is used by many other classes in Coin. It provides
33
storage for a vector in 2 dimensions aswell as simple floating point
34
arithmetic operations on this vector.
33
\sa SbVec2s, SbVec3s, SbVec3f, SbVec4f
36
\sa SbVec2d, SbVec3f, SbVec3d, SbVec4f, SbVec4d
39
#include <Inventor/SbVec2f.h>
36
41
#include <assert.h>
37
#include <Inventor/SbVec2f.h>
43
#include <Inventor/SbVec2d.h>
44
#include <Inventor/SbVec2b.h>
45
#include <Inventor/SbVec2s.h>
46
#include <Inventor/SbVec2i32.h>
38
48
#include <Inventor/C/tidbitsp.h> // coin_debug_normalize()
40
50
#include <Inventor/errors/SoDebugError.h>
41
51
#endif // COIN_DEBUG
43
54
// *************************************************************************
87
\fn SbVec2f::SbVec2f(const SbVec2d & v)
89
Constructs an SbVec2f instance with initial values from the vector
96
\fn SbVec2f::SbVec2f(const SbVec2b & v)
98
Constructs an SbVec3f instance with initial values from the vector
105
\fn SbVec2f::SbVec2f(const SbVec2s & v)
107
Constructs an SbVec3f instance with initial values from the vector
114
\fn SbVec2f::SbVec2f(const SbVec2i32 & v)
116
Constructs an SbVec3f instance with initial values from the vector
76
123
Calculates and returns the result of taking the dot product of this
266
Set new value from an SbVec2d instance.
272
SbVec2f::setValue(const SbVec2d & v)
274
vec[0] = static_cast<float>(v[0]);
275
vec[1] = static_cast<float>(v[1]);
280
Sets the value from an SbVec2b instance.
286
SbVec2f::setValue(const SbVec2b & v)
288
vec[0] = static_cast<float>(v[0]);
289
vec[1] = static_cast<float>(v[1]);
294
Sets the value from an SbVec2s instance.
300
SbVec2f::setValue(const SbVec2s & v)
302
vec[0] = static_cast<float>(v[0]);
303
vec[1] = static_cast<float>(v[1]);
308
Sets the value from an SbVec2i32 instance.
314
SbVec2f::setValue(const SbVec2i32 & v)
316
vec[0] = static_cast<float>(v[0]);
317
vec[1] = static_cast<float>(v[1]);
207
323
Index operator. Returns modifiable x or y coordinate.
209
325
\sa getValue() and setValue().