]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d.ontology/graph/G2D.pgraph
ShapeNode with separate stroke and fill paints
[simantics/platform.git] / bundles / org.simantics.g2d.ontology / graph / G2D.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 SEL = <http://www.simantics.org/SelectionView-1.2>
3
4 G2D = <http://www.simantics.org/G2D-1.1> : L0.Ontology
5     @L0.new
6     L0.HasResourceClass "org.simantics.diagram.stubs.G2DResource"
7
8 G2D.Point2D <T L0.Literal
9     @L0.assert L0.HasDataType $(Double[2])
10     L0.HasDescription "A double valued property describing a two-dimensional point (x,y) in euclidian coordinates."
11
12 G2D.Rectangle2D <T L0.Literal
13     @L0.assert L0.HasDataType $(Double[4])
14     L0.HasDescription "A double valued property describing a two-dimensional rectangle (x,y,width,height) in euclidian coordinates."
15
16 G2D.HasPoint2D <R L0.DependsOn
17     --> G2D.Point2D
18
19 // FIXME: use proper datatypes
20 G2D.Point2DArray <T L0.DoubleArray
21     L0.HasDescription "An array of Point2D property values (x,y) as consecutive double values."
22
23 G2D.HasPoint2DArray <R L0.DependsOn
24     --> G2D.Point2DArray
25
26 // FIXME: use proper datatypes
27 G2D.Transform <T L0.Literal
28     @L0.assert L0.HasDataType $(Double[6])
29     @L0.assert L0.HasValueType "Vector Double"
30     L0.HasDescription "A 2x3 matrix of six doubles representing an affine 2D transformation in column-major order."
31
32 G2D.Transform."i-0" <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
33     L0.HasLabel "Scale (X)"    
34     L0.HasSubliteralPredicate.Inverse G2D.Transform    
35 G2D.Transform."i-1" <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
36     L0.HasLabel "Shear (Y)"    
37     L0.HasSubliteralPredicate.Inverse G2D.Transform    
38 G2D.Transform."i-2" <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
39     L0.HasLabel "Shear (X)"    
40     L0.HasSubliteralPredicate.Inverse G2D.Transform    
41 G2D.Transform."i-3" <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
42     L0.HasLabel "Scale (Y)"    
43     L0.HasSubliteralPredicate.Inverse G2D.Transform    
44 G2D.Transform."i-4" <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
45     L0.HasLabel "X"    
46     L0.HasSubliteralPredicate.Inverse G2D.Transform    
47 G2D.Transform."i-5" <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
48     L0.HasLabel "Y"    
49     L0.HasSubliteralPredicate.Inverse G2D.Transform    
50
51 G2D.HasTransform <R L0.HasProperty : L0.FunctionalRelation
52     --> G2D.Transform
53     L0.InverseOf G2D.IsTransformOf
54
55 G2D.HasBounds <R L0.HasProperty : L0.FunctionalRelation
56     L0.HasLabel "Bounds"
57     --> G2D.Rectangle2D
58
59 G2D.Shape <T L0.Entity
60     L0.HasDescription "A Graphics Node which has some kind of graphical representation."
61     @L0.optionalProperty G2D.HasStyle
62     @L0.singleProperty G2D.HasLineSegments
63     @L0.singleProperty G2D.HasLineSegmentTypes
64     @L0.optionalProperty G2D.HasFillColor
65     @L0.optionalProperty G2D.HasBorderColor
66
67 G2D.HasLineSegments <R L0.HasProperty : L0.FunctionalRelation
68     --> L0.Double
69 G2D.HasLineSegmentTypes <R L0.HasProperty : L0.FunctionalRelation
70     --> L0.Integer
71
72 G2D.Style <T L0.Property
73     L0.HasDescription "A composite property describing a complete SVG style with stroke and fill attributes. An opacity defined for a Style represents an 'object opacity' which effects both stroke and fill opacity."
74     @L0.optionalProperty G2D.HasStroke
75     @L0.optionalProperty G2D.HasOpacity
76 G2D.HasStyle <R L0.HasProperty : L0.FunctionalRelation
77     --> G2D.Style
78 G2D.Stroke <T L0.Property
79     L0.HasDescription "A composite property describing all stroke painting attributes possible in SVG"
80     @L0.optionalProperty G2D.HasDashArray
81     @L0.optionalProperty G2D.HasDashOffset
82     @L0.optionalProperty G2D.HasStrokeWidth
83     @L0.optionalProperty G2D.HasMiterLimit
84     @L0.optionalProperty G2D.HasLineCap
85     @L0.optionalProperty G2D.HasLineJoin
86 G2D.HasStroke <R L0.HasProperty : L0.FunctionalRelation
87     --> G2D.Stroke
88 G2D.HasStrokeType <R L0.IsRelatedTo : L0.FunctionalRelation
89     L0.HasLabel "Stroke Type"
90     --> G2D.StrokeType
91 G2D.StrokeType <T L0.Property
92     @L0.tag L0.Enumeration
93 G2D.StrokeType.Scaling : G2D.StrokeType
94 G2D.StrokeType.Nonscaling : G2D.StrokeType
95 G2D.HasRounding <R L0.HasProperty : L0.FunctionalRelation
96     --> L0.Double
97 G2D.HasOffset <R L0.HasProperty : L0.FunctionalRelation
98     --> L0.Double
99 G2D.HasBranchPointRadius <R L0.HasProperty : L0.FunctionalRelation
100     --> L0.Double
101 G2D.LineEnd <T L0.Property
102     @L0.optionalProperty G2D.HasLineEndStyle
103     @L0.singleProperty G2D.HasSize
104     @L0.singleProperty G2D.HasWidthRatio
105     @L0.singleProperty G2D.HasSpace
106 G2D.HasEndArrow <R L0.HasProperty : L0.FunctionalRelation
107     L0.HasLabel "End Arrow"
108     --> G2D.LineEnd
109 G2D.HasMidArrow <R L0.HasProperty : L0.FunctionalRelation
110     L0.HasLabel "Mid Arrow"
111     --> G2D.LineEnd
112 G2D.HasBeginArrow <R L0.HasProperty : L0.FunctionalRelation
113     L0.HasLabel "Begin Arrow"
114     --> G2D.LineEnd
115 G2D.LineEndStyle <T L0.Property
116     @L0.tag L0.Enumeration
117 G2D.LineEndStyle.NormalLineEndStyle : G2D.LineEndStyle
118 G2D.LineEndStyle.FilledLineEndStyle : G2D.LineEndStyle
119 G2D.HasLineEndStyle <R L0.IsRelatedTo : L0.FunctionalRelation
120     L0.HasLabel "Line End Style"
121     --> G2D.LineEndStyle
122 G2D.Font <T L0.Property
123     L0.HasDescription "A composite property describing a single font configuration by its family, style and size."
124     @L0.singleProperty G2D.HasFontFamily
125     @L0.singleProperty G2D.HasFontStyle
126     @L0.singleProperty G2D.HasFontSize
127     @L0.assert G2D.HasFontFamily "Arial"
128     @L0.assert G2D.HasFontStyle G2D.FontStyle.normal_font_style
129     @L0.assert G2D.HasFontSize 12
130 G2D.HasFont <R L0.HasProperty : L0.FunctionalRelation
131     L0.HasLabel "Font"
132     --> G2D.Font
133 G2D.FontStyle <T L0.Property : L0.FunctionalRelation
134     @L0.tag L0.Enumeration
135     L0.HasDescription "An enumeration of the allowed font styles."
136 G2D.FontStyle.normal_font_style : G2D.FontStyle
137 G2D.FontStyle.italic_font_style : G2D.FontStyle
138 G2D.FontStyle.bold_font_style : G2D.FontStyle
139 G2D.FontStyle.bold_italic_style : G2D.FontStyle
140 G2D.HasFontStyle <R L0.IsRelatedTo : L0.FunctionalRelation
141     L0.HasLabel "Font Style"
142     --> G2D.FontStyle
143 G2D.LineJoin <T L0.Property
144     @L0.tag L0.Enumeration
145 G2D.LineJoin.MiterJoin : G2D.LineJoin
146 G2D.LineJoin.RoundJoin : G2D.LineJoin
147 G2D.LineJoin.BevelJoin : G2D.LineJoin
148 G2D.HasLineJoin <R L0.IsRelatedTo : L0.FunctionalRelation
149     L0.HasLabel "Line Join"
150     --> G2D.LineJoin
151 G2D.LineCap <T L0.Property : L0.FunctionalRelation
152     @L0.tag L0.Enumeration
153 G2D.LineCap.ButtCap : G2D.LineCap
154 G2D.LineCap.RoundCap : G2D.LineCap
155 G2D.LineCap.SquareCap : G2D.LineCap
156 G2D.HasLineCap <R L0.IsRelatedTo : L0.FunctionalRelation
157     L0.HasLabel "Line Cap"
158     --> G2D.LineCap
159 G2D.HasPaint <R L0.HasProperty : L0.FunctionalRelation
160     L0.HasLabel "Paint"
161     --> L0.String
162 G2D.HasOpacity <R L0.HasProperty : L0.FunctionalRelation
163     L0.HasLabel "Opacity"
164     --> L0.Float
165 G2D.HasStrokeWidth <R L0.HasProperty : L0.FunctionalRelation
166     L0.HasLabel "Stroke Width"
167     --> L0.Float
168 G2D.HasMiterLimit <R L0.HasProperty : L0.FunctionalRelation
169     L0.HasLabel "Miter Limit"
170     --> L0.Float
171 G2D.HasDashArray <R L0.HasProperty : L0.FunctionalRelation
172     --> L0.FloatArray
173     L0.HasDescription "The array represents the lengths of the dash segments. Alternate entries in the array represent the user space lengths of the opaque and transparent segments of the dashes."
174 G2D.HasDashOffset <R L0.HasProperty : L0.FunctionalRelation
175     --> L0.Float
176     L0.HasDescription "The dash phase is a distance specified in user coordinates that represents an offset into the dashing pattern."
177 G2D.HasRadii <R L0.HasProperty : L0.FunctionalRelation
178     --> G2D.Point2D
179 G2D.HasPathData <R L0.HasProperty : L0.FunctionalRelation
180     --> L0.String
181 G2D.HasText <R L0.HasProperty : L0.FunctionalRelation
182     L0.HasLabel "Text"
183     --> L0.String
184 G2D.HasSize <R L0.HasProperty : L0.FunctionalRelation
185     L0.HasLabel "Size"
186     --> L0.Double
187 G2D.HasWidthRatio <R L0.HasProperty : L0.FunctionalRelation
188     L0.HasLabel "Ratio of width to length"
189     --> L0.Double
190 G2D.HasSpace <R L0.HasProperty : L0.FunctionalRelation
191     L0.HasLabel "Space"
192     --> L0.Double
193 G2D.HasFontFamily <R L0.HasProperty : L0.FunctionalRelation
194     L0.HasLabel "Font Family"
195     --> L0.String
196 G2D.HasFontSize <R L0.HasProperty : L0.FunctionalRelation
197     L0.HasLabel "Font Size"
198     --> L0.Integer
199
200 G2D.Alignment <T L0.Property
201     @L0.tag L0.Enumeration
202 G2D.Alignment.Leading : G2D.Alignment
203 G2D.Alignment.Center : G2D.Alignment
204 G2D.Alignment.Trailing : G2D.Alignment
205 G2D.Alignment.Baseline : G2D.Alignment
206 G2D.HasHorizontalAlignment <R L0.IsRelatedTo : L0.FunctionalRelation
207     L0.HasLabel "Horizontal Alignment"
208     --> G2D.Alignment
209 G2D.HasVerticalAlignment <R L0.IsRelatedTo : L0.FunctionalRelation
210     L0.HasLabel "Vertical Alignment"
211     --> G2D.Alignment
212
213 G2D.Color <T L0.Literal
214     @L0.assert L0.HasDataType $(Float[4])
215     L0.HasDescription "A 4-component BGRA color as floats."
216 G2D.HasColor <R L0.HasProperty : L0.FunctionalRelation
217     L0.HasLabel "Color"
218     --> G2D.Color
219 G2D.HasFillColor <R L0.HasProperty : L0.FunctionalRelation
220     L0.HasLabel "Fill Color"
221     --> G2D.Color
222 G2D.HasBorderColor <R L0.HasProperty : L0.FunctionalRelation
223     L0.HasLabel "Border Color"
224     --> G2D.Color
225
226 G2D.ColorProfile <T L0.Library
227     L0.HasDescription "A collection of colors"
228
229 G2D.Colors : G2D.ColorProfile
230     L0.ConsistsOf
231         [0.0,0.0,0.0,1.0] : G2D.Color
232             L0.HasName "black"
233         [1.0,1.0,1.0,1.0] : G2D.Color
234             L0.HasName "white"
235
236 G2D.ColorGradient <T L0.Property
237     //TODO [G2D.HasColorPlacement card "1..*"]
238 G2D.ColorPlacement <T L0.Property 
239     @L0.singleProperty G2D.HasColor
240     @L0.singleProperty G2D.HasGradientPosition 
241 G2D.HasColorPlacement <R L0.HasProperty : L0.FunctionalRelation
242     --> G2D.ColorPlacement
243 G2D.HasColorGradient <R L0.HasProperty : L0.FunctionalRelation
244     --> G2D.ColorGradient
245 G2D.HasGradientPosition <R L0.HasProperty : L0.FunctionalRelation
246     --> L0.Double
247
248 G2D.DefaultStroke : G2D.Stroke
249     L0.HasDescription "Default Stroke with width = 1"
250     G2D.HasStrokeWidth 1.0 : L0.Float
251     G2D.HasDashArray [1.0] : L0.FloatArray
252     G2D.HasDashOffset 0.0 : L0.Float
253     G2D.HasMiterLimit 1.0 : L0.Float
254     G2D.HasLineCap G2D.LineCap.SquareCap
255     G2D.HasLineJoin G2D.LineJoin.RoundJoin
256
257 G2D.HasRasterImage <R L0.HasProperty : L0.FunctionalRelation
258     --> L0.ByteArray
259
260 G2D.HasSVGDocument <R L0.HasProperty : L0.FunctionalRelation
261     --> L0.String
262
263 G2D.HasSVGScript <R L0.HasProperty : L0.FunctionalRelation
264     --> L0.String
265
266 G2D.IsVisible <R L0.HasProperty : L0.FunctionalRelation
267     --> L0.Boolean
268
269 G2D.fontProperty : L0.Template
270     @template %subject %predicate %family %size %style
271         %subject
272             %predicate _ : G2D.Font
273               G2D.HasFontFamily %family
274               G2D.HasFontSize %size
275               G2D.HasFontStyle %style
276               
277 G2D.font : L0.Template
278     @template %subject %family %size %style
279         %subject : G2D.Font
280           G2D.HasFontFamily %family
281           G2D.HasFontSize %size
282           G2D.HasFontStyle %style
283               
284