logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

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.

Inherits From

       SoField > SoMField > SoMFColor

Methods

voidsetValues(intstart,intnum,constfloatrgb[][3])voidsetHSVValues(intstart,intnum,constfloathsv[][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.

     voidsetValue(constSbVec3f&vec)voidsetValue(floatred,floatgreen,floatblue)voidsetHSVValue(floathue,floatsaturation,floatvalue)voidsetValue(constfloatrgb[3])voidsetHSVValue(constfloathsv[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.

     voidset1Value(index,constSbVec3f&vec)voidset1Value(index,floatr,floatg,floatb)voidset1HSVValue(index,floath,floats,floatv)voidset1Value(index,constfloatrgb[3])voidset1HSVValue(index,constfloathsv[3])
          Sets  one  value in the array to the given color. The array will be expanded and filled with zeroes as
          necessary.

     staticSoTypegetClassTypeId()virtualvoidgetTypeId()const
          Returns the type for this class or a particular object of this class.

     constSbColor&operator[](inti)const
          Returns the i'th value of the field. Indexing past the end of the field (passing  in  i  greater  than
          getNum()) will return garbage.

     constSbColor*getValues(intstart)const
          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.

     intfind(constSbColor&targetValue,SbBooladdIfNotFound=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).

     voidsetValues(intstart,intnum,constSbColor*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.

     voidset1Value(intindex,constSbColor&newValue)
          Sets  the  index'th  value  in  the  array  to  newValue. The array will be automatically expanded, if
          necessary.

     constSbColor&operator=(constSbColor&newValue)voidsetValue(constSbColor&newValue)
          Sets the first value in the array to newValue, and deletes the second and subsequent values.

     intoperator==(constSoMFColor&f)constintoperator!=(constSoMFColor&f)const
          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*startEditing()voidfinishEditing()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 startEditing() and finishEditing() (e.g. set1Value(), setValue(), etc).

          Fields, engines or sensors connected to this field and sensors are not notified that  this  field  has
          changed  until  finishEditing() is called. Calling finishEditing() always sets the isDefault() flag to
          FALSE and informs engines and sensors that the field changed, even if none of the values actually were
          changed.

Name

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

See Also

SbColorSoMFColor(3IV)()

Synopsis

          Methods from class SoMFColor:

     voidsetValues(intstart,intnum,constfloatrgb[][3])voidsetHSVValues(intstart,intnum,constfloathsv[][3])voidsetValue(constSbVec3f&vec)voidsetValue(floatred,floatgreen,floatblue)voidsetHSVValue(floathue,floatsaturation,floatvalue)voidsetValue(constfloatrgb[3])voidsetHSVValue(constfloathsv[3])voidset1Value(index,constSbVec3f&vec)voidset1Value(index,floatr,floatg,floatb)voidset1HSVValue(index,floath,floats,floatv)voidset1Value(index,constfloatrgb[3])voidset1HSVValue(index,constfloathsv[3])staticSoTypegetClassTypeId()virtualvoidgetTypeId()constconstSbColor&operator[](inti)constconstSbColor*getValues(intstart)constintfind(constSbColor&targetValue,SbBooladdIfNotFound=FALSE)voidsetValues(intstart,intnum,constSbColor*newValues)voidset1Value(intindex,constSbColor&newValue)constSbColor&operator=(constSbColor&newValue)voidsetValue(constSbColor&newValue)intoperator==(constSoMFColor&f)constintoperator!=(constSoMFColor&f)constSbColor*startEditing()voidfinishEditing()

          Methods from class SoMField:

     intgetNum()constvoidsetNum(intnum)virtualvoiddeleteValues(intstart,intnum=-1)virtualvoidinsertSpace(intstart,intnum)SbBoolset1(intindex,constchar*valueString)voidget1(intindex,SbString&valueString)

          Methods from class SoField:

     voidsetIgnored(SbBoolignore)SbBoolisIgnored()constSbBoolisDefault()constvirtualSbBoolisOfType(SoTypetype)constSbBoolset(constchar*valueString)voidget(SbString&valueString)voidtouch()SbBoolconnectFrom(SoField*fromField)SbBoolconnectFrom(SoEngineOutput*fromEngine)voiddisconnect()SbBoolisConnected()constSbBoolisConnectedFromField()constSbBoolgetConnectedField(SoField*&writingField)constSbBoolisConnectedFromEngine()constSbBoolgetConnectedEngine(SoEngineOutput*&engineOutput)constvoidenableConnection(SbBoolflag)SbBoolisConnectionEnabled()constintgetForwardConnections(SoFieldList&list)constSoFieldContainer*getContainer()const

See Also