public class VectorVertexField<T extends VectorObject<T>> extends VectorMeshField<T>
T
, which must be an
instance of VectorObject
.ModelComponent.NavpanelVisibility
myProps
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
VectorVertexField(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. |
VectorVertexField(java.lang.Class<T> type,
MeshComponent mcomp)
Constructs a field for a given mesh, with a default value of 0.
|
VectorVertexField(java.lang.Class<T> type,
MeshComponent mcomp,
T defaultValue)
Constructs a field for a given mesh and default value.
|
VectorVertexField(java.lang.String name,
java.lang.Class<T> type,
MeshComponent mcomp)
Constructs a named field for a given mesh, with a default value of 0.
|
VectorVertexField(java.lang.String name,
java.lang.Class<T> type,
MeshComponent mcomp,
T defaultValue)
Constructs a named field for a given mesh 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 |
clearValue(Vertex3d vtx)
Clears the value at a given vertex.
|
T |
getValue(int vidx)
Returns the value at the vertex specified by a given index.
|
T |
getValue(MeshFieldPoint fp)
Returns the value of the this field at a specified mesh field point.
|
T |
getValue(Point3d pos)
Returns the value of the this field at a specified spatial position.
|
T |
getValue(Vertex3d vtx)
Returns the value at a vertex.
|
boolean |
isValueSet(Vertex3d vtx)
Queries whether a value has been seen at a given vertex.
|
void |
postscan(java.util.Deque<ScanToken> tokens,
CompositeComponent ancestor)
Performs any required post-scanning for this component.
|
void |
setValue(Vertex3d vtx,
T value)
Sets the value at a vertex.
|
createDefaultRenderProps, createRenderProps, createTypeInstance, getAllPropertyInfo, getDefaultValue, getParameterType, getRenderScale, getValue, hasParameterizedType, prerender, render, setDefaultValue, setRenderScale
clearCacheIfNecessary, createFieldPoint, getHardReferences, getMesh, getMeshComp, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateBounds
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, 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, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearCacheIfNecessary
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
isWritable, write
getSelection, isSelectable, numSelectionQueriesNeeded
getRenderHints, updateBounds
getRenderProps, setRenderProps
public VectorVertexField(java.lang.Class<T> type)
ModelComponentBase.scan(maspack.util.ReaderTokenizer, java.lang.Object)
is called immediately after.public VectorVertexField(java.lang.Class<T> type, MeshComponent mcomp)
PolygonalMesh
.type
- class type of the VectorObject
describing the field's
valuesmcomp
- component containing the mesh associated with the fieldpublic VectorVertexField(java.lang.Class<T> type, MeshComponent mcomp, T defaultValue)
PolygonalMesh
.type
- class type of the VectorObject
describing the field's
valuesmcomp
- component containing the mesh associated with the fielddefaultValue
- default value for vertices which don't have
explicitly set valuespublic VectorVertexField(java.lang.String name, java.lang.Class<T> type, MeshComponent mcomp)
PolygonalMesh
.name
- name of the fieldtype
- class type of the VectorObject
describing the field's
valuesmcomp
- component containing the mesh associated with the fieldpublic VectorVertexField(java.lang.String name, java.lang.Class<T> type, MeshComponent mcomp, T defaultValue)
PolygonalMesh
.name
- name of the fieldtype
- class type of the VectorObject
describing the field's
valuesmcomp
- component containing the mesh associated with the fielddefaultValue
- default value for vertices which don't have
explicitly set valuespublic T getValue(int vidx)
vidx
- vertex indexpublic T getValue(Vertex3d vtx)
vtx
- vertex for which the value is requestedpublic T getValue(Point3d pos)
getValue
in interface VectorFieldComponent<T extends VectorObject<T>>
getValue
in class VectorMeshField<T extends VectorObject<T>>
pos
- position at which value is requestedpublic T getValue(MeshFieldPoint fp)
fp
- point at which value is requestedpublic void setValue(Vertex3d vtx, T value)
vtx
- vertex for which the value is to be setvalue
- new value for the vertexpublic boolean isValueSet(Vertex3d vtx)
vtx
- vertex being queriedtrue
if a value has been set at the vertexpublic void clearValue(Vertex3d vtx)
vtx
- vertex whose value is to be clearedpublic void clearAllValues()
defaultValue
.clearAllValues
in class VectorMeshField<T extends VectorObject<T>>
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)