SoMField Class |
Base class for all multiple-valued fields.
Namespace: OIV.Inventor.Fields
The SoMField type exposes the following members.
Name | Description | |
---|---|---|
AppendConnection(SoEngineOutput) | Appends this field to the list of connections from another engineOutput. | |
AppendConnection(SoField) | Appends this field to the list of connections from another field. | |
ConnectFrom(SoEngineOutput) | Connects this field from an engine output. | |
ConnectFrom(SoField) | Connects this field to another field. | |
DeleteValues(Int32) | Calls DeleteValues(start, -1). | |
DeleteValues(Int32, Int32) | Deletes num values beginning at index start (index start through start + num -1 will be deleted, and any leftover values will be moved down to fill in the gap created). | |
Disconnect | Disconnect the field from whatever it was connected to. | |
Disconnect(SoEngineOutput) | Disconnect the field from the requested engineOutput. | |
Disconnect(SoField) | Disconnect the field from the requested field. | |
EnableConnection | Field connections may be enabled and disabled. | |
Equals | (Inherited from SoField.) | |
Get | Returns the value of the field in the Open Inventor file format, even if the field has its default value. | |
Get1 | This is equivalent to the OIV.Inventor.Fields.SoField.Get(System.String@) method of OIV.Inventor.Fields.SoField, but operates on only one value. | |
GetConnectedEngine | Returns true if this field is being written into by an engine, and returns the engine output it is connected to in engineOutput. | |
GetConnectedField | Returns true if this field is being written into by another field, and returns the field it is connected to in writingField. | |
GetConnections | Returns a list of the connections to this field. | |
GetContainer | Returns the object that contains this field. | |
GetForwardConnections | Adds references to all of the fields that this field is writing into (either fields in nodes, global fields or engine inputs) to the given field list, and returns the number of forward connections. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetNum | Obsolete. Returns the number of values currently in the field. | |
GetNumConnections | Returns the number of connections to this field. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetValueSize | Gets the size of the value. | |
InsertSpace | Inserts space for num values at index start . | |
IsConnected | Returns true if the field is connected to anything. | |
IsConnectedFromEngine | Returns true if the field is connected to an engine's output. | |
IsConnectedFromField | Returns true if the field is connected to another field. | |
IsConnectedFromVRMLInterp | Returns true if the field is connected to a VRML interpOutput. | |
IsConnectionEnabled | Returns false if connections to this field are disabled. | |
IsDefault | Gets the state of default flag of the field. | |
IsIgnored | Gets the ignore flag for this field. | |
Set | Sets the field to the given value, which is an ASCII string in the Open Inventor file format. | |
Set1 | This is equivalent to the OIV.Inventor.Fields.SoField.Set(System.String) method of OIV.Inventor.Fields.SoField, but operates on only one value. | |
SetIgnored | Sets the ignore flag for this field. | |
SetNum | Obsolete. Forces this field to have exactly num values, inserting or deleting values as necessary. | |
ToString |
Converts this SoMFField structure to a human readable string.
(Overrides ObjectToString.) | |
Touch | Simulates a change to the field, causing attached sensors to fire, connected fields and engines to be marked as needing evaluation, and so forth. |
Name | Description | |
---|---|---|
Count | Returns the number of values currently in the field. | |
IsUserDefinedBuffer |
Each class derived from OIV.Inventor.Fields.SoMField begins with an SoMF prefix and contains a dynamic array of values of a particular type. Each has a setValues() method that is passed an array of values of the correct type; these values are copied into the array in the field, making extra room in the array if necessary. The start parameter to this method indicates the starting array index to copy into.
The getValues() method for a multiple-value field returns a read-only array of values in the field. In addition, the indexer operator [i] is implemented and allows setting/getting the i 'th value in the array.
Methods are provided for getting the number of values in the field, inserting space for new values in the middle, and deleting values.
There are other methods that allow you to set only one value of several in the field and to set the field to contain one and only one value.
Two other methods can be used to make several changes to a multiple-value field without the overhead of copying values into and out of the fields. The startEditing() method returns the internal array of values in the field. It can be used to change (but not add or remove) any values in the array. The finishEditing() method indicates that the editing is done and notifies any sensors or engines that may be connected to the field.
SoMFields are written to file as a series of values separated by commas, all enclosed in square brackets. If the field has no values (() returns zero), then only the square brackets ("[ ]") are written. The last value may optionally be followed by a comma. Each field subtype defines how the values are written; for example, a field whose values are integers might be written as:
[ 1, 2, 3, 4 ]or:
[ 1, 2, 3, 4, ]