1SoMFColor(3IV)()                                              SoMFColor(3IV)()
2
3
4

NAME

6       SoMFColor  —  multiple-value  field containing any number of RGB colors
7       stored as three floats
8

INHERITS FROM

10       SoField > SoMField > SoMFColor
11

SYNOPSIS

13          Methods from class SoMFColor:
14
15     void                setValues(int start, int num, const float rgb[][3])
16     void                setHSVValues(int  start,   int   num,   const   float
17                              hsv[][3])
18     void                setValue(const SbVec3f &vec)
19     void                setValue(float red, float green, float blue)
20     void                setHSVValue(float hue, float saturation, float value)
21     void                setValue(const float rgb[3])
22     void                setHSVValue(const float hsv[3])
23     void                set1Value(index, const SbVec3f &vec)
24     void                set1Value(index, float r, float g, float b)
25     void                set1HSVValue(index, float h, float s, float v)
26     void                set1Value(index, const float rgb[3])
27     void                set1HSVValue(index, const float hsv[3])
28     static SoType       getClassTypeId()
29     virtual void        getTypeId() const
30     const SbColor &     operator [](int i) const
31     const SbColor *     getValues(int start) const
32     int                 find(const  SbColor  &  targetValue, SbBool addIfNot‐
33                              Found = FALSE)
34     void                setValues(int start, int num, const SbColor  *newVal‐
35                              ues)
36     void                set1Value(int index, const SbColor & newValue)
37     const SbColor &     operator =(const SbColor & newValue)
38     void                setValue(const SbColor & newValue)
39     int                 operator ==(const SoMFColor &f) const
40     int                 operator !=(const SoMFColor &f) const
41     SbColor *           startEditing()
42     void                finishEditing()
43
44          Methods from class SoMField:
45
46     int                 getNum() const
47     void                setNum(int num)
48     virtual void        deleteValues(int start, int num = -1)
49     virtual void        insertSpace(int start, int num)
50     SbBool              set1(int index, const char *valueString)
51     void                get1(int index, SbString &valueString)
52
53          Methods from class SoField:
54
55     void                setIgnored(SbBool ignore)
56     SbBool              isIgnored() const
57     SbBool              isDefault() const
58     virtual SbBool      isOfType(SoType type) const
59     SbBool              set(const char *valueString)
60     void                get(SbString &valueString)
61     void                touch()
62     SbBool              connectFrom(SoField *fromField)
63     SbBool              connectFrom(SoEngineOutput *fromEngine)
64     void                disconnect()
65     SbBool              isConnected() const
66     SbBool              isConnectedFromField() const
67     SbBool              getConnectedField(SoField *&writingField) const
68     SbBool              isConnectedFromEngine() const
69     SbBool              getConnectedEngine(SoEngineOutput     *&engineOutput)
70                              const
71     void                enableConnection(SbBool flag)
72     SbBool              isConnectionEnabled() const
73     int                 getForwardConnections(SoFieldList &list) const
74     SoFieldContainer *  getContainer() const
75
76

DESCRIPTION

78       A multiple-value field that contains any number of RGB  colors,  stored
79       as  instances  of SbColor. Values may be set in either RGB (red, green,
80       blue) or HSV (hue, saturation, value) color spaces.
81
82       SoMFColors are written to file as one or more RGB triples  of  floating
83       point numbers in standard scientific notation. When more than one value
84       is present, all of the values are enclosed in square brackets and sepa‐
85       rated by commas.  For example:
86
87          [ 1.0 0.0 0.0, 0 1 0, 0 0 1 ]
88
89     represents the three colors red, green, and blue.
90

METHODS

92     void                setValues(int start, int num, const float rgb[][3])
93     void                setHSVValues(int   start,   int   num,   const  float
94                              hsv[][3])
95          Sets num values starting at index start to the RGB (or  HSV)  values
96          specified  by the given array of floats. Each float should be in the
97          range 0.0 to 1.0, and there must be 3*num floats in the array.
98
99     void                setValue(const SbVec3f &vec)
100     void                setValue(float red, float green, float blue)
101     void                setHSVValue(float hue, float saturation, float value)
102     void                setValue(const float rgb[3])
103     void                setHSVValue(const float hsv[3])
104          Sets the field to contain one and only one value,  the  given  color
105          (expressed  as  either RGB or HSV floating point values in the range
106          0.0 to 1.0), and deletes the second and subsequent values.
107
108     void                set1Value(index, const SbVec3f &vec)
109     void                set1Value(index, float r, float g, float b)
110     void                set1HSVValue(index, float h, float s, float v)
111     void                set1Value(index, const float rgb[3])
112     void                set1HSVValue(index, const float hsv[3])
113          Sets one value in the array to the given color. The  array  will  be
114          expanded and filled with zeroes as necessary.
115
116     static SoType       getClassTypeId()
117     virtual void        getTypeId() const
118          Returns  the  type  for  this  class  or a particular object of this
119          class.
120
121     const SbColor &     operator [](int i) const
122          Returns the i'th value of the field. Indexing past the  end  of  the
123          field (passing in i greater than getNum()) will return garbage.
124
125     const SbColor *     getValues(int start) const
126          Returns a pointer into the array of values in the field, starting at
127          index start. The values are read-only; see  the  startEditing()/fin‐
128          ishEditing() methods for a way of modifying values in place.
129
130     int                 find(const  SbColor  &  targetValue, SbBool addIfNot‐
131                              Found = FALSE)
132          Finds the given value in the array and returns  the  index  of  that
133          value  in  the  array. If the value is not found, -1 is returned. If
134          addIfNotFound is set, then targetValue is added to the  end  of  the
135          array (but -1 is still returned).
136
137     void                setValues(int  start, int num, const SbColor *newVal‐
138                              ues)
139          Sets num values starting at index start to the values in  newValues.
140          The array will be automatically be made larger to accomodate the new
141          values, if necessary.
142
143     void                set1Value(int index, const SbColor & newValue)
144          Sets the index'th value in the array to newValue. The array will  be
145          automatically expanded, if necessary.
146
147     const SbColor &     operator =(const SbColor & newValue)
148     void                setValue(const SbColor & newValue)
149          Sets  the first value in the array to newValue, and deletes the sec‐
150          ond and subsequent values.
151
152     int                 operator ==(const SoMFColor &f) const
153     int                 operator !=(const SoMFColor &f) const
154          Returns TRUE if all of the values of this field equal (do not equal)
155          those  of  the  given field. If the fields are different types FALSE
156          will always be returned (even if one field is an SoMFFloat with  one
157          value  of  1.0  and  the  other is an SoMFInt with a value of 1, for
158          example).
159
160     SbColor *           startEditing()
161     void                finishEditing()
162          startEditing() returns a pointer to the internally-maintained  array
163          that  can  be  modified. The values in the array may be changed, but
164          values cannot be added or removed. It is illegal to call  any  other
165          editing  methods  between  startEditing()  and finishEditing() (e.g.
166          set1Value(), setValue(), etc).
167
168          Fields, engines or sensors connected to this field and  sensors  are
169          not  notified  that  this field has changed until finishEditing() is
170          called. Calling finishEditing() always sets the isDefault() flag  to
171          FALSE  and  informs engines and sensors that the field changed, even
172          if none of the values actually were changed.
173
174

SEE ALSO

176       SbColor
177
178
179
180
181                                                              SoMFColor(3IV)()
Impressum