SoMFColor(3IV)NAMESoMFColor (SoMCol) - multiple-value field containing any number of RGB
colors stored as three floats
INHERITS FROM
SoField > SoMField > SoMFColorSYNOPSIS
typedef SoMFColor SoMCol
Functions from class SoMFColor:
void SoMColSetRGBs(SoMCol *this, int start, int num, const
float rgb[][3])
void SoMColSetHSVs(SoMCol *this, int start, int num, const
float hsv[][3])
void SoMColSetV3f(SoMCol *this, const SbVec3f *vec)
void SoMColSetR_G_B(SoMCol *this, float red, float green,
float blue)
void SoMColSetH_S_V(SoMCol *this, float hue, float
saturation, float value)
void SoMColSetRGB(SoMCol *this, const float rgb[3])
void SoMColSetHSV(SoMCol *this, const float hsv[3])
void SoMColSet1V3f(SoMCol *this, index, const SbVec3f
*vec)
void SoMColSet1R_G_B(SoMCol *this, index, float r, float
g, float b)
void SoMColSet1H_S_V(SoMCol *this, index, float h, float
s, float v)
void SoMColSet1RGB(SoMCol *this, index, const float
rgb[3])
void SoMColSet1HSV(SoMCol *this, index, const float
hsv[3])
SoType SoMColGetClassTypeId()
void SoMColGetTypeId(const SoMCol *this)
const SbColor * SoMColGet(const SoMCol *this, int i)
const SbColor * SoMColGetN(const SoMCol *this, int start)
int SoMColFind(SoMCol *this, const SbColor * targetValue,
SbBool addIfNotFound = FALSE)
void SoMColSetN(SoMCol *this, int start, int num, const
SbColor *newValues)
void SoMColSet1(SoMCol *this, int index, const SbColor *
newValue)
void SoMColSet(SoMCol *this, const SbColor * newValue)
int SoMColIsEq(const SoMCol *this, const SoMFColor *f)
int SoMColIsNEq(const SoMCol *this, const SoMFColor *f)
SbColor * SoMColStartEdit(SoMCol *this)
void SoMColFinishEdit(SoMCol *this)
Functions from class SoMField:
Page 1SoMFColor(3IV)
int SoMColGetNum(const SoMCol *this)
void SoMColSetNum(SoMCol *this, int num)
void SoMColDel(SoMCol *this, int start, int num = -1)
void SoMColInsertSpace(SoMCol *this, int start, int num)
void SoMColGet1(SoMCol *this, int index, SbString
*valueString)
Functions from class SoField:
void SoMColSetIgnored(SoMCol *this, SbBool ignore)
SbBool SoMColIsIgnored(const SoMCol *this)
SbBool SoMColIsDflt(const SoMCol *this)
SbBool SoMColIsOfType(const SoMCol *this, SoType type)
SbBool SoMColSetFromStr(SoMCol *this, const char
*valueString)
void SoMColGetIntoStr(SoMCol *this, SbString *valueString)
void SoMColTouch(SoMCol *this)
SbBool SoMColConnFromField(SoMCol *this, SoField *fromField)
SbBool SoMColConnFrom(SoMCol *this, SoEngineOutput
*fromEngine)
void SoMColDisconn(SoMCol *this)
SbBool SoMColIsConn(const SoMCol *this)
SbBool SoMColIsConnFromField(const SoMCol *this)
SbBool SoMColGetConnField(const SoMCol *this, SoField
**writingField)
SbBool SoMColIsConnFromEngine(const SoMCol *this)
SbBool SoMColGetConnEngine(const SoMCol *this,
SoEngineOutput **engineOutput)
void SoMColEnableConn(SoMCol *this, SbBool flag)
SbBool SoMColIsConnEnabled(const SoMCol *this)
int SoMColGetForwardConn(const SoMCol *this, SoFieldList
*list)
SoFieldContainer * SoMColGetContainer(const SoMCol *this)
DESCRIPTION
A multiple-value field that contains any number of RGB colors, stored as
instances of SbColor. Values may be set in either RGB (red, green, blue)
or HSV (hue, saturation, value) color spaces.
SoMFColors are written to file as one or more RGB triples of floating
point numbers in standard scientific notation. When more than one value
is present, all of the values are enclosed in square brackets and
separated by commas. For example:
[ 1.0 0.0 0.0, 0 1 0, 0 0 1 ]
represents the three colors red, green, and blue.
FUNCTIONS
void SoMColSetRGBs(SoMCol *this, int start, int num, const
float rgb[][3])
Page 2SoMFColor(3IV)
void SoMColSetHSVs(SoMCol *this, int start, int num, const
float hsv[][3])
Sets num values starting at index start to the RGB (or HSV) values
specified by the given array of floats. Each float should be in the
range 0.0 to 1.0, and there must be 3*num floats in the array.
void SoMColSetV3f(SoMCol *this, const SbVec3f *vec)
void SoMColSetR_G_B(SoMCol *this, float red, float green,
float blue)
void SoMColSetH_S_V(SoMCol *this, float hue, float
saturation, float value)
void SoMColSetRGB(SoMCol *this, const float rgb[3])
void SoMColSetHSV(SoMCol *this, const float hsv[3])
Sets the field to contain one and only one value, the given color
(expressed as either RGB or HSV floating point values in the range
0.0 to 1.0), and deletes the second and subsequent values.
void SoMColSet1V3f(SoMCol *this, index, const SbVec3f
*vec)
void SoMColSet1R_G_B(SoMCol *this, index, float r, float
g, float b)
void SoMColSet1H_S_V(SoMCol *this, index, float h, float
s, float v)
void SoMColSet1RGB(SoMCol *this, index, const float
rgb[3])
void SoMColSet1HSV(SoMCol *this, index, const float
hsv[3])
Sets one value in the array to the given color. The array will be
expanded and filled with zeroes as necessary.
SoType SoMColGetClassTypeId()
void SoMColGetTypeId(const SoMCol *this)
Returns the type for this class or a particular object of this
class.
const SbColor * SoMColGet(const SoMCol *this, int i)
Returns the i'th value of the field. Indexing past the end of the
field (passing in i greater than getNum()) will return garbage.
const SbColor * SoMColGetN(const SoMCol *this, int start)
Returns a pointer into the array of values in the field, starting at
index start. The values are read-only; see the
startEditing()/finishEditing() methods for a way of modifying values
in place.
int SoMColFind(SoMCol *this, const SbColor * targetValue,
SbBool addIfNotFound = FALSE)
Finds the given value in the array and returns the index of that
value in the array. If the value is not found, -1 is returned. If
addIfNotFound is set, then targetValue is added to the end of the
array (but -1 is still returned).
Page 3SoMFColor(3IV)
void SoMColSetN(SoMCol *this, int start, int num, const
SbColor *newValues)
Sets num values starting at index start to the values in newValues.
The array will be automatically be made larger to accomodate the new
values, if necessary.
void SoMColSet1(SoMCol *this, int index, const SbColor *
newValue)
Sets the index'th value in the array to newValue. The array will be
automatically expanded, if necessary.
void SoMColSet(SoMCol *this, const SbColor * newValue)
Sets the first value in the array to newValue, and deletes the
second and subsequent values.
int SoMColIsEq(const SoMCol *this, const SoMFColor *f)
int SoMColIsNEq(const SoMCol *this, const SoMFColor *f)
Returns TRUE if all of the values of this field equal (do not equal)
those of the given field. If the fields are different types FALSE
will always be returned (even if one field is an SoMFFloat with one
value of 1.0 and the other is an SoMFInt with a value of 1, for
example).
SbColor * SoMColStartEdit(SoMCol *this)
void SoMColFinishEdit(SoMCol *this)
startEditing() returns a pointer to the internally-maintained array
that can be modified. The values in the array may be changed, but
values cannot be added or removed. It is illegal to call any other
editing methods between StartEdit() and FinishEdit() (e.g. Set1(),
Set(), etc).
Fields, engines or sensors connected to this field and sensors are
not notified that this field has changed until FinishEdit() is
called. Calling FinishEdit() always sets the IsDflt flag to FALSE
and informs engines and sensors that the field changed, even if none
of the values actually were changed.
SEE ALSO
SbColor
Page 4