All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ExpressionDelegate.kt Maven / Gradle / Ivy

package org.openrndr.extra.expressions

import org.openrndr.extra.propertywatchers.watchingProperty
import kotlin.reflect.KProperty0

fun watchingExpression1(
    expressionProperty: KProperty0,
    parameter0: String = "x",
    constants: Map = emptyMap(),
    functions: FunctionExtensions = FunctionExtensions.EMPTY,
    error: (p0: Double) -> Double = { 0.0 }
) =
    watchingProperty(expressionProperty) {
        compileFunction1(it, parameter0, constants, functions, error)
    }

fun watchingExpression2(
    expressionProperty: KProperty0,
    parameter0: String = "x",
    parameter1: String = "y",
    constants: Map = emptyMap(),
    functions: FunctionExtensions = FunctionExtensions.EMPTY,
    error: (p0: Double, p1: Double) -> Double = { _, _ -> 0.0 }
) =
    watchingProperty(expressionProperty) {
        compileFunction2(it, parameter0, parameter1, constants, functions, error)
    }

fun watchingExpression3(
    expressionProperty: KProperty0,
    parameter0: String = "x",
    parameter1: String = "y",
    parameter2: String = "z",
    constants: Map = emptyMap(),
    functions: FunctionExtensions = FunctionExtensions.EMPTY,
    error: (p0: Double, p1: Double, p2: Double) -> Double = { _, _, _ -> 0.0 }
) =
    watchingProperty(expressionProperty) {
        compileFunction3(it, parameter0, parameter1, parameter2, constants, functions, error)
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy