public interface CopyableComponent extends ModelComponent
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static int |
COPY_REFERENCES
Indicates that any referenced model components should themselves
be copied.
|
static int |
REST_POSITION
For deformable components (such as FEM models), indicates that the
copy should be made in the component's rest position.
|
Modifier and Type | Method and Description |
---|---|
ModelComponent |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
Collects external references which must also be copied in order to
duplicate this component.
|
boolean |
isDuplicatable()
Returns true if this component can be duplicated.
|
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getAllPropertyInfo, getProperty
getChildren, hasChildren
postscan
isWritable, write
static final int COPY_REFERENCES
static final int REST_POSITION
ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
COPY_REFERENCES
is set in flags
, then any component referenced
by this component should itself be set to a copy. This
should be done first checking copyMap
for an
existing copy of the referenced component. If there is no existing
copy, then a copy should be created by calling copy
recursively and adding the new copy to copyMap
.flags
- flags to control the copyingcopyMap
- map to possible existing instances of referenced
componentsboolean isDuplicatable()
true
if and only if getCopyReferences(java.util.List<artisynth.core.modelbase.ModelComponent>, artisynth.core.modelbase.ModelComponent)
returns true.
This method is not currently used. It is intended to provide a faster
way of determining if a component can be duplicated, without having to
use getCopyReferences(java.util.List<artisynth.core.modelbase.ModelComponent>, artisynth.core.modelbase.ModelComponent)
to build the list of copy references.
true
if this component can be duplicated.boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
true
if and only if isDuplicatable()
returns
true.refs
- list to which references are appendedancestor
- root node of the hierarchy from which references are to be excluded