feature/root #69
@ -215,7 +215,7 @@ private class GdmlLoader(val settings: GdmlLoaderOptions) {
|
||||
val first: GdmlSolid = solid.first.resolve(root) ?: error("")
|
||||
val second: GdmlSolid = solid.second.resolve(root) ?: error("")
|
||||
val type: CompositeType = when (solid) {
|
||||
is GdmlUnion -> CompositeType.GROUP // dumb sum for better performance
|
||||
is GdmlUnion -> CompositeType.UNION // dumb sum for better performance
|
||||
is GdmlSubtraction -> CompositeType.SUBTRACT
|
||||
is GdmlIntersection -> CompositeType.INTERSECT
|
||||
}
|
||||
|
@ -32,7 +32,9 @@ public inline fun VisionContainerBuilder<Solid>.composite(
|
||||
): Composite {
|
||||
val group = SolidGroup().apply(builder)
|
||||
val children = group.children.values.filterIsInstance<Solid>()
|
||||
if (children.size != 2) error("Composite requires exactly two children, but found ${children.size}")
|
||||
if (children.size != 2){
|
||||
error("Composite requires exactly two children, but found ${children.size}")
|
||||
}
|
||||
val res = Composite(type, children[0], children[1])
|
||||
|
||||
res.meta.update(group.meta)
|
||||
|
Loading…
Reference in New Issue
Block a user