feature/root #69
@ -4,6 +4,7 @@ import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import space.kscience.visionforge.VisionBuilder
|
||||
import space.kscience.visionforge.VisionContainerBuilder
|
||||
import space.kscience.visionforge.VisionPropertyContainer
|
||||
import space.kscience.visionforge.set
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.cos
|
||||
@ -23,7 +24,7 @@ public class ConeSurface(
|
||||
public val topInnerRadius: Float,
|
||||
public val startAngle: Float = 0f,
|
||||
public val angle: Float = PI2,
|
||||
) : SolidBase(), GeometrySolid {
|
||||
) : SolidBase(), GeometrySolid, VisionPropertyContainer<ConeSurface> {
|
||||
|
||||
init {
|
||||
require(bottomRadius > 0) { "Cone surface bottom radius must be positive" }
|
||||
|
@ -3,11 +3,12 @@ package space.kscience.visionforge.solid
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import space.kscience.visionforge.VisionContainerBuilder
|
||||
import space.kscience.visionforge.VisionPropertyContainer
|
||||
import space.kscience.visionforge.set
|
||||
|
||||
@Serializable
|
||||
@SerialName("solid.convex")
|
||||
public class Convex(public val points: List<Point3D>) : SolidBase(), Solid
|
||||
public class Convex(public val points: List<Point3D>) : SolidBase(), VisionPropertyContainer<Convex>
|
||||
|
||||
public inline fun VisionContainerBuilder<Solid>.convex(name: String? = null, action: ConvexBuilder.() -> Unit = {}): Convex =
|
||||
ConvexBuilder().apply(action).build().also { set(name, it) }
|
||||
|
@ -5,14 +5,11 @@ import kotlinx.serialization.Serializable
|
||||
import space.kscience.dataforge.names.Name
|
||||
import space.kscience.dataforge.names.asName
|
||||
import space.kscience.dataforge.names.plus
|
||||
import space.kscience.visionforge.VisionBuilder
|
||||
import space.kscience.visionforge.VisionContainerBuilder
|
||||
import space.kscience.visionforge.numberProperty
|
||||
import space.kscience.visionforge.set
|
||||
import space.kscience.visionforge.*
|
||||
|
||||
@Serializable
|
||||
@SerialName("solid.line")
|
||||
public class PolyLine(public val points: List<Point3D>) : SolidBase(), Solid {
|
||||
public class PolyLine(public val points: List<Point3D>) : SolidBase(), VisionPropertyContainer<PolyLine> {
|
||||
|
||||
//var lineType by string()
|
||||
public var thickness: Number by numberProperty(name = SolidMaterial.MATERIAL_KEY + THICKNESS_KEY) { 1.0 }
|
||||
|
@ -4,6 +4,7 @@ import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import space.kscience.visionforge.VisionBuilder
|
||||
import space.kscience.visionforge.VisionContainerBuilder
|
||||
import space.kscience.visionforge.VisionPropertyContainer
|
||||
import space.kscience.visionforge.set
|
||||
|
||||
@Serializable
|
||||
@ -12,7 +13,7 @@ public class SolidLabel(
|
||||
public val text: String,
|
||||
public val fontSize: Double,
|
||||
public val fontFamily: String,
|
||||
) : SolidBase(), Solid
|
||||
) : SolidBase(), VisionPropertyContainer<SolidLabel>
|
||||
|
||||
@VisionBuilder
|
||||
public fun VisionContainerBuilder<Solid>.label(
|
||||
|
Loading…
Reference in New Issue
Block a user