v0.2.0-dev-22 #47
@ -1,67 +0,0 @@
|
|||||||
import hep.dataforge.context.Context
|
|
||||||
import hep.dataforge.context.Global
|
|
||||||
import hep.dataforge.meta.DFExperimental
|
|
||||||
import hep.dataforge.vision.client.VisionClient
|
|
||||||
import hep.dataforge.vision.client.renderAllVisions
|
|
||||||
import hep.dataforge.vision.plotly.PlotlyPlugin
|
|
||||||
import hep.dataforge.vision.solid.three.ThreePlugin
|
|
||||||
import kotlinx.browser.window
|
|
||||||
|
|
||||||
//fun RBuilder.threeCanvas(object3D: Solid, options: Canvas3DOptions.() -> Unit = {}) {
|
|
||||||
// child(ThreeCanvasComponent) {
|
|
||||||
// attrs {
|
|
||||||
// this.obj = object3D
|
|
||||||
// this.options = Canvas3DOptions(options)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//private class PlayGroundApp : Application {
|
|
||||||
//
|
|
||||||
// override fun start(state: Map<String, Any>) {
|
|
||||||
//
|
|
||||||
// val element =
|
|
||||||
// document.getElementById("app") as? HTMLElement ?: error("Element with id 'canvas' not found on page")
|
|
||||||
//
|
|
||||||
// val obj = SolidGroup().apply {
|
|
||||||
// box(100, 100, 100, name = "A")
|
|
||||||
// group("B") {
|
|
||||||
// position = Point3D(120, 0, 0)
|
|
||||||
// box(100, 100, 100, name = "C")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// render(element) {
|
|
||||||
// div("row") {
|
|
||||||
// div("col-3") {
|
|
||||||
// objectTree(obj)
|
|
||||||
// }
|
|
||||||
// div("col-6") {
|
|
||||||
// threeCanvas(obj)
|
|
||||||
// }
|
|
||||||
// div("col-3") {
|
|
||||||
// visionPropertyEditor(obj)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
|
|
||||||
public val visionContext: Context = Global.context("VISION") {
|
|
||||||
plugin(ThreePlugin)
|
|
||||||
plugin(PlotlyPlugin)
|
|
||||||
plugin(VisionClient)
|
|
||||||
}
|
|
||||||
|
|
||||||
@DFExperimental
|
|
||||||
fun main() {
|
|
||||||
//Loading three-js renderer
|
|
||||||
val clientManager = visionContext.plugins.fetch(VisionClient)
|
|
||||||
|
|
||||||
//Fetch from server and render visions for all outputs
|
|
||||||
window.onload = {
|
|
||||||
clientManager.renderAllVisions()
|
|
||||||
}
|
|
||||||
//startApplication(::PlayGroundApp)
|
|
||||||
}
|
|
27
playground/src/jsMain/kotlin/playgroundMain.kt
Normal file
27
playground/src/jsMain/kotlin/playgroundMain.kt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import hep.dataforge.context.Context
|
||||||
|
import hep.dataforge.context.Global
|
||||||
|
import hep.dataforge.meta.DFExperimental
|
||||||
|
import hep.dataforge.vision.client.VisionClient
|
||||||
|
import hep.dataforge.vision.client.renderAllVisions
|
||||||
|
import hep.dataforge.vision.plotly.PlotlyPlugin
|
||||||
|
import hep.dataforge.vision.solid.three.ThreePlugin
|
||||||
|
import kotlinx.browser.window
|
||||||
|
|
||||||
|
@DFExperimental
|
||||||
|
fun main() {
|
||||||
|
|
||||||
|
val visionContext: Context = Global.context("VISION") {
|
||||||
|
plugin(ThreePlugin)
|
||||||
|
plugin(PlotlyPlugin)
|
||||||
|
plugin(VisionClient)
|
||||||
|
}
|
||||||
|
|
||||||
|
//Loading three-js renderer
|
||||||
|
val clientManager = visionContext.plugins.fetch(VisionClient)
|
||||||
|
|
||||||
|
//Fetch from server and render visions for all outputs
|
||||||
|
window.onload = {
|
||||||
|
clientManager.renderAllVisions()
|
||||||
|
}
|
||||||
|
//startApplication(::PlayGroundApp)
|
||||||
|
}
|
@ -32,7 +32,7 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
visionContext.makeVisionFile(
|
VisionForge.makeVisionFile(
|
||||||
fragment,
|
fragment,
|
||||||
Paths.get("randomSpheres.html"),
|
Paths.get("randomSpheres.html"),
|
||||||
resourceLocation = ResourceLocation.EMBED
|
resourceLocation = ResourceLocation.EMBED
|
||||||
|
@ -17,7 +17,7 @@ import java.nio.file.Path
|
|||||||
* A global vision context used to resolve different vision renderers
|
* A global vision context used to resolve different vision renderers
|
||||||
*/
|
*/
|
||||||
@DFExperimental
|
@DFExperimental
|
||||||
public val visionContext: Context = Global.context("VISION") {
|
public val VisionForge: Context = Global.context("VISION") {
|
||||||
plugin(VisionManager)
|
plugin(VisionManager)
|
||||||
plugin(SolidManager)
|
plugin(SolidManager)
|
||||||
}
|
}
|
||||||
|
@ -15,5 +15,5 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
visionContext.makeVisionFile(fragment = fragment, resourceLocation = ResourceLocation.SYSTEM)
|
VisionForge.makeVisionFile(fragment = fragment, resourceLocation = ResourceLocation.SYSTEM)
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user