#include "orconstraintdeformer_layout.h"
#define ORCONSTRAINTDEFORMER__LAYOUT ORConstraintDeformerLayout
ORCONSTRAINTDEFORMER__CLASSSTR,
bool ORConstraintDeformerLayout::FBCreate()
{
mConstraint = (ORConstraintDeformer*) (FBConstraint*) Constraint;
UICreate ();
UIConfigure ();
return true;
}
void ORConstraintDeformerLayout::FBDestroy()
{
}
void ORConstraintDeformerLayout::UICreate()
{
int lS, lH;
lS = 4;
lH = 18;
AddRegion ("LabelDirections", "LabelDirections",
AddRegion ("LabelMultiplier", "LabelMultiplier",
AddRegion ("EditNumberMultiplier","EditNumberMultiplier",
SetControl( "LabelDirections", mLabelDirections );
SetControl( "LabelMultiplier", mLabelMultiplier );
SetControl( "EditNumberMultiplier", mEditNumberMultiplier );
}
void ORConstraintDeformerLayout::UIConfigure()
{
mLabelDirections.Caption = "1. Create two models (markers are not models!).\n"
"2. Drag one to be the source, and one to be the destination\n"
"for the constraint.\n"
"3. Activate the constraint.\n"
"4. By dragging the source model around, you will some of the vertices\n"
"move according to the relation in the DeformerNotify() callback.\n"
"\n"
"N.B. The layout is under the \"Custom Setup\" panel because some reference\n"
"groups have been created for the constraint in the FBCreate() function.";
mLabelMultiplier.Caption = "Displacement Multiplier";
mEditNumberMultiplier.Value = mConstraint->GetMultiplier();
mEditNumberMultiplier.Precision = 3.3;
mEditNumberMultiplier.SmallStep = 0.001;
mEditNumberMultiplier.LargeStep = 0.010;
mEditNumberMultiplier.Min = 0.00;
mEditNumberMultiplier.Max = 10.00;
mEditNumberMultiplier.OnChange.Add(
this, (
FBCallback) &ORConstraintDeformerLayout::EventEditNumberChange );
}
void ORConstraintDeformerLayout::EventEditNumberChange(
HISender pSender,
HKEvent pEvent)
{
mConstraint->SetMultiplier( mEditNumberMultiplier.Value );
mEditNumberMultiplier.Value = mConstraint->GetMultiplier();
}