]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.network.ontology/graph/DistrictNetworkDiagramSettings.pgraph
First prototype of HSV color space based dynamic DN element coloring
[simantics/district.git] / org.simantics.district.network.ontology / graph / DistrictNetworkDiagramSettings.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 L0X = <http://www.simantics.org/Layer0X-1.1>
3 DIA = <http://www.simantics.org/Diagram-2.2>
4 STR = <http://www.simantics.org/Structural-1.2>
5 MOD = <http://www.simantics.org/Modeling-1.2>
6 VP = <http://www.simantics.org/Viewpoint-1.2>
7 IMAGE = <http://www.simantics.org/Image2-1.2>
8 SEL = <http://www.simantics.org/SelectionView-1.2>
9 SEL_UI = <http://www.simantics.org/SelectionViewUI-1.1>
10 G2D = <http://www.simantics.org/G2D-1.1>
11 DN = <http://www.simantics.org/DistrictNetwork-1.0>
12
13 // ----------------------------------------------------------------------------
14
15 DN.EdgeThicknessPropertyParameterType <T SEL.GenericParameterType
16     @L0.assert SEL.HasDisplayValue
17         _ : SEL.DisplayValue
18             SEL.HasEnumerationValues DN.Functions.edgeThicknessPropertyEnumerationValues : L0.Function
19             SEL.HasCustomModifier DN.Functions.edgeThicknessPropertyModifier : L0.Function
20
21 DN.VertexScalePropertyParameterType <T SEL.GenericParameterType
22     @L0.assert SEL.HasDisplayValue
23         _ : SEL.DisplayValue
24             SEL.HasEnumerationValues DN.Functions.nodeScalePropertyEnumerationValues : L0.Function
25             SEL.HasCustomModifier DN.Functions.nodeScalePropertyModifier : L0.Function
26
27 DN.Edge.ThicknessProperty <T L0.Value
28     @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
29     >-- DN.Edge.ThicknessProperty.value ==> "Resource -> <ReadGraph> Maybe Double" <R L0.HasProperty : SEL.GenericParameterType
30         L0.readOnly true
31     >-- DN.Edge.ThicknessProperty.gain --> L0.Double <R L0.HasProperty : SEL.GenericParameterType
32         L0.readOnly true
33     >-- DN.Edge.ThicknessProperty.bias --> L0.Double <R L0.HasProperty : SEL.GenericParameterType
34         L0.readOnly true
35     @L0.assert DN.Edge.ThicknessProperty.gain 1.0
36     @L0.assert DN.Edge.ThicknessProperty.bias 0.0
37
38 DN.Vertex.ScaleProperty <T L0.Value
39     @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
40     >-- DN.Vertex.ScaleProperty.value ==> "Resource -> <ReadGraph> Maybe Double" <R L0.HasProperty : SEL.GenericParameterType
41         L0.readOnly true
42     >-- DN.Vertex.ScaleProperty.gain ==> "Double" <R L0.HasProperty : SEL.GenericParameterType
43         L0.readOnly true
44     >-- DN.Vertex.ScaleProperty.bias ==> "Double" <R L0.HasProperty : SEL.GenericParameterType
45         L0.readOnly true
46     @L0.assert DN.Vertex.ScaleProperty.gain 1.0
47     @L0.assert DN.Vertex.ScaleProperty.bias 0.0
48
49 DN.Diagram
50     >-- DN.Diagram.elementColoringGradientHue ==> "Float" <R L0.HasProperty : SEL.GenericParameterType
51         L0.HasLabel "Element Color Hue"
52         L0.HasDescription "HSV/HSB color space hue value used for element coloring in degrees (0-360)"
53         L0X.HasUnit "deg"
54         L0X.RequiresDataType $(Float(unit="deg",range=[0..360]))
55         SEL.HasDisplayValue _ : SEL.DisplayValue
56             L0.Literal.HasInputValidator DN.Functions.hueValidator : L0.Function
57     >-- DN.Diagram.elementColoringGradientSaturation ==> "Float" <R L0.HasProperty : SEL.GenericParameterType
58         L0.HasLabel "Element Color Saturation"
59         L0.HasDescription "HSV/HSB color space saturation value used for element coloring in % (0-100)"
60         L0X.HasUnit "%"
61         L0X.RequiresDataType $(Float(unit="%",range=[0..100]))
62         SEL.HasDisplayValue _ : SEL.DisplayValue
63             L0.Literal.HasInputValidator DN.Functions.saturationValidator : L0.Function
64     >-- DN.Diagram.elementColoringFunction --> L0.String ==> "Resource -> <ReadGraph> Double" <R L0.HasProperty : SEL.GenericParameterType
65         L0.HasLabel "Element Color Brightness Function"
66         L0.HasDescription "Defines HSV/HSB color space brightness function whose value is cut off to fit [0,1]. Together with hue and saturation this defines the element color."
67         SEL.HasDisplayValue _ : SEL.DisplayValue
68             L0.Literal.HasInputValidator DN.Functions.brightnessValidator : L0.Function
69     >-- DN.Diagram.edgeThicknessGain ==> "Double" <R L0.HasProperty : SEL.GenericParameterType
70         L0.HasLabel "Edge Thickness Gain"
71     >-- DN.Diagram.edgeThicknessBias ==> "Double" <R L0.HasProperty : SEL.GenericParameterType
72         L0.HasLabel "Edge Thickness Bias"
73     >-- DN.Diagram.edgeThicknessProperty --> DN.Edge.ThicknessProperty <R L0.HasProperty : DN.EdgeThicknessPropertyParameterType
74         L0.HasLabel "Edge Thickness Property"
75     >-- DN.Diagram.nodeScaleGain ==> "Double" <R L0.HasProperty : SEL.GenericParameterType
76         L0.HasLabel "Node Scale Gain"
77     >-- DN.Diagram.nodeScaleBias ==> "Double" <R L0.HasProperty : SEL.GenericParameterType
78         L0.HasLabel "Node Scale Bias"
79     >-- DN.Diagram.nodeScaleProperty --> DN.Vertex.ScaleProperty <R L0.HasProperty : DN.VertexScalePropertyParameterType
80         L0.HasLabel "Node Scale Property"
81     @L0.assert DN.Diagram.elementColoringGradientHue
82         0.0 : L0.Float
83             L0.HasDataType $(Float(unit="deg",range=[0..360]))
84     @L0.assert DN.Diagram.elementColoringGradientSaturation
85         100.0 : L0.Float
86             L0.HasDataType $(Float(unit="%",range=[0..100]))
87     @MOD.sclAssertion DN.Diagram.elementColoringFunction "\r -> 1.0" "Resource -> <ReadGraph> Double"
88     @L0.assert DN.Diagram.edgeThicknessGain 1.0
89     @L0.assert DN.Diagram.edgeThicknessBias 0.0
90     @L0.assert DN.Diagram.edgeThicknessProperty DN.Edge.ThicknessProperty.Diameter
91     @L0.assert DN.Diagram.nodeScaleGain 1.0
92     @L0.assert DN.Diagram.nodeScaleBias 0.0
93     @L0.assert DN.Diagram.nodeScaleProperty DN.Vertex.ScaleProperty.NominalSupplyPressure
94
95 // ----------------------------------------------------------------------------
96 // Built-in enumerated ScaleProperty & ThicknessProperty instances
97
98 DN.Functions.constantOne : L0.Function
99     L0.HasValueType "Resource -> <ReadGraph> Maybe Double"
100
101 DN.Edge.ThicknessProperty.OnlyGainAndBias: DN.Edge.ThicknessProperty
102     L0.HasLabel "Only Gain and Bias"
103     DN.Edge.ThicknessProperty.value
104         DN.Functions.constantOne
105
106 DN.Edge.ThicknessProperty.Diameter : DN.Edge.ThicknessProperty
107     L0.HasLabel "Diameter"
108     DN.Edge.ThicknessProperty.value
109         DN.Functions.hasDiameterValue : L0.Function
110             L0.HasValueType "Resource -> <ReadGraph> Maybe Double"
111     DN.Edge.ThicknessProperty.gain 0.001
112
113
114 DN.Vertex.ScaleProperty.OnlyGainAndBias: DN.Vertex.ScaleProperty
115     L0.HasLabel "Only Gain and Bias"
116     DN.Vertex.ScaleProperty.value
117         DN.Functions.constantOne
118
119 DN.Vertex.ScaleProperty.NominalSupplyPressure : DN.Vertex.ScaleProperty
120     L0.HasLabel "Nominal Supply Pressure"
121     DN.Vertex.ScaleProperty.value
122         DN.Functions.hasNominalSupplyPressure : L0.Function
123             L0.HasValueType "Resource -> <ReadGraph> Maybe Double"
124     DN.Vertex.ScaleProperty.gain 0.001
125
126 DN.Vertex.ScaleProperty.Elevation : DN.Vertex.ScaleProperty
127     L0.HasLabel "Elevation"
128     DN.Vertex.ScaleProperty.value
129         DN.Functions.hasElevation : L0.Function
130             L0.HasValueType "Resource -> <ReadGraph> Maybe Double"
131     DN.Vertex.ScaleProperty.gain 0.1
132     DN.Vertex.ScaleProperty.bias 0.001