MhBehavior
Overview
MhBehavior
is the base class for all behaviors in the abstract. A behavior is an object that is attached to a MhSnapper
and controls a part of it's behavior. MhBehavior
s are responsible for controlling many different aspects of a MhSnapper
such as it's graphics, parts, animations, and other functionality that is typically controlled by overriding methods on Snapper
.
Types of MhBehavior
Many pre-existing behavior classes exist to be extended and built upon to create custom behaviors. These classes should be used to isolate specific functionality. For example, the MhGenericGfxBehavior
should be used for behaviors relating to Snapper
graphics. The pre-existing behavior classes are as follows:
MhGenericGfxbehavior
The class MhGenericGfxBehavior
should be used for any behavior intended to add graphics to an MhSnapper
. This class provides default implementations of many methods that are typically overridden on Snapper
to control graphics.
Important Methods
Method | Description |
---|---|
GMaterial3D getMaterial3D(MhSnapper owner, str layer) |
Returns the material to be used for the given layer on the given MhSnapper . |
SymNode buildSym(CoreObject owner) |
Built the cm.sym graphics for the given MhSnapper . |
LayerExpr visibility(CoreObject owner) |
Returns the LayerExpr which controls graphics visibility. |
MhPartBehavior
The class MhPartBehavior
should be used for any behavior intended to generate parts for the product represented by the MhSnapper
. This class provides default implementations of many methods that are typically overridden on Snapper
to control parts.
Important Methods
Method | Description |
---|---|
void appendParts(Object owner, PartsEnv env, Part main) |
Appends parts to the given PartsEnv for the owning MhSnapper . |
MhEngineBehavior
The MhEngineBehavior
class generates MhEngineEntry
s for the MhSnapper
that it is attached to.
MhAnimationBehavior
The MhAnimationBehavior
class is used to provide a SnapperAnimationBehavior
to the MhSnapper
that it is attached to. The SnapperAnimationBehavior
is used to provide Animation
s usually provided by overriding methods on Snapper
. These control the Animation
class used for insertion, dragging, stretching as well as others.
Other Behaviors
Other default implementations of behaviors exist, these include, but are not limited to
-
MhArrowBehavior
- Behavior for configuring graphical arrows during animations. -
MhConfigBehavior
- Custom behavior for defining configuration equivalency
Many other MhBehaviors
can be found in the cm.abstract.materialHandling.behavior
package. ``
Comments
0 comments
Please sign in to leave a comment.