Beispiel #1
0
        //align your body_part and your body_part;
        public override Wrapper VisitAlign_restriction(PreposeGesturesParser.Align_restrictionContext context)
        {
            var target = (JointGroup)this.Visit(context.body_part()[context.body_part().Count - 1]);

            CompositeBodyRestriction restriction = new CompositeBodyRestriction();

            for (int i = 0; i < context.body_part().Count - 1; ++i)
            {
                var joint = (JointGroup)this.Visit(context.body_part()[i]);

                restriction = restriction.And(
                    target.Aggregate(j2 =>
                                     joint.Aggregate(j1 => new AlignBodyRestriction(j1, j2, 20, dont))));
            }

            return(new Wrapper(restriction));
        }
Beispiel #2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="PreposeGesturesParser.align_restriction"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitAlign_restriction([NotNull] PreposeGesturesParser.Align_restrictionContext context)
 {
 }
 /// <summary>
 /// Visit a parse tree produced by <see cref="PreposeGesturesParser.align_restriction"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitAlign_restriction([NotNull] PreposeGesturesParser.Align_restrictionContext context)
 {
     return(VisitChildren(context));
 }