1SoMFName(3IV)() SoMFName(3IV)()
2
3
4
6 SoMFName — multiple-value field containing any number of names
7
9 SoField > SoMField > SoMFName
10
12 #include <Inventor/fields/SoMFName.h>
13
14 Methods from class SoMFName:
15
16 void setValues(int start, int num, const char *strings[])
17 void setValue(const char *string)
18 static SoType getClassTypeId()
19 virtual void getTypeId() const
20 const SbName & operator [](int i) const
21 const SbName * getValues(int start) const
22 int find(const SbName & targetValue, SbBool addIfNotFound
23 = FALSE)
24 void setValues(int start, int num, const SbName *newVal‐
25 ues)
26 void set1Value(int index, const SbName & newValue)
27 const SbName & operator=(const SbName & newValue)
28 void setValue(const SbName & newValue)
29 int operator ==(const SoMFName &f) const
30 int operator !=(const SoMFName &f) const
31 SbName * startEditing()
32 void finishEditing()
33
34 Methods from class SoMField:
35
36 int getNum() const
37 void setNum(int num)
38 virtual void deleteValues(int start, int num = -1)
39 virtual void insertSpace(int start, int num)
40 SbBool set1(int index, const char *valueString)
41 void get1(int index, SbString &valueString)
42
43 Methods from class SoField:
44
45 void setIgnored(SbBool ignore)
46 SbBool isIgnored() const
47 SbBool isDefault() const
48 virtual SbBool isOfType(SoType type) const
49 SbBool set(const char *valueString)
50 void get(SbString &valueString)
51 void touch()
52 SbBool connectFrom(SoField *fromField)
53 SbBool connectFrom(SoEngineOutput *fromEngine)
54 void disconnect()
55 SbBool isConnected() const
56 SbBool isConnectedFromField() const
57 SbBool getConnectedField(SoField *&writingField) const
58 SbBool isConnectedFromEngine() const
59 SbBool getConnectedEngine(SoEngineOutput *&engineOutput)
60 const
61 void enableConnection(SbBool flag)
62 SbBool isConnectionEnabled() const
63 int getForwardConnections(SoFieldList &list) const
64 SoFieldContainer * getContainer() const
65
66
68 A multiple-valued field containing any number of names. Names are short
69 series of characters generally used for labels or names, and are stored
70 in a special table designed to allow fast lookup and comparison. For
71 most purposes, an SoMFString field is probably more appropriate.
72
73 SoMFNames are written to file as one or more strings of characters.
74 Names must begin with an underscore or alphabetic character, and must
75 consist entirely of underscores, alphabetic characters, or numbers.
76 When more than one value is present, all of the values are enclosed in
77 square brackets and separated by commas; for example:
78
79 [ Fred, Wilma, _Part_01, translationField ]
80
81
82
84 void setValues(int start, int num, const char *strings[])
85 Sets num values beginning at index start to the names contained in
86 the given set of character strings.
87
88 void setValue(const char *string)
89 Sets this field to contain one and only one value, given by string.
90
91 static SoType getClassTypeId()
92 virtual void getTypeId() const
93 Returns the type for this class or a particular object of this
94 class.
95
96 const SbName & operator [](int i) const
97 Returns the i'th value of the field. Indexing past the end of the
98 field (passing in i greater than getNum()) will return garbage.
99
100 const SbName * getValues(int start) const
101 Returns a pointer into the array of values in the field, starting at
102 index start. The values are read-only; see the startEditing()/fin‐
103 ishEditing() methods for a way of modifying values in place.
104
105 int find(const SbName & targetValue, SbBool addIfNotFound
106 = FALSE)
107 Finds the given value in the array and returns the index of that
108 value in the array. If the value is not found, -1 is returned. If
109 addIfNotFound is set, then targetValue is added to the end of the
110 array (but -1 is still returned).
111
112 void setValues(int start, int num, const SbName *newVal‐
113 ues)
114 Sets num values starting at index start to the values in newValues.
115 The array will be automatically be made larger to accomodate the new
116 values, if necessary.
117
118 void set1Value(int index, const SbName & newValue)
119 Sets the index'th value in the array to newValue. The array will be
120 automatically expanded, if necessary.
121
122 const SbName & operator=(const SbName & newValue)
123 void setValue(const SbName & newValue)
124 Sets the first value in the array to newValue, and deletes the sec‐
125 ond and subsequent values.
126
127 int operator ==(const SoMFName &f) const
128 int operator !=(const SoMFName &f) const
129 Returns TRUE if all of the values of this field equal (do not equal)
130 those of the given field. If the fields are different types FALSE
131 will always be returned (even if one field is an SoMFFloat with one
132 value of 1.0 and the other is an SoMFInt with a value of 1, for
133 example).
134
135 SbName * startEditing()
136 void finishEditing()
137 startEditing() returns a pointer to the internally-maintained array
138 that can be modified. The values in the array may be changed, but
139 values cannot be added or removed. It is illegal to call any other
140 editing methods between startEditing() and finishEditing() (e.g.
141 set1Value(), setValue(), etc).
142
143 Fields, engines or sensors connected to this field and sensors are
144 not notified that this field has changed until finishEditing() is
145 called. Calling finishEditing() always sets the isDefault() flag to
146 FALSE and informs engines and sensors that the field changed, even
147 if none of the values actually were changed.
148
149
150
151
152 SoMFName(3IV)()