forked from kscience/visionforge
GDML update
This commit is contained in:
parent
5c8665ac3e
commit
4865c76158
@ -1,7 +1,6 @@
|
|||||||
package hep.dataforge.vis.spatial
|
package hep.dataforge.vis.spatial
|
||||||
|
|
||||||
import hep.dataforge.context.Global
|
import hep.dataforge.context.Global
|
||||||
import hep.dataforge.meta.buildMeta
|
|
||||||
import hep.dataforge.meta.number
|
import hep.dataforge.meta.number
|
||||||
import hep.dataforge.meta.set
|
import hep.dataforge.meta.set
|
||||||
import hep.dataforge.vis.ApplicationBase
|
import hep.dataforge.vis.ApplicationBase
|
||||||
@ -56,12 +55,7 @@ class ThreeDemoApp : ApplicationBase() {
|
|||||||
// }
|
// }
|
||||||
gdml {
|
gdml {
|
||||||
y = 110.0
|
y = 110.0
|
||||||
shape = buildMeta {
|
shape = box(50, 50, 50)
|
||||||
"_typename" to "TGeoBBox"
|
|
||||||
"fDX" to 50.0
|
|
||||||
"fDY" to 50.0
|
|
||||||
"fDZ" to 50.0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package hep.dataforge.vis.spatial.gdml
|
|||||||
import hep.dataforge.meta.EmptyMeta
|
import hep.dataforge.meta.EmptyMeta
|
||||||
import hep.dataforge.meta.Meta
|
import hep.dataforge.meta.Meta
|
||||||
import hep.dataforge.meta.MetaItem
|
import hep.dataforge.meta.MetaItem
|
||||||
|
import hep.dataforge.meta.buildMeta
|
||||||
import hep.dataforge.vis.*
|
import hep.dataforge.vis.*
|
||||||
import hep.dataforge.vis.spatial.GenericThreeBuilder
|
import hep.dataforge.vis.spatial.GenericThreeBuilder
|
||||||
import hep.dataforge.vis.spatial.Materials
|
import hep.dataforge.vis.spatial.Materials
|
||||||
@ -19,6 +20,37 @@ class GDMLObject(parent: DisplayObject?, meta: Meta) : DisplayLeaf(parent, TYPE,
|
|||||||
|
|
||||||
var facesLimit by int(0)
|
var facesLimit by int(0)
|
||||||
|
|
||||||
|
fun box(xSize: Number, ySize: Number, zSize: Number) = buildMeta {
|
||||||
|
"_typename" to "TGeoBBox"
|
||||||
|
"fDX" to xSize
|
||||||
|
"fDY" to ySize
|
||||||
|
"fDZ" to zSize
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a GDML union
|
||||||
|
*/
|
||||||
|
operator fun Meta.plus(other: Meta) = buildMeta {
|
||||||
|
"fNode.fLeft" to this
|
||||||
|
"fNode.fRight" to other
|
||||||
|
"fNode._typename" to "TGeoUnion"
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a GDML subtraction
|
||||||
|
*/
|
||||||
|
operator fun Meta.minus(other: Meta) = buildMeta {
|
||||||
|
"fNode.fLeft" to this
|
||||||
|
"fNode.fRight" to other
|
||||||
|
"fNode._typename" to "TGeoSubtraction"
|
||||||
|
}
|
||||||
|
|
||||||
|
infix fun Meta.intersect(other: Meta) = buildMeta {
|
||||||
|
"fNode.fLeft" to this
|
||||||
|
"fNode.fRight" to other
|
||||||
|
"fNode._typename" to "TGeoIntersection"
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TYPE = "geometry.spatial.gdml"
|
const val TYPE = "geometry.spatial.gdml"
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user