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
\**************************************************************************/
25
\class SoMFVec4ui32 SoMFVec4ui32.h Inventor/fields/SoMFVec4ui32.h
26
\brief The SoMFVec4ui32 class is a container for SbVec4ui32 vectors.
29
This field is used where nodes, engines or other field containers
30
needs to store an array of vectors with four elements.
32
This field supports application data sharing through a
33
setValuesPointer() method. See SoMField documentation for
34
information on how to use this function.
36
\sa SbVec4ui32, SoSFVec4ui32
40
// *************************************************************************
42
#include <Inventor/fields/SoMFVec4ui32.h>
45
#include <Inventor/fields/SoSubFieldP.h>
46
#include <Inventor/SoInput.h>
47
#include <Inventor/errors/SoDebugError.h>
51
// *************************************************************************
53
SO_MFIELD_SOURCE(SoMFVec4ui32, SbVec4ui32, const SbVec4ui32 &);
55
SO_MFIELD_SETVALUESPOINTER_SOURCE(SoMFVec4ui32, SbVec4ui32, SbVec4ui32);
56
SO_MFIELD_SETVALUESPOINTER_SOURCE(SoMFVec4ui32, SbVec4ui32, uint32_t);
58
// *************************************************************************
60
// Override from parent class.
62
SoMFVec4ui32::initClass(void)
64
SO_MFIELD_INTERNAL_INIT_CLASS(SoMFVec4ui32);
67
// *************************************************************************
69
// No need to document readValue() and writeValue() here, as the
70
// necessary information is provided by the documentation of the
72
#ifndef DOXYGEN_SKIP_THIS
75
SoMFVec4ui32::read1Value(SoInput * in, int idx)
77
assert(idx < this->maxNum);
79
in->read(this->values[idx][0]) &&
80
in->read(this->values[idx][1]) &&
81
in->read(this->values[idx][2]) &&
82
in->read(this->values[idx][3]);
86
SoMFVec4ui32::write1Value(SoOutput * out, int idx) const
88
sosfvec4ui32_write_value(out, (*this)[idx]);
91
#endif // DOXYGEN_SKIP_THIS
93
// *************************************************************************
96
Set \a num vector array elements from \a xyzw, starting at index
100
SoMFVec4ui32::setValues(int start, int numarg, const uint32_t xyzw[][4])
102
if(start+numarg > this->maxNum) this->allocValues(start+numarg);
103
else if(start+numarg > this->num) this->num = start+numarg;
105
for(int i=0; i < numarg; i++) this->values[i+start].setValue(xyzw[i]);
106
this->valueChanged();
110
Set the vector at \a idx.
113
SoMFVec4ui32::set1Value(int idx, uint32_t x, uint32_t y, uint32_t z, uint32_t w)
115
this->set1Value(idx, SbVec4ui32(x, y, z, w));
119
Set the vector at \a idx.
122
SoMFVec4ui32::set1Value(int idx, const uint32_t xyzw[4])
124
this->set1Value(idx, SbVec4ui32(xyzw));
128
Set this field to contain a single vector with the given
132
SoMFVec4ui32::setValue(uint32_t x, uint32_t y, uint32_t z, uint32_t w)
134
this->setValue(SbVec4ui32(x,y,z,w));
138
Set this field to contain a single vector with the given
142
SoMFVec4ui32::setValue(const uint32_t xyzw[4])
144
if (xyzw == NULL) this->setNum(0);
145
else this->setValue(SbVec4ui32(xyzw));
148
// *************************************************************************