Example #1
0
 public virtual T GetValue()
 {
     if (!Operators.Any() && Operands.Any())
     {
         return(Operands[0].Value);
     }
     else
     {
         return(default(T));
     }
 }
Example #2
0
        //--------------------------------------------------------------------------------------------------

        bool _DoInitContext(MakeContext context)
        {
            // We need a minimum of 2 source shapes
            if (Operands.Count < 2)
            {
                Messages.Error("This modifier needs at least two sketches defining the loft start and end sections.");
                return(false);
            }

            if (Operands.Any(op => op.GetShapeType() != ShapeType.Sketch))
            {
                Messages.Error("This modifier does only take sketches defining the loft sections as operands.");
                return(false);
            }

            return(true);
        }
Example #3
0
        //--------------------------------------------------------------------------------------------------

        #endregion

        #region Make

        protected override bool Skip()
        {
            ClearSubshapeLists();

            if (Operands.Any())
            {
                var baseBRep = GetOperandBRep(0);
                if (baseBRep != null)
                {
                    // Transform to local space if needed
                    BRep      = baseBRep;
                    HasErrors = false;
                    return(base.MakeInternal(MakeFlags.NoTransformation));
                }
                HasErrors = true;
                return(true);
            }
            return(base.Skip());
        }
 /// <inheritdoc/>
 public override bool CanThrow(IType exceptionType)
 {
     return(Operands.Any(op => op.CanThrow(exceptionType)));
 }