1SoMFString(3IV)() SoMFString(3IV)()
2
3
4
6 SoMFString — multiple-value field containing any number of strings
7
9 SoField > SoMField > SoMFString
10
12 #include <Inventor/fields/SoMFString.h>
13
14 Methods from class SoMFString:
15
16 setValues(int start, int num, const char *strings[])
17 setValue(const char *string)
18 static SoType getClassTypeId()
19 virtual void getTypeId() const
20 const SbString & operator [](int i) const
21 const SbString * getValues(int start) const
22 int find(const SbString & targetValue, SbBool addIfNot‐
23 Found = FALSE)
24 void setValues(int start, int num, const SbString *newVal‐
25 ues)
26 void set1Value(int index, const SbString & newValue)
27 const SbString & operator =(const SbString & newValue)
28 void setValue(const SbString & newValue)
29 int operator ==(const SoMFString &f) const
30 int operator !=(const SoMFString &f) const
31 SbString * 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-value field that contains any number of strings.
69
70 SoMFStrings are written to file as one or more strings within double
71 quotes. Any characters (including newlines) may appear within the
72 quotes. To include a double quote character within the string, precede
73 it with a backslash. For example:
74
75 [ cowEnizer , "Scene Boy" , "He said, \"I did not!\"" ]
76
77
78
80 setValues(int start, int num, const char *strings[])
81 Sets num values, starting at index start, to the strings in the
82 given character arrays.
83
84 setValue(const char *string)
85 Deletes all values currently in this field and sets this field to
86 contain only the given string.
87
88 static SoType getClassTypeId()
89 virtual void getTypeId() const
90 Returns the type for this class or a particular object of this
91 class.
92
93 const SbString & operator [](int i) const
94 Returns the i'th value of the field. Indexing past the end of the
95 field (passing in i greater than getNum()) will return garbage.
96
97 const SbString * getValues(int start) const
98 Returns a pointer into the array of values in the field, starting at
99 index start. The values are read-only; see the startEditing()/fin‐
100 ishEditing() methods for a way of modifying values in-place.
101
102 int find(const SbString & targetValue, SbBool addIfNot‐
103 Found = FALSE)
104 Finds the given value in the array and returns the index of that
105 value in the array. If the value is not found, -1 is returned. If
106 addIfNotFound is set, then targetValue will be added to the end of
107 the array (but -1 is still returned).
108
109 void setValues(int start, int num, const SbString *newVal‐
110 ues)
111 Sets num values starting at index start to the values in newValues.
112 The array will be automatically be made larger to accomodate the new
113 values, if necessary.
114
115 void set1Value(int index, const SbString & newValue)
116 Sets the index'th value in the array to newValue. The array will be
117 automatically expanded, if necessary.
118
119 const SbString & operator =(const SbString & newValue)
120 void setValue(const SbString & newValue)
121 Sets the first value in the array to newValue, and deletes the sec‐
122 ond and subsequent values.
123
124 int operator ==(const SoMFString &f) const
125 int operator !=(const SoMFString &f) const
126 Returns TRUE if all of the values of this field equal (do not equal)
127 those of the given field. If the fields are different types FALSE
128 will always be returned (even if one field is an SoMFFloat with one
129 value of 1.0 and the other is an SoMFInt with a value of 1, for
130 example).
131
132 SbString * startEditing()
133 void finishEditing()
134 startEditing() returns a pointer to the internally-maintained array
135 that can be modified. The values in the array may be changed, but
136 values cannot be added or removed. It is illegal to call any other
137 editing methods between startEditing() and finishEditing() (e.g.
138 set1Value(), setValue(), etc).
139
140 Fields, engines or sensors connected to this field and sensors are
141 not notified that this field has changed until finishEditing() is
142 called. Calling finishEditing() always sets the isDefault(). flag to
143 FALSE and informs engines and sensors that the field changed, even
144 if none of the values actually were changed.
145
146
147
148
149 SoMFString(3IV)()