artisynth.core.modelbase
Interface MutableCompositeComponent<C extends ModelComponent>

All Superinterfaces:
ComponentChangeListener, CompositeComponent, HasProperties, HierarchyNode, IndexedComponentList, ModelComponent, Scannable
All Known Implementing Classes:
ArticulatedBeamBody, ArticulatedDemo, ArticulatedFem, AttachDemo, AttachedBeamDemo, AuxMaterialBundleList, AuxMaterialElementDescList, AxialSpringList, BlockTest, CollisionHandlerList, ColoredFemBeam3d, CompliantConstraintDemo, ComponentList, ConstrainedParticle, CoupledSolveDemo, DoubleArmDemo, FaceList, FallingSkull, Fem3dBlock, FemBeam3d, FemBeamMech, FemCollision, FemElement3dList, FemFrictionBeam, FemModel, FemModel3d, FemMuscleArm, FemMuscleDemo, FemMuscleModel, FemSingleTet, FemSkinDemo, FemSphere, FishDemo, ForceEffectorList, FrameSpringDemo, Hex3dBlock, HexBeam3d, HexFrame, HexIncompress, HexSheet, HydrostatDemo, HydrostatInvDemo, HydrostatModel, HydrostatTubeDemo, LaymanBowl, LaymanDemo, LaymanModel, LockingDemo, LumbarSpringDemo, MassSpringDemo, MechModel, MechModelCollide, MechModelDemo, MechSystemBase, MeshComponentList, MFreeAuxMaterialBundleList, MFreeAuxMaterialElementDescList, MFreeElement3dList, MFreeModel3d, MFreeMuscleBundleList, MFreeMuscleElementDescList, MFreeMuscleModel, ModelBase, MultiMuscleDemo, MultiPointSpringList, MultiSpringDemo, MuscleArm, MuscleBundleList, MuscleElementDescList, NetDemo, PlanarConnectorDemo, PlaneConstrainedFem, PointForceDemo, PointList, PointModel, PointModel1d, PointModel2d, PointModel3d, PointSpringList, PointToPointMuscle, PuddleDemo, PuppetDemo, QuadFishDemo, ReferenceList, RenderableComponentList, RenderableModelBase, RigidBodyCollision, RigidBodyDemo, RigidTentacle, RobustCube, RollPitchJointDemo, RootModel, ScalableList, SegmentedPlaneDemo, SelfCollision, SheetDemo, SimpleCollide, SingleHex, SinglePyramid, SingleQuadhex, SingleQuadpyramid, SingleQuadtet, SingleQuadwedge, SingleTet, SingleWedge, SkinDemo, SkullParticles, SphericalJointDemo, SpongeDemo, SpongeModel, SpringMeshDemo, Tentacle, TetBeam3d, TransformableList, VertexList, ViscousBeam

public interface MutableCompositeComponent<C extends ModelComponent>
extends CompositeComponent


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.CompositeComponent
CompositeComponent.NavpanelDisplay
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Method Summary
 boolean add(C comp)
          Adds a component to this MutableCompositeComponent.
 void addComponents(ModelComponent[] comps, int[] indices, int num)
          Adds a set of components to this MutableCompositeComponent.
 boolean remove(java.lang.Object comp)
          Removes a component from this MutableCompositeComponent, returning true if the componet was in fact found and removed.
 void removeComponents(ModelComponent[] comps, int[] indices, int num)
          Removes a set of components from this MutableCompositeComponent.
 
Methods inherited from interface artisynth.core.modelbase.CompositeComponent
componentChanged, findComponent, get, get, getByNumber, getNavpanelDisplay, getNumberLimit, hierarchyContainsReferences, indexOf, numComponents, updateNameMap
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getAllPropertyInfo, getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 

Method Detail

add

boolean add(C comp)
Adds a component to this MutableCompositeComponent. The component is placed in the last position and its index value is set accordingly.

Parameters:
comp - component to be added

addComponents

void addComponents(ModelComponent[] comps,
                   int[] indices,
                   int num)
Adds a set of components to this MutableCompositeComponent. This routine is intended to provide greater efficiency for adding a large number of components at one time. If the argument indices is not null, it specified the index locations at which the components should be added. It is up to the caller to insure that the specified index values make sense; in particular, they must not exceed the final size of the component and no two specified indices can be the same.

Parameters:
comps - list of components to be added
indices - (optional) index locations of components
num - number of components to be added

remove

boolean remove(java.lang.Object comp)
Removes a component from this MutableCompositeComponent, returning true if the componet was in fact found and removed.

Parameters:
comp - component to be added
Returns:
true if the component was removed

removeComponents

void removeComponents(ModelComponent[] comps,
                      int[] indices,
                      int num)
Removes a set of components from this MutableCompositeComponent. This routine is intended to provide greater efficiency for adding a large number of components at one time. If the argument indices is not null, it is used to return the indices where the components were located.

Parameters:
comps - components to be removed
indices - (optional) stores the indices of the removed components
num - number of components to be removed