From f6a78c5a31df74189ac803efd1aafe83b9394fc2 Mon Sep 17 00:00:00 2001 From: kiruma524 Date: Fri, 20 Aug 2021 15:43:12 +0300 Subject: [PATCH 1/3] Documentation --- README.md | 12 +++ docs/hierarchy.md | 19 ++-- docs/{inheritance => inheritance.md} | 0 docs/uml/Vision.puml | 98 ++++++++++++------- .../space/kscience/visionforge/Vision.kt | 2 +- .../kscience/visionforge/solid/SolidGroup.kt | 2 +- 6 files changed, 87 insertions(+), 46 deletions(-) rename docs/{inheritance => inheritance.md} (100%) diff --git a/README.md b/README.md index 621f474f..b8ff5212 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,11 @@ * [visionforge-core](#visionforge-core) * [visionforge-solid](#visionforge-solid) * [visionforge-gdml](#visionforge-gdml) + * [visionforge-fx](#visionforge-fx) + * [visionforge-markdown](#visionforge-markdown) + * [visionforge-plotly](#visionforge-plotly) + * [visionforge-server](#visionforge-server) + * [visionforge-threejs](#visionforge-threejs) * [Visualization for External Systems](#visualization-for-external-systems) * [Demonstrations](#demonstrations) * [Simple Example - Solid Showcase](#simple-example---solid-showcase) @@ -65,6 +70,13 @@ To learn more about DataForge, please consult the following URLs: ## Modules contained in this repository ### visionforge-core +> Core classes, algebra definitions, basic linear algebra +> +> **Maturity**: DEVELOPMENT +> +> **Features:** +> - [vision](visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/Vision.kt) : an architecture of visions. +
Contains a general hierarchy of classes and interfaces useful for visualization. This module is not specific to 3D-visualization. diff --git a/docs/hierarchy.md b/docs/hierarchy.md index dbb2c6c1..c3d9d287 100644 --- a/docs/hierarchy.md +++ b/docs/hierarchy.md @@ -3,14 +3,19 @@ ![](../docs/images/hierarchy.png) ### Vision +* function `getPropertyValue(name: Name, inherit: Boolean = false, includeStyles: Boolean = true, includeDefaults: Boolean = true)` - get property value with given layer flags. -* function `getProperty(name: Name, inherit: Boolean, includeStyles: Boolean, includeDefaults: Boolean)`. +* function `setProperty(name: Name, item: Any?)` - a convenient method to set property node or value. If `item` is null, then node is removed, not a value +Sets the `item` property to the element with the `name` identification. -It gets properties of element with `name` identification. -`inherit` — toggles parent node property lookup. Null means inference from descriptor. Default is false. -`includeStyles` — toggles inclusion of. Null means inference from descriptor. Default is true. -`includeDefaults` — default is false. +### SolidGroup -* function `setProperty(name: Name, item: MetaItem?, notify: Boolean = true)` +* function `getPrototype(name: Name)` - get a prototype redirecting the request to the parent if prototype is not found. If prototype is a ref, then it is unfolded automatically. -Sets the `item` property to the element with the `name` identification. `notify` is a value which toggles the necessity of the change notification. Default is true. +* function `prototypes(builder: VisionContainerBuilder.() -> Unit)` - create or edit prototype node as a group. + +### RootVisionGroup + +Non-serializable root group used to propagate manager to its children. + +* function Vision.root(manager: VisionManager) - designate this [VisionGroup] as a root group and assign a [VisionManager] as its parent. diff --git a/docs/inheritance b/docs/inheritance.md similarity index 100% rename from docs/inheritance rename to docs/inheritance.md diff --git a/docs/uml/Vision.puml b/docs/uml/Vision.puml index 609a3723..b7929c80 100644 --- a/docs/uml/Vision.puml +++ b/docs/uml/Vision.puml @@ -3,41 +3,50 @@ interface Vision{ val parent: VisionGroup? - fun getProperty(name):TypedMetaItem? - fun setProperty(name, item) + fun getPropertyValue(name,inherit,includeStyles,includeDefaults): Value? } interface Solid{ - base of 3D geometries + val descriptor: MetaDescriptor + val parent: VisionGroup? } -Vision <- Solid +Vision <-- Solid class VisionGroup{ - a group of visions + val children: Map + val defaultTarget: String + fun content(target): Map + fun get(name: Name): Vision? } - Vision <-- VisionGroup class VisionBase{ - basic vision - implementation + var parent: VisionGroup? + var properties: MutableMeta? + fun getOrCreateProperties(): MutableMeta } -Vision <- VisionBase +Vision <-- VisionBase class SolidLabel Solid <--- SolidLabel -class SolidGroup -Solid <--- SolidGroup -MutableVisionGroup <-- SolidGroup +class SolidGroup{ + var properties: MutableMeta? + val children: Map + var prototypes: MutableVisionGroup? + fun getPrototype(name): Solid? + fun prototypes(builder) +} +Solid <--- SolidGroup +VisionGroupBase <-- SolidGroup class SphereLayer -GeometrySolid <-- SphereLayer +Solid <-- SphereLayer class Sphere -GeometrySolid <-- Sphere +Solid <-- Sphere class Box Hexagon <-- Box @@ -46,24 +55,21 @@ class GenericHexagon Hexagon <-- GenericHexagon class Extruded -GeometrySolid <-- Extruded +Solid <-- Extruded class PolyLine Solid <--- PolyLine -interface GeometrySolid -Solid <--- GeometrySolid - interface Hexagon -GeometrySolid <-- Hexagon +Solid <-- Hexagon class ConeSegment -GeometrySolid <-- ConeSegment +Solid <-- ConeSegment class ConeSurface -GeometrySolid <-- ConeSurface +Solid <-- ConeSurface class Convex @@ -73,29 +79,47 @@ class Composite Solid <--- Composite -interface SolidReference +interface SolidReference{ + val prototype: Solid + fun getPropertyValue(name,inherit,includeStyles,includeDefaults): Value? +} VisionGroup <---- SolidReference -interface MutableVisionGroup +class SolidReferenceGroup{ + val refName: Name + var properties: MutableMeta? + val prototype: Solid + val children: Map + fun getPropertyValue(name,inherit,includeStyles,includeDefaults): Value? +} +VisionBase <-- SolidReferenceGroup + +interface MutableVisionGroup{ + fun onStructureChanged(owner, block) + fun removeStructureListener(owner) +} VisionGroup <---- MutableVisionGroup -class SolidReferenceGroup -VisionGroup <-- SolidReferenceGroup -Solid <-- SolidReferenceGroup -VisionBase <-- SolidReferenceGroup -SolidReference <-- SolidReferenceGroup - -class ReferenceChild -VisionGroup <-- ReferenceChild -Solid <-- ReferenceChild -SolidReference <-- ReferenceChild - - +class VisionGroupBase{ + val children: Map + fun set(name: Name?, child: Vision?) +} +VisionBase <-- VisionGroupBase +MutableVisionGroup <-- VisionGroupBase class RootVisionGroup -MutableVisionGroup <-- RootVisionGroup +VisionGroupBase <-- RootVisionGroup -class VisionOfPlotly +class VisionOfPlotly{ + var properties: MutableMeta? + val plot: Plot +} VisionBase <-- VisionOfPlotly + +class VisionOfMarkup{ + val format: String + var content: String? +} +VisionBase <-- VisionOfMarkup @enduml \ No newline at end of file diff --git a/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/Vision.kt b/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/Vision.kt index 924dfdd1..54e9261c 100644 --- a/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/Vision.kt +++ b/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/Vision.kt @@ -109,7 +109,7 @@ public fun Vision.getPropertyValue( ): Value? = getPropertyValue(Name.parse(key), inherit, includeStyles, includeDefaults) /** - * A convenience method to set property node or value. If Item is null, then node is removed, not a value + * A convenient method to set property node or value. If Item is null, then node is removed, not a value */ public fun Vision.setProperty(name: Name, item: Any?) { when (item) { diff --git a/visionforge-solid/src/commonMain/kotlin/space/kscience/visionforge/solid/SolidGroup.kt b/visionforge-solid/src/commonMain/kotlin/space/kscience/visionforge/solid/SolidGroup.kt index ec6dd5f1..3f49df5e 100644 --- a/visionforge-solid/src/commonMain/kotlin/space/kscience/visionforge/solid/SolidGroup.kt +++ b/visionforge-solid/src/commonMain/kotlin/space/kscience/visionforge/solid/SolidGroup.kt @@ -26,7 +26,7 @@ public interface PrototypeHolder { /** * Represents 3-dimensional Visual Group - * @param prototypes A container for templates visible inside this group + * @param prototypes is a container for templates visible inside this group */ @Serializable @SerialName("group.solid") From fcf5ab17ca8c9bbc0949582e7af7127232544e9b Mon Sep 17 00:00:00 2001 From: kiruma524 Date: Fri, 20 Aug 2021 15:52:32 +0300 Subject: [PATCH 2/3] Documentation vol.2 --- build.gradle.kts | 4 ++++ docs/uml/Vision.puml | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2dc7926a..5d7a7ec8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -33,4 +33,8 @@ ksciencePublish { apiValidation { validationDisabled = true ignoredPackages.add("info.laht.threekt") +} + +rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class.java) { + rootProject.the().versions.webpackDevServer.version = "4.0.0-rc.0" } \ No newline at end of file diff --git a/docs/uml/Vision.puml b/docs/uml/Vision.puml index b7929c80..2b4d9953 100644 --- a/docs/uml/Vision.puml +++ b/docs/uml/Vision.puml @@ -7,23 +7,23 @@ interface Vision{ } interface Solid{ - val descriptor: MetaDescriptor - val parent: VisionGroup? + The base for 3D geometry } Vision <-- Solid class VisionGroup{ + A group of Visions + val children: Map val defaultTarget: String + fun content(target): Map fun get(name: Name): Vision? } Vision <-- VisionGroup class VisionBase{ - var parent: VisionGroup? - var properties: MutableMeta? - fun getOrCreateProperties(): MutableMeta + basic vision implementation } Vision <-- VisionBase @@ -110,7 +110,6 @@ MutableVisionGroup <-- VisionGroupBase class RootVisionGroup VisionGroupBase <-- RootVisionGroup - class VisionOfPlotly{ var properties: MutableMeta? val plot: Plot From 8babcd7f88af7639e30a700e7fb6196a1e39b773 Mon Sep 17 00:00:00 2001 From: kiruma524 Date: Fri, 20 Aug 2021 16:12:04 +0300 Subject: [PATCH 3/3] Documentation vol.3 --- docs/hierarchy.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/hierarchy.md b/docs/hierarchy.md index c3d9d287..a534c5f1 100644 --- a/docs/hierarchy.md +++ b/docs/hierarchy.md @@ -6,7 +6,25 @@ * function `getPropertyValue(name: Name, inherit: Boolean = false, includeStyles: Boolean = true, includeDefaults: Boolean = true)` - get property value with given layer flags. * function `setProperty(name: Name, item: Any?)` - a convenient method to set property node or value. If `item` is null, then node is removed, not a value -Sets the `item` property to the element with the `name` identification. +Sets the `item` property to the element with the `name` identification. + +### VisionBase + +Basic vision implementation + +### VisionGroup + +A group of Visions. + +### MutableVisionGroup + +Mutable version of VisionGroup. + +low structure changes of this group. Unconsumed changes are discarded. + +### Solid + +Interface for 3-dimensional Vision. ### SolidGroup @@ -14,6 +32,10 @@ Sets the `item` property to the element with the `name` identification. * function `prototypes(builder: VisionContainerBuilder.() -> Unit)` - create or edit prototype node as a group. +### SolidReferenceGroup + +A reference Solid to reuse a template object. + ### RootVisionGroup Non-serializable root group used to propagate manager to its children.