0.2.0 #71

Merged
altavir merged 139 commits from dev into master 2022-01-24 09:44:18 +03:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 42eb0a6f66 - Show all commits

View File

@ -215,7 +215,7 @@ private class GdmlLoader(val settings: GdmlLoaderOptions) {
val first: GdmlSolid = solid.first.resolve(root) ?: error("") val first: GdmlSolid = solid.first.resolve(root) ?: error("")
val second: GdmlSolid = solid.second.resolve(root) ?: error("") val second: GdmlSolid = solid.second.resolve(root) ?: error("")
val type: CompositeType = when (solid) { 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 GdmlSubtraction -> CompositeType.SUBTRACT
is GdmlIntersection -> CompositeType.INTERSECT is GdmlIntersection -> CompositeType.INTERSECT
} }

View File

@ -32,7 +32,9 @@ public inline fun VisionContainerBuilder<Solid>.composite(
): Composite { ): Composite {
val group = SolidGroup().apply(builder) val group = SolidGroup().apply(builder)
val children = group.children.values.filterIsInstance<Solid>() 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]) val res = Composite(type, children[0], children[1])
res.meta.update(group.meta) res.meta.update(group.meta)