]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.diagram.ontology/graph/Diagram.pgraph
Dynamic terminals and connections
[simantics/platform.git] / bundles / org.simantics.diagram.ontology / graph / Diagram.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 L0X = <http://www.simantics.org/Layer0X-1.1>
3 G2D = <http://www.simantics.org/G2D-1.1>
4 STR = <http://www.simantics.org/Structural-1.2>
5 DATA = <http://www.simantics.org/Datatypes-1.1>
6 SEL = <http://www.simantics.org/SelectionView-1.2>
7
8 DIA = <http://www.simantics.org/Diagram-2.2> : L0.Ontology
9     @L0.new
10     L0.HasResourceClass "org.simantics.diagram.stubs.DiagramResource"
11
12 //// Import / Export
13
14 DIA.DiagramSubgraphExtent : L0X.SubgraphExtent
15
16 //// Objects and types
17
18 DIA.ElementClass <T STR.ComponentType
19     L0.HasDescription """Abstract element that has a position on diagram"""
20     @L0.tag L0.Abstract
21     //TODO [STR.IsDefinedBy all Element]
22
23 DIA.Element <T STR.Component : DIA.ElementClass
24     @L0.property L0.HasNext
25     @L0.property L0.HasPrevious
26     @L0.tag L0.Abstract 
27     >-- DIA.HasTransform
28     @L0.assert DIA.HasDynamicTransform
29         DIA.Functions.modelledTransform : L0.Function
30     @L0.assert DIA.Element.profileMonitorOffset
31         (0.0,0.0) : DATA.Vec2d
32     @L0.assert DIA.Element.profileMonitorSpacing 0.0
33     @L0.assert DIA.Element.hideProfileMonitors false
34     @L0.assert DIA.Element.upProfileMonitors true
35     >-- DIA.Element.profileMonitorOffset --> DATA.Vec2d <R L0.HasProperty : L0.FunctionalRelation  : SEL.GenericParameterType
36       L0.HasLabel "Profile Monitor Offset"
37       SEL.HasDisplayValue ""
38     >-- DIA.Element.profileMonitorSpacing --> L0.Double <R L0.HasProperty : L0.FunctionalRelation  : SEL.GenericParameterType
39       L0.HasLabel "Profile Monitor Spacing"
40     >-- DIA.Element.hideProfileMonitors --> L0.Boolean <R L0.HasProperty : L0.FunctionalRelation  : SEL.GenericParameterType
41       L0.HasLabel "Hide Profile Monitors?"
42     >-- DIA.Element.upProfileMonitors --> L0.Boolean <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
43       L0.HasLabel "Grow Profile Monitors Upward?"
44     
45 DIA.symbolFunction <R L0.HasProperty : L0.FunctionalRelation
46
47 DIA.DiagramContainer <T L0.Entity
48     @L0.singleProperty L0.HasName
49     @L0.property L0.ConsistsOf
50
51 DIA.Composite <T STR.OrderedComposite <T DIA.Element
52     L0.HasDescription """A diagram composite is z-ordered. First elements in the list are drawn first."""
53     //TODO [L0.OrderedSetElements all Element]
54
55 DIA.IOTableRename <T L0.Entity
56     >-- DIA.IOTableRename.From --> L0.String <R L0.HasProperty : L0.FunctionalRelation
57     >-- DIA.IOTableRename.To --> L0.String <R L0.HasProperty : L0.FunctionalRelation
58     @L0.assert DIA.IOTableRename.From
59         "" : L0.String
60     @L0.assert DIA.IOTableRename.To
61         "" : L0.String
62
63 DIA.Diagram <T DIA.Composite
64     >-- DIA.Diagram.IOTableRenaming --> DIA.IOTableRename <T L0.DependsOn 
65     @L0.optionalProperty DIA.HasModCount
66
67 DIA.HasModCount <R L0.HasProperty
68     L0.HasLabel "Modification Counter"
69     L0.HasDescription "A counter for modifications performed on the property owner resource. Used for naming elements with running number IDs."
70     L0.HasDomain DIA.Composite
71     L0.HasRange L0.Long
72
73 DIA.Terminal <T DIA.Element
74     @L0.singleProperty DIA.HasConnectionPoint
75     @L0.tag L0.Abstract
76     >-- DIA.Terminal.AllowedDirections --> L0.Integer <R L0.HasProperty : L0.FunctionalRelation
77         L0.HasDescription """Used to describe allowed terminal exit/enter directions for incoming/outgoing connections.
78 The integer value is a bit mask with the following meanings:
79 bit  meaning
80 0    right (1,0)
81 1    down  (0,1)
82 2    left  (-1,0)
83 3    up    (0,-1)
84 """
85
86 DIA.DefinedElement <T DIA.Element
87     @L0.tag L0.Abstract
88     @L0.singleProperty STR.IsDefinedBy
89
90 DIA.HasTransform <R G2D.HasTransform   : SEL.GenericParameterType
91     L0.HasLabel "Transform"
92     L0.InverseOf DIA.IsTransformOf
93     L0.HasDomain DIA.Element
94     L0.HasRange G2D.Transform
95     L0.HasRange L0.DoubleArray
96     ==> "Vector Double"
97     SEL.HasDisplayValue ""
98
99 DIA.HasDynamicTransform <R L0.HasProperty : L0.FunctionalRelation
100     L0.HasDomain DIA.Element
101     L0.HasRange L0.Value
102
103 DIA.HasConnectionPoint <R L0.DependsOn
104     L0.HasDomain DIA.Element
105     L0.HasRange STR.ConnectionRelation
106
107 DIA.Functions : L0.Library
108
109 DIA.Functions.availableProfiles : L0.Function
110     L0.HasValueType "[(String, Resource)]"
111 DIA.Functions.selectedProfile : L0.Function
112     L0.HasValueType "String"
113 DIA.Functions.activeProfileModifier : L0.Function
114     L0.HasValueType "String -> String"
115 DIA.Functions.diagramElementIssuePath : L0.Function
116
117 DIA.DefinedElement
118   // RequiresValueType ]is omitted during transition period.
119   // Used to be ==> "[String]" but DIA.symbolCode now returns either "[String]" or "[G2DNodeModification]" directly
120   >-- DIA.symbolCode <R L0.HasProperty : L0.FunctionalRelation
121   >-- DIA.symbolDropHandler ==> "[WorkbenchSelectionElement] -> <WriteGraph,Proc> ()" <R L0.HasProperty : L0.FunctionalRelation
122
123 DIA.DiagramActivityCondition <T L0.Entity
124   --> DIA.DiagramActivityCondition.test ==> "Resource -> <ReadGraph> String" <R L0.HasProperty : L0.FunctionalRelation 
125
126 DIA.diagramActivityCondition : L0.Template
127     @template %subject %expression
128         %subject : DIA.DiagramActivityCondition
129             DIA.DiagramActivityCondition.test _ : STR.SCLValue
130                 L0.SCLValue.expression %expression
131                 L0.HasValueType "Resource -> <ReadGraph> String"
132
133 DIA.ProfileEntryContribution <T L0.Entity
134   --> DIA.ProfileEntryContribution.HasEntry --> DIA.ProfileEntry <R L0.IsRelatedTo  
135