1
/**************************************************************************\
3
* This file is part of the Coin 3D visualization library.
4
* Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* ("GPL") version 2 as published by the Free Software Foundation.
9
* See the file LICENSE.GPL at the root directory of this source
10
* distribution for additional information about the GNU GPL.
12
* For using Coin with software that can not be combined with the GNU
13
* GPL, and for taking advantage of the additional benefits of our
14
* support services, please contact Systems in Motion about acquiring
15
* a Coin Professional Edition License.
17
* See http://www.coin3d.org/ for more information.
19
* Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
20
* http://www.sim.no/ sales@sim.no coin-support@coin3d.org
22
\**************************************************************************/
24
#include <Inventor/SbVec2ui32.h>
26
#include <Inventor/SbVec2i32.h>
27
#include <Inventor/SbVec2ub.h>
28
#include <Inventor/SbVec2us.h>
31
\class SbVec2ui32 SbVec2ui32.h Inventor/SbVec2ui32.h
33
\brief The SbVec2ub class is a 2 dimensional vector with unsigned
34
32-bit integer coordinates.
38
This vector provides storage for a vector in 2 dimensions as well as
39
simple integer arithmetic operations.
41
\sa SbVec3ui32, SbVec4ui32, SbVec2b, SbVec2ub, SbVec2s, SbVec2us, SbVec2i32
47
Sets this vector to the 32-bit integer precision vector \a v
48
converting the vector to an unsigned 32-bit integer precision vector.
51
SbVec2ui32::setValue(const SbVec2i32 & v)
53
vec[0] = static_cast<uint32_t>(v[0]);
54
vec[1] = static_cast<uint32_t>(v[1]);
59
Sets this vector to the unsigned 8-bit integer precision vector \a v
60
converting the vector to an unsigned 32-bit integer precision vector.
63
SbVec2ui32::setValue(const SbVec2ub & v)
65
vec[0] = static_cast<uint32_t>(v[0]);
66
vec[1] = static_cast<uint32_t>(v[1]);
71
Sets this vector to the unsigned short integer precision vector \a v
72
converting the vector to an unsigned 32-bit integer precision vector.
75
SbVec2ui32::setValue(const SbVec2us & v)
77
vec[0] = static_cast<uint32_t>(v[0]);
78
vec[1] = static_cast<uint32_t>(v[1]);
83
Negate the vector (i.e. point it in the opposite direction)
86
SbVec2ui32::negate(void)
88
vec[0] = static_cast<uint32_t>(0-vec[0]);
89
vec[1] = static_cast<uint32_t>(0-vec[1]);
93
Multiply components of vector with scalar value \a d. Returns
97
SbVec2ui32::operator *= (double d)
99
vec[0] = static_cast<uint32_t>(vec[0] * d);
100
vec[1] = static_cast<uint32_t>(vec[1] * d);
105
\fn SbVec2ui32::SbVec2ui32(void)
107
The default constructor does nothing. The vector coordinates will be
108
uninitialized until you do a setValue().
112
\fn SbVec2ui32::SbVec2ui32(const uint32_t v[2])
114
Constructs an SbVec2ui32 instance with initial values from \a v.
118
\fn SbVec2ui32::SbVec2ui32(uint32_t x, uint32_t y)
120
Constructs an SbVec2ui32 instance with the initial vector endpoint set
125
\fn explicit SbVec2ui32::SbVec2ui32(const SbVec2i32 & v)
127
Constructs an SbVec2ui32 instance with initial values from the
128
32-bit integer precision vector \a v.
132
\fn explicit SbVec2ui32::SbVec2ui32(const SbVec2ub & v)
134
Constructs an SbVec2ui32 instance with initial values from the
135
unsigned 8-bit vector \a v.
139
\fn explicit SbVec2ui32::SbVec2ui32(const SbVec2us & v)
141
Constructs an SbVec2ui32 instance with initial values from the
142
unsigned short integer precision vector \a v.
146
\fn SbVec2ui32 & SbVec2ui32::setValue(const uint32_t v[2])
148
Set new coordinates for the vector from \a v. Returns reference to
155
\fn SbVec2ui32 & SbVec2ui32::setValue(uint32_t x, uint32_t y)
157
Set new coordinates for the vector. Returns reference to self.
163
\fn const uint32_t * SbVec2ui32::getValue(void) const
165
Returns a pointer to an array of two unsigned 32-bit integers
166
containing the x and y coordinates of the vector.
172
\fn void SbVec2ui32::getValue(uint32_t & x, uint32_t & y) const
174
Returns the x and y coordinates of the vector.
180
\fn uint32_t & SbVec2ui32::operator [] (int i)
182
Index operator. Returns modifiable x or y coordinate of the vector.
184
\sa getValue() and setValue()
188
\fn const uint32_t & SbVec2ui32::operator [] (int i) const
190
Index operator. Returns non-modifiable x or y coordinate of the
193
\sa getValue() and setValue()
197
\fn int32_t SbVec2ui32::dot(const SbVec2ui32 & v) const
199
Calculates and returns the result of taking the dot product of this
204
\fn SbVec2ui32 & SbVec2ui32::operator *= (int d)
206
Multiply components of vector with scalar value \a d. Returns
211
\fn SbVec2ui32 & SbVec2ui32::operator /= (int d)
213
Divides components of vector with scalar value \a d. Returns
218
\fn SbVec2ui32 & SbVec2ui32::operator /= (double d)
220
Divides components of vector with double precision floating point
221
value \a d. Returns reference to self.
225
\fn SbVec2ui32 & SbVec2ui32::operator += (const SbVec2ui32 & v)
227
Adds this vector and vector \a u. Returns reference to self.
231
\fn SbVec2ui32 & SbVec2ui32::operator -= (const SbVec2ui32 & v)
233
Subtracts vector \a u from this vector. Returns reference to self.
237
\fn SbVec2ui32 SbVec2ui32::operator - (void) const
239
Non-destructive negation operator. Returns a new SbVec3f instance
240
which points in the opposite direction of this vector.