v0.2.0-dev-22 #47

Merged
altavir merged 158 commits from dev into master 2021-07-17 11:04:22 +03:00
5 changed files with 30 additions and 70 deletions
Showing only changes of commit 3f9f253416 - Show all commits

View File

@ -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)
}

View 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)
}

View File

@ -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

View File

@ -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)
} }

View File

@ -15,5 +15,5 @@ fun main() {
} }
} }
visionContext.makeVisionFile(fragment = fragment, resourceLocation = ResourceLocation.SYSTEM) VisionForge.makeVisionFile(fragment = fragment, resourceLocation = ResourceLocation.SYSTEM)
} }