| 1 |
NAME SoMFVec2f SoMVec2f "" { |
| 2 |
multiple-value field containing any number of two-dimensional vectors |
| 3 |
} |
| 4 |
|
| 5 |
INCLUDE fields/SoMFVec2f.h |
| 6 |
|
| 7 |
DESC { |
| 8 |
A multiple-value field that contains any number of two-dimensional |
| 9 |
vectors. |
| 10 |
\p |
| 11 |
\cSoMFVec2fs\. are written to file as one or more pairs of floating |
| 12 |
point values separated by whitespace. |
| 13 |
When more than one value is present, all of the |
| 14 |
values are enclosed in square brackets and separated by commas; for |
| 15 |
example: |
| 16 |
\b |
| 17 |
[ 0 0, 1.2 3.4, 98.6 -4e1 ] |
| 18 |
\. |
| 19 |
} |
| 20 |
METHOD SetXYs void setValues(int start, int num, const float xy[\|][2]) |
| 21 |
{ |
| 22 |
Sets \anum\. values starting at index \astart\. to the given floating point |
| 23 |
values. There must be \anum\.*2 values in the passed array. |
| 24 |
} |
| 25 |
METHOD Set1X_Y void set1Value(int index, float x, float y) {} |
| 26 |
METHOD Set1XY void set1Value(int index, const float xy[2]) { |
| 27 |
Set the \aindex\.'th value to the given floating point values. |
| 28 |
} |
| 29 |
METHOD SetX_Y void setValue(float x, float y) {} |
| 30 |
METHOD SetXY void setValue(const float xy[2]) { |
| 31 |
Sets the field to contain the given value and only the given value (if |
| 32 |
the array had multiple values before, they are deleted). |
| 33 |
} |
| 34 |
METHOD "" static SoType getClassTypeId() {} |
| 35 |
METHOD "" virtual void getTypeId() const { |
| 36 |
Returns the type for this class or a particular object of this class. |
| 37 |
} |
| 38 |
METHOD Get const SbVec2f & operator [\|](int i) const { |
| 39 |
Returns the \ai\.'th value of the field. Indexing past the end of the |
| 40 |
field (passing in \ai\. greater than \mgetNum()\.) will return garbage. |
| 41 |
} |
| 42 |
METHOD GetN const SbVec2f * getValues(int start) const { |
| 43 |
Returns a pointer into the array of values in the field, starting at |
| 44 |
index \astart\.. The values are read-only; see the |
| 45 |
\mstartEditing()\./\mfinishEditing()\. methods for a way of modifying values |
| 46 |
in place. |
| 47 |
} |
| 48 |
METHOD "" int find(const SbVec2f & targetValue, |
| 49 |
SbBool addIfNotFound = FALSE) { |
| 50 |
Finds the given value in the array and returns the index of that value |
| 51 |
in the array. If the value is not found, -1 is returned. If |
| 52 |
\aaddIfNotFound\. is set, then \atargetValue\. is added to the end of the |
| 53 |
array (but -1 is still returned). |
| 54 |
} |
| 55 |
METHOD SetN void setValues(int start, int num, |
| 56 |
const SbVec2f *newValues) { |
| 57 |
Sets \anum\. values starting at index \astart\. to the values in \anewValues\.. |
| 58 |
The array will be automatically be made larger to accomodate the new |
| 59 |
values, if necessary. |
| 60 |
} |
| 61 |
METHOD Set1 void set1Value(int index, const SbVec2f & newValue) { |
| 62 |
Sets the \aindex\.'th value in the array to \anewValue\.. The array will be |
| 63 |
automatically expanded, if necessary. |
| 64 |
} |
| 65 |
METHOD " " const SbVec2f & operator =(const SbVec2f & newValue) {} |
| 66 |
METHOD Set void setValue(const SbVec2f & newValue) { |
| 67 |
Sets the first value in the array to \anewValue\., and deletes the second |
| 68 |
and subsequent values. |
| 69 |
} |
| 70 |
METHOD IsEq int operator ==(const SoMFVec2f &f) const {} |
| 71 |
METHOD IsNEq int operator !=(const SoMFVec2f &f) const { |
| 72 |
Returns TRUE if all of the values of this field equal (do not |
| 73 |
equal) those of the given field. If the fields are different types FALSE will |
| 74 |
always be returned (even if one field is an \cSoMFFloat\. with one |
| 75 |
value of 1.0 and the other is an \cSoMFInt\. with a value of 1, for |
| 76 |
example). |
| 77 |
} |
| 78 |
METHOD StartEdit SbVec2f *startEditing() {} |
| 79 |
METHOD FinishEdit void finishEditing() { |
| 80 |
\mstartEditing()\. returns a pointer to the internally-maintained array that |
| 81 |
can be modified. The values in the array may be changed, but values cannot |
| 82 |
be added or removed. It is illegal to call any other editing methods between |
| 83 |
\+\mstartEditing()\. and \mfinishEditing()\. (e.g. \mset1Value()\., |
| 84 |
\msetValue()\., etc).\.\-\mStartEdit()\. and \mFinishEdit()\. (e.g. |
| 85 |
\mSet1()\., \mSet()\., etc).\. |
| 86 |
\p |
| 87 |
Fields, engines or sensors connected to this field and sensors are not |
| 88 |
notified that this field has changed until |
| 89 |
\+\mfinishEditing()\.\.\-\mFinishEdit()\.\. is called. Calling |
| 90 |
\+\mfinishEditing()\.\.\-\mFinishEdit()\.\. always sets the |
| 91 |
\+\misDefault()\.\.\-\mIsDflt\.\. flag to FALSE and informs |
| 92 |
engines and sensors that the field changed, even if none of the values |
| 93 |
actually were changed. |
| 94 |
} |