| 1 |
NAME SoMFColor SoMCol "" { |
| 2 |
multiple-value field containing any number of RGB colors stored as three floats |
| 3 |
} |
| 4 |
DESC { |
| 5 |
A multiple-value field that contains any number of RGB colors, stored |
| 6 |
as instances of \cSbColor\.. Values may be set in either RGB (red, |
| 7 |
green, blue) or HSV (hue, saturation, value) color spaces. |
| 8 |
\p |
| 9 |
\cSoMFColors\. are written to file as one or more RGB triples of |
| 10 |
floating point numbers in standard scientific notation. When more |
| 11 |
than one value is present, all of the values are enclosed in square |
| 12 |
brackets and separated by commas. For example: |
| 13 |
\b |
| 14 |
[ 1.0 0.0 0.0, 0 1 0, 0 0 1 ] |
| 15 |
\. |
| 16 |
represents the three colors red, green, and blue. |
| 17 |
} |
| 18 |
|
| 19 |
METHOD SetRGBs void setValues(int start, int num, const float rgb[\|][3]) {} |
| 20 |
METHOD SetHSVs void setHSVValues(int start, int num, const float hsv[\|][3]) { |
| 21 |
Sets \anum\. values starting at index \astart\. to the RGB (or HSV) values |
| 22 |
specified by the given array of floats. Each float should be in the |
| 23 |
range 0.0 to 1.0, and there must be 3*\anum\. floats in the array. |
| 24 |
} |
| 25 |
METHOD SetV3f void setValue(const SbVec3f &vec) {} |
| 26 |
METHOD SetR_G_B void setValue(float red, float green, float blue) {} |
| 27 |
METHOD SetH_S_V void setHSVValue(float hue, float saturation, float value) {} |
| 28 |
METHOD SetRGB void setValue(const float rgb[3]) {} |
| 29 |
METHOD SetHSV void setHSVValue(const float hsv[3]) { |
| 30 |
Sets the field to contain one and only one value, the given color |
| 31 |
(expressed as either RGB or HSV floating point values in the range 0.0 |
| 32 |
to 1.0), and deletes the second and subsequent values. |
| 33 |
} |
| 34 |
METHOD Set1V3f void set1Value(index, const SbVec3f &vec) {} |
| 35 |
METHOD Set1R_G_B void set1Value(index, float r, float g, float b) {} |
| 36 |
METHOD Set1H_S_V void set1HSVValue(index, float h, float s, float v) {} |
| 37 |
METHOD Set1RGB void set1Value(index, const float rgb[3]) {} |
| 38 |
METHOD Set1HSV void set1HSVValue(index, const float hsv[3]) { |
| 39 |
Sets one value in the array to the given color. The array will be |
| 40 |
expanded and filled with zeroes as necessary. |
| 41 |
} |
| 42 |
|
| 43 |
ALSO { SbColor } |
| 44 |
METHOD "" static SoType getClassTypeId() {} |
| 45 |
METHOD "" virtual void getTypeId() const { |
| 46 |
Returns the type for this class or a particular object of this class. |
| 47 |
} |
| 48 |
METHOD Get const SbColor & operator [\|](int i) const { |
| 49 |
Returns the \ai\.'th value of the field. Indexing past the end of the |
| 50 |
field (passing in \ai\. greater than \mgetNum()\.) will return garbage. |
| 51 |
} |
| 52 |
METHOD GetN const SbColor * getValues(int start) const { |
| 53 |
Returns a pointer into the array of values in the field, starting at |
| 54 |
index \astart\.. The values are read-only; see the |
| 55 |
\mstartEditing()\./\mfinishEditing()\. methods for a way of modifying values |
| 56 |
in place. |
| 57 |
} |
| 58 |
METHOD "" int find(const SbColor & targetValue, |
| 59 |
SbBool addIfNotFound = FALSE) { |
| 60 |
Finds the given value in the array and returns the index of that value |
| 61 |
in the array. If the value is not found, -1 is returned. If |
| 62 |
\aaddIfNotFound\. is set, then \atargetValue\. is added to the end of the |
| 63 |
array (but -1 is still returned). |
| 64 |
} |
| 65 |
METHOD SetN void setValues(int start, int num, |
| 66 |
const SbColor *newValues) { |
| 67 |
Sets \anum\. values starting at index \astart\. to the values in \anewValues\.. |
| 68 |
The array will be automatically be made larger to accomodate the new |
| 69 |
values, if necessary. |
| 70 |
} |
| 71 |
METHOD Set1 void set1Value(int index, const SbColor & newValue) { |
| 72 |
Sets the \aindex\.'th value in the array to \anewValue\.. The array will be |
| 73 |
automatically expanded, if necessary. |
| 74 |
} |
| 75 |
METHOD " " const SbColor & operator =(const SbColor & newValue) {} |
| 76 |
METHOD Set void setValue(const SbColor & newValue) { |
| 77 |
Sets the first value in the array to \anewValue\., and deletes the second |
| 78 |
and subsequent values. |
| 79 |
} |
| 80 |
METHOD IsEq int operator ==(const SoMFColor &f) const {} |
| 81 |
METHOD IsNEq int operator !=(const SoMFColor &f) const { |
| 82 |
Returns TRUE if all of the values of this field equal (do not |
| 83 |
equal) those of the given field. If the fields are different types FALSE will |
| 84 |
always be returned (even if one field is an \cSoMFFloat\. with one |
| 85 |
value of 1.0 and the other is an \cSoMFInt\. with a value of 1, for |
| 86 |
example). |
| 87 |
} |
| 88 |
METHOD StartEdit SbColor *startEditing() {} |
| 89 |
METHOD FinishEdit void finishEditing() { |
| 90 |
\mstartEditing()\. returns a pointer to the internally-maintained array that |
| 91 |
can be modified. The values in the array may be changed, but values cannot |
| 92 |
be added or removed. It is illegal to call any other editing methods between |
| 93 |
\+\mstartEditing()\. and \mfinishEditing()\. (e.g. |
| 94 |
\mset1Value()\., \msetValue()\., etc).\.\-\mStartEdit()\. and \mFinishEdit()\. |
| 95 |
(e.g. \mSet1()\., \mSet()\., etc).\. |
| 96 |
\p |
| 97 |
Fields, engines or sensors connected to this field and sensors are not |
| 98 |
notified that this field has changed until |
| 99 |
\+\mfinishEditing()\.\.\-\mFinishEdit()\.\. is called. Calling |
| 100 |
\+\mfinishEditing()\.\.\-\mFinishEdit()\.\. always sets the |
| 101 |
\+\misDefault()\.\.\-\mIsDflt\.\. flag to FALSE and informs |
| 102 |
engines and sensors that the field changed, even if none of the values |
| 103 |
actually were changed. |
| 104 |
} |