public class VectorNodalField<T extends VectorObject<T>> extends VectorFemField<T>
T
, which must be an instance of VectorObject
.ModelComponent.NavpanelVisibility
myProps
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
VectorNodalField(java.lang.Class<T> type)
This constructor should not be called by applications, unless
ModelComponentBase.scan(maspack.util.ReaderTokenizer, java.lang.Object) is called immediately after. |
VectorNodalField(java.lang.Class<T> type,
FemModel3d fem)
Constructs a field for a given FEM model, with a default value of 0.
|
VectorNodalField(java.lang.Class<T> type,
FemModel3d fem,
T defaultValue)
Constructs a field for a given FEM model and default value.
|
VectorNodalField(java.lang.String name,
java.lang.Class<T> type,
FemModel3d fem)
Constructs a named field for a given FEM model, with a default value of 0.
|
VectorNodalField(java.lang.String name,
java.lang.Class<T> type,
FemModel3d fem,
T defaultValue)
Constructs a named field for a given FEM model and default value.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAllValues()
Clear all values defined for the features (e.g., vertices, faces)
associated with this field.
|
void |
clearCacheIfNecessary()
Used internally by the system to clear cached values
for subclasses that support value caching.
|
void |
clearValue(FemNode3d node)
Clears the value at a given node.
|
boolean |
equals(VectorNodalField<T> field)
Returns
true if this field is functionally equal to another field. |
void |
getSoftReferences(java.util.List<ModelComponent> refs)
Appends all soft references for this component to a list.
|
T |
getValue(FemFieldPoint fp)
Returns the value of the this field at a specified FEM field point.
|
T |
getValue(FemNode3d node)
Returns the value at a node.
|
T |
getValue(int nodeNum)
Returns the value at the node specified by the given number.
|
T |
getValue(int[] nodeNums,
double[] weights) |
T |
getValue(Point3d pos)
Returns the value of the this field at a specified spatial position.
|
boolean |
isValueSet(FemNode3d node)
Queries whether a value has been seen at a given node.
|
void |
postscan(java.util.Deque<ScanToken> tokens,
CompositeComponent ancestor)
Performs any required post-scanning for this component.
|
void |
setValue(FemNode3d node,
T value)
Sets the value at a node.
|
void |
updateReferences(boolean undo,
java.util.Deque<java.lang.Object> undoInfo)
May be called by the system if any of the soft references for
this component are removed from the the component hierarchy.
|
createDefaultRenderProps, createRenderProps, createTypeInstance, equals, getAllPropertyInfo, getDefaultValue, getParameterType, getRenderScale, getValue, hasParameterizedType, prerender, render, setDefaultValue, setRenderScale
equals, getFemModel, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateBounds
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, hasChildren, hasState, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable
getProperty
getChildren, hasChildren
isWritable, write
getSelection, isSelectable, numSelectionQueriesNeeded
getRenderHints, updateBounds
getRenderProps, setRenderProps
public VectorNodalField(java.lang.Class<T> type)
ModelComponentBase.scan(maspack.util.ReaderTokenizer, java.lang.Object)
is called immediately after.public VectorNodalField(java.lang.Class<T> type, FemModel3d fem)
type
- class type of the VectorObject
describing the field'sfem
- FEM model over which the field is definedpublic VectorNodalField(java.lang.Class<T> type, FemModel3d fem, T defaultValue)
type
- class type of the VectorObject
describing the field's
valuesfem
- FEM model over which the field is defineddefaultValue
- default value for nodes which don't have
explicitly set valuespublic VectorNodalField(java.lang.String name, java.lang.Class<T> type, FemModel3d fem)
name
- name of the fieldtype
- class type of the VectorObject
describing the field's
valuesfem
- FEM model over which the field is definedpublic VectorNodalField(java.lang.String name, java.lang.Class<T> type, FemModel3d fem, T defaultValue)
name
- name of the fieldtype
- class type of the VectorObject
describing the field's
valuesfem
- FEM model over which the field is defineddefaultValue
- default value for nodes which don't have
explicitly set valuespublic T getValue(int nodeNum)
nodeNum
- node numberpublic T getValue(FemNode3d node)
node
- node for which the value is requestedpublic T getValue(FemFieldPoint fp)
fp
- point at which value is requestedpublic T getValue(Point3d pos)
getValue
in interface VectorFieldComponent<T extends VectorObject<T>>
getValue
in class VectorFemField<T extends VectorObject<T>>
pos
- position at which value is requestedpublic void setValue(FemNode3d node, T value)
node
- node for which the value is to be setvalue
- new value for the nodepublic boolean isValueSet(FemNode3d node)
node
- node being queriedtrue
if a value has been set at the nodepublic void clearValue(FemNode3d node)
node
- node whose value is to be clearedpublic void clearAllValues()
defaultValue
.clearAllValues
in class VectorFemField<T extends VectorObject<T>>
public T getValue(int[] nodeNums, double[] weights)
public void postscan(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor) throws java.io.IOException
scan()
method and stored in the token queue.
The most common use of this method is to resolve the paths
of component references, which may not have been created
at the time of the initial scan()
call.postscan
in interface PostScannable
postscan
in class ModelComponentBase
tokens
- token information that was stored during
scan()
.ancestor
- ancestor component with respect to which
reference component paths are defined.java.io.IOException
- if an error is encountered (such as a reference to a
non-existent component)public void getSoftReferences(java.util.List<ModelComponent> refs)
updateReferences()
method will
be called to update its internal reference information.getSoftReferences
in interface ModelComponent
getSoftReferences
in class ModelComponentBase
refs
- list to which soft references are appendedpublic void updateReferences(boolean undo, java.util.Deque<java.lang.Object> undoInfo)
undo
equal to false
,
this component should then examine its soft references and
use ComponentUtils.areConnected()
to determine which of them have been disconnected from the hierarchy.
Disconnected references should be removed, and sufficient information
should be appended to undoInfo
to allow this update
to be undone if this method is called later with undo
equal to true
. When undoing an update, the undo
information should be removed from the front of undoInfo
.updateReferences
in interface ModelComponent
updateReferences
in class ModelComponentBase
undo
- if true
, indicates that the most
recent reference update should be undone, using the supplied
undo information.undoInfo
- if undo
is false
, should be used
to store information allowing the reference update to be undone.
Otherwise, if undo
is true
, then this
supplied information to undo the most recent update.public void clearCacheIfNecessary()
clearCacheIfNecessary
in interface FieldComponent
clearCacheIfNecessary
in class FemFieldComp
public boolean equals(VectorNodalField<T> field)
true
if this field is functionally equal to another field.
Intended mainly for testing and debugging.