Raw version of hierarchy.md #61

Closed
kiruma524 wants to merge 13 commits from dev into dev
8 changed files with 117 additions and 64 deletions

View File

@ -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.
<hr/>
Contains a general hierarchy of classes and interfaces useful for visualization.
This module is not specific to 3D-visualization.

View File

@ -37,6 +37,3 @@ apiValidation {
}
//workaround for https://youtrack.jetbrains.com/issue/KT-48273
rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class.java) {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().versions.webpackDevServer.version = "4.0.0-rc.0"
}

View File

@ -1,17 +1,43 @@
# Hierarchy
![](../docs/images/hierarchy.png)
**the image will be changed**
### 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` &mdash; toggles parent node property lookup. Null means inference from descriptor. Default is false.
`includeStyles` &mdash; toggles inclusion of. Null means inference from descriptor. Default is true.
`includeDefaults` &mdash; default is false.
### VisionBase
* function `setProperty(name: Name, item: MetaItem?, notify: Boolean = true)`
Basic vision implementation
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.
### 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
* 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.
* function `prototypes(builder: VisionContainerBuilder<Solid>.() -> 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.
* function Vision.root(manager: VisionManager) - designate this [VisionGroup] as a root group and assign a [VisionManager] as its parent.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

@ -65,4 +65,6 @@ Properties, which can or cannot be inherited, are these:
![](../docs/images/inheritance-2-2-5.png)
* `rotation` - rotation of an element. Here, it is set by `x` value. It is inheritable and unable to be changed in `children` elements.
* `position` - position of an element, cannot be inherited.
* `position` &mdash; position of an element, cannot be inherited.

View File

@ -1,108 +1,124 @@
@startuml
'https://plantuml.com/class-diagram
interface Vision
interface Vision{
val parent: VisionGroup?
fun getPropertyValue(name,inherit,includeStyles,includeDefaults): Value?
}
interface Solid
Vision <- Solid
interface Solid{
The base for 3D geometry
}
Vision <-- Solid
class VisionGroup{
A group of Visions
class VisionGroup
val children: Map<NameToken, Vision>
val defaultTarget: String
fun content(target): Map<Name, Any>
fun get(name: Name): Vision?
}
Vision <-- VisionGroup
class VisionBase
Vision <- VisionBase
class VisionBase{
basic vision implementation
}
Vision <-- VisionBase
class SolidLabel
Solid <--- SolidLabel
SolidBase <-- SolidLabel
class SolidGroup
class SolidGroup{
var properties: MutableMeta?
val children: Map<NameToken, Vision>
var prototypes: MutableVisionGroup?
fun getPrototype(name): Solid?
fun prototypes(builder)
}
Solid <--- SolidGroup
VisionGroupBase <-- SolidGroup
class SolidBase
Solid <--- SolidBase
VisionBase <-- SolidBase
class SphereLayer
SolidBase <-- SphereLayer
GeometrySolid <-- SphereLayer
Solid <-- SphereLayer
class Sphere
SolidBase <-- Sphere
GeometrySolid <-- Sphere
Solid <-- Sphere
class Box
SolidBase <-- Box
Hexagon <-- Box
class GenericHexagon
SolidBase <-- GenericHexagon
Hexagon <-- GenericHexagon
class Extruded
SolidBase <-- Extruded
GeometrySolid <-- Extruded
Solid <-- Extruded
class PolyLine
Solid <--- PolyLine
SolidBase <-- 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
Solid <--- Convex
SolidBase <-- Convex
class Composite
Solid <--- Composite
SolidBase <-- 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<NameToken, Vision>
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
class VisionGroupBase{
val children: Map<NameToken, Vision>
fun set(name: Name?, child: Vision?)
}
VisionBase <-- VisionGroupBase
MutableVisionGroup <-- VisionGroupBase
class 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

View File

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

View File

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