rp1.rossum
Class RsBodyPart
java.lang.Object
rp1.rossum.RsComponent
rp1.rossum.RsBodyPart
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- RsActuator, RsBodyArt, RsBodyShape
public abstract class RsBodyPart
- extends RsComponent
The abstract base class for all body parts.
The RsBodyPart class defines two general states for body parts: hot and cold.
These states are mainly used for rendering purposes. An application can
define different sets of color specifications depending on what state
a body part is set. These color settings include
- lineColor for edges
- fillColor for area fills
- hotLineColor for edges when body part is in hot state
- hotFillColor for area fills when body part is hot state
The interpretation of these states differs depending on the derived classes.
For a sensor class, the hot state occurs when the sensors register a detection,
the cold state when they register no detection. For example, when a contact
sensor in pressed against an object, it switches to its hot state.
For the body-painter class, the body part goes to its hot state when the
painter is activated. Actuators (motors and wheels) would be "hot" when they
are activated. For some body parts, the hot state is not currently assigned an
interpretation for the hot state.
As mentioned above, in either hot or cold state,
RsBodyPart objects may be assigned two color values for rendering: the
fill color (applies to polygonal forms only) and the line color.
If these parameters are assigned null values, then the related
feature, if any, will not be rendered. When a fill is performed, the line color
may be used to add a contrasting edge to polygonal
features. Even if you prefer not to add a contrasting edge, you may want to
specify a line color with the same value as the fill color.
One many graphics systems, the area-fill algorithm used for polygons
sometimes cover slightly less extent than the lines that define their boundaries.
So if you "fill" two adjacent polygons, you may find slight
gaps between them unless you also "draw" their edge lines.
By default both the line and fill color values are defined to be
Color.lightGray. If you prefer not to render a particular feature
you may use the RsBodyPart.setFillColor() and RsBodyPart.setLineColor
methods to assign null values (which will suppress drawing). Even if
a feature is not assigned a color value (and is not visible) it will
be used in modeling.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RsBodyPart
public RsBodyPart()
setFillColor
public void setFillColor(java.awt.Color colorRef)
setLineColor
public void setLineColor(java.awt.Color colorRef)
setHotFillColor
public void setHotFillColor(java.awt.Color c)
setHotLineColor
public void setHotLineColor(java.awt.Color c)
getLineColor
public java.awt.Color getLineColor()
getFillColor
public java.awt.Color getFillColor()
isASensor
public boolean isASensor()
searchForCollisions
public boolean searchForCollisions(RsPlan plan,
RsMotion motion)
paint
public void paint(java.awt.Graphics g,
RsTransform gt)
setName
public void setName(java.lang.String nameReference)
getName
public java.lang.String getName()
getID
public int getID()
copyStateData
public void copyStateData(RsBodyPart dataSource)
resetStateData
public void resetStateData()
- resetStateData is usually called when a placement is established.
it is implemented as a do-nothing and overridden by derived
classes according to their specific behaviors
setHot
public void setHot(boolean status)
getHot
public boolean getHot()