artisynth.core.mechmodels
Class CollisionComponent

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.mechmodels.CollisionComponent
All Implemented Interfaces:
ModelComponent, java.lang.Cloneable, HasProperties, HierarchyNode, Scannable

public class CollisionComponent
extends ModelComponentBase

Internal model component that contains collision behavior information for a particular collision pair. This model component is not normally directly exposed to the application.


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Constructor Summary
CollisionComponent()
           
CollisionComponent(Collidable a, Collidable b, CollisionBehavior behavior)
           
CollisionComponent(CollidablePair pair, CollisionBehavior behavior)
           
 
Method Summary
 boolean equalValues(CollisionComponent r)
          Returns true if the settings of this collision component are equal to the settings another.
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 CollisionBehavior getBehavior()
          Returns the behavior associated with this collision component.
 Collidable getCollidableA()
           
 Collidable getCollidableB()
           
 double getFriction()
           
 void getHardReferences(java.util.List<ModelComponent> refs)
          Appends all hard references for this component to a list.
 CollidablePair getPair()
          Returns the pair of Collidables associated with this collision component.
 boolean isEnabled()
           
 void setBehavior(CollisionBehavior v)
           
 void setEnabled(boolean enabled)
           
 void setFriction(double mu)
           
 void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref)
          Writes a text description of this element to a PrintWriter.
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

CollisionComponent

public CollisionComponent()

CollisionComponent

public CollisionComponent(Collidable a,
                          Collidable b,
                          CollisionBehavior behavior)

CollisionComponent

public CollisionComponent(CollidablePair pair,
                          CollisionBehavior behavior)
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class ModelComponentBase
Returns:
static information for all exported properties

setBehavior

public void setBehavior(CollisionBehavior v)

getBehavior

public CollisionBehavior getBehavior()
Returns the behavior associated with this collision component.

Returns:
behavior (should not be modified).

getPair

public CollidablePair getPair()
Returns the pair of Collidables associated with this collision component.

Returns:
Collidable pair (should not be modified).

getFriction

public double getFriction()

setFriction

public void setFriction(double mu)

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enabled)

equalValues

public boolean equalValues(CollisionComponent r)
Returns true if the settings of this collision component are equal to the settings another.

Parameters:
r - component to test
Returns:
true if the settings of this and r are equal

write

public void write(java.io.PrintWriter pw,
                  NumberFormat fmt,
                  java.lang.Object ref)
           throws java.io.IOException
Description copied from class: ModelComponentBase
Writes a text description of this element to a PrintWriter. The text description should be compatable with scan and complete enough to allow full reconstruction of the element.

Specified by:
write in interface Scannable
Overrides:
write in class ModelComponentBase
Parameters:
pw - stream for writing the element
fmt - numeric formating information
ref - optional reference object which can be used for producing references to other objects
Throws:
java.io.IOException - if an I/O error occured

getHardReferences

public void getHardReferences(java.util.List<ModelComponent> refs)
Description copied from class: ModelComponentBase
Appends all hard references for this component to a list. References are other components, outside of this component's immediate ancestry, on which this component depends. For example, an AxialSpring refers to two Point components as for it's end points. A hard reference is one which the referring component must have, and which if deleted, implies that the referring component should be deleted too.

Specified by:
getHardReferences in interface ModelComponent
Overrides:
getHardReferences in class ModelComponentBase
Parameters:
refs - list to which hard references are appended

getCollidableA

public Collidable getCollidableA()

getCollidableB

public Collidable getCollidableB()