/// <summary> /// Combines two surfaces using the operator of this binary expression /// </summary> /// <param name="leftSurface"></param> /// <param name="rightSurface"></param> /// <returns></returns> private Functions.Surface combineSurface(Functions.Surface leftSurface, Functions.Surface rightSurface) { Functions.Surface retVal = null; switch (Operation) { case BinaryExpression.OPERATOR.ADD: retVal = leftSurface.AddSurface(rightSurface); break; case BinaryExpression.OPERATOR.SUB: retVal = leftSurface.SubstractSurface(rightSurface); break; case BinaryExpression.OPERATOR.MULT: retVal = leftSurface.MultiplySurface(rightSurface); break; case BinaryExpression.OPERATOR.DIV: retVal = leftSurface.DivideSurface(rightSurface); break; } return retVal; }