Debian Codegraph @

doc/man/man3/ivm/fields/SoMFEnum.ivm

raw
1 NAME SoMFEnum SoMEnum "" {
2 multiple-value field containing any number of enumerated type values
3 }
4 DESC {
5 A multiple-value field that contains any number of enumerated type
6 values, stored as ints. Nodes that use this field class define
7 mnemonic names for values. These names should be used when setting or
8 testing the values of the field, even though the values are treated as
9 integers in the methods.
10 \p
11 \cSoMFEnums\. are written to file as a set of
12 mnemonic enumerated type names. These names differ among uses of this
13 field in various node classes. See the reference pages for specific nodes
14 for the names.
15 \p
16 When more than one value is present, all of the values are enclosed in
17 square brackets and separated by commas.
18 }
19
20 METHOD setStr void setValue(const SbName &name) {
21 Sets this field to contain one and only one value, which is the
22 mnemonic name as a string.
23 }
24 METHOD set1Str void set1Value(int index, const SbName &name) {
25 Sets the \aindex\.'th value to be the integer corresponding to the
26 mnemonic name in the given string.
27 }
28 METHOD "" static SoType getClassTypeId() {}
29 METHOD "" virtual void getTypeId() const {
30 Returns the type for this class or a particular object of this class.
31 }
32 METHOD Get int operator [\|](int i) const {
33 Returns the \ai\.'th value of the field. Indexing past the end of the
34 field (passing in \ai\. greater than \mgetNum()\.) will return garbage.
35 }
36 METHOD GetN const int * getValues(int start) const {
37 Returns a pointer into the array of values in the field, starting at
38 index \astart\.. The values are read-only; see the
39 \mstartEditing()\./\mfinishEditing()\. methods for a way of modifying values
40 in place.
41 }
42 METHOD "" int find(int targetValue,
43 SbBool addIfNotFound = FALSE) {
44 Finds the given value in the array and returns the index of that value
45 in the array. If the value is not found, -1 is returned. If
46 \aaddIfNotFound\. is set, then \atargetValue\. is added to the end of the
47 array (but -1 is still returned).
48 }
49 METHOD SetN void setValues(int start, int num,
50 const int *newValues) {
51 Sets \anum\. values starting at index \astart\. to the values in \anewValues\..
52 The array will be automatically be made larger to accomodate the new
53 values, if necessary.
54 }
55 METHOD Set1 void set1Value(int index, int newValue) {
56 Sets the \aindex\.'th value in the array to \anewValue\.. The array will be
57 automatically expanded, if necessary.
58 }
59 METHOD " " int operator =(int newValue) {}
60 METHOD Set void setValue(int newValue) {
61 Sets the first value in the array to \anewValue\., and deletes the second
62 and subsequent values.
63 }
64 METHOD IsEq int operator ==(const SoMFEnum &f) const {}
65 METHOD IsNEq int operator !=(const SoMFEnum &f) const {
66 Returns TRUE if all of the values of this field equal (do not
67 equal) those of the given field. If the fields are different types FALSE will
68 always be returned (even if one field is an \cSoMFFloat\. with one
69 value of 1.0 and the other is an \cSoMFInt\. with a value of 1, for
70 example).
71 }
72 METHOD StartEdit int *startEditing() {}
73 METHOD FinishEdit void finishEditing() {
74 \mstartEditing()\. returns a pointer to the internally-maintained array
75 that can be modified. The values in the array may be changed, but values
76 cannot be added or removed. It is illegal to call any other editing
77 methods between
78 \+\mstartEditing()\. and \mfinishEditing()\. (e.g.
79 set1Value(), setValue(), etc).\.\-\mStartEdit()\. and \mFinishEdit()\.
80 (e.g. \mSet1()\., \mSet()\., etc).\.
81 \p
82 Fields, engines or sensors connected to this field and sensors are not
83 notified that this field has changed until
84 \+\mfinishEditing()\.\.\-\mFinishEdit()\.\. is called. Calling
85 \+\mfinishEditing()\.\.\-\mFinishEdit()\.\. always sets the
86 \+\misDefault()\.\.\-\mIsDflt\.\. flag to FALSE and informs
87 engines and sensors that the field changed, even if none of the values
88 actually were changed.
89 }