public class SoFieldContainer extends SoBase
SoFieldContainer
is the base class for engines and nodes. It contains methods for finding out what fields an object has, controlling notification, and for dealing with all of the fields of an object at once.
The fields of an engine are its inputs. Note that even though an engine's output corresponds to a specific type of field, an engine output is not a field.
See also:
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and Description |
---|---|
void |
copyFieldValues(SoFieldContainer fc)
Calls copyFieldValues(fc, false).
|
void |
copyFieldValues(SoFieldContainer fc,
boolean copyConnections)
Copies the contents of fc's fields into this object's fields.
|
boolean |
enableNotify(boolean flag)
Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).
|
boolean |
fieldsAreEqual(SoFieldContainer fc)
Returns true if this object's fields are exactly equal to fc's fields.
|
java.lang.String |
get()
Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
|
SoField[] |
getAllFields()
Returns the fields contained by this container.
|
SoField |
getEventIn(java.lang.String fieldName)
Returns a the eventIn with the given name.
|
SoField |
getEventOut(java.lang.String fieldName)
Returns the eventOut with the given name.
|
SoField |
getField(java.lang.String fieldName)
Returns a the field of this object whose name is fieldName.
|
java.lang.String |
getFieldName(SoField field)
Returns the name of the given field in the fieldName argument.
|
boolean |
hasDefaultValues()
Returns true if all of the object's fields have their default values.
|
boolean |
isNotifyEnabled()
Notification is the process of telling interested objects that this object has changed.
|
boolean |
set(java.lang.String fieldDataString)
Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
|
void |
setToDefaults()
Sets all fields in this object to their default values.
|
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable, touch
getNativeResourceHandle
public SoField[] getAllFields()
public void copyFieldValues(SoFieldContainer fc)
public boolean fieldsAreEqual(SoFieldContainer fc)
public void copyFieldValues(SoFieldContainer fc, boolean copyConnections)
public boolean set(java.lang.String fieldDataString)
For example, you could set the fields of an SoCube
by doing:
SoCube cube = new SoCube(); cube.set( "width 1.0 height 2.0 depth 3.2" );
public SoField getEventIn(java.lang.String fieldName)
public boolean hasDefaultValues()
hasDefaultValues()
would return true in this case.public void setToDefaults()
public SoField getField(java.lang.String fieldName)
public boolean enableNotify(boolean flag)
public SoField getEventOut(java.lang.String fieldName)
public boolean isNotifyEnabled()
Notification is normally enabled, but can be disabled on a node by node (or engine by engine) basis. If you are making extensive changes to a large part of the scene graph then disabling notification can increase performance, at the expense of increased responsibility for making sure that any interested engines, sensors or paths are kept up to date.
For example, if you will be making a lot of changes to a small part of your scene graph and you know that there are no engines or sensors attached to nodes in that part of the scene graph, you might disable notification on the nodes you are changing, modify them, re-enable notification, and then touch()
one of the nodes to cause a redraw.
However, you should profile your application and make sure that notification is taking a significant amount of time before going to the trouble of manually controlling notification.
public java.lang.String get()
SoField.get()
method to get a field's value as a string even if has its default value.public java.lang.String getFieldName(SoField field)
Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com