]> gerrit.simantics Code Review - simantics/platform.git/blob - graph/DiagramConnections.pgraph
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / graph / DiagramConnections.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 STR = <http://www.simantics.org/Structural-1.2>
3 DIA = <http://www.simantics.org/Diagram-2.2>
4
5 //// CONNECTION BRANCHING / ROUTING
6
7 DIA.HasInverseAttachment <R L0.IsRelatedTo : L0.FunctionalRelation
8     @L0.symmetric
9     L0.HasDescription "Identifies the inversely directed connector attachment relation of a DIA.HasConnector relation. For example, DIA.HasPlainConnector is the inverse attachment relation of DIA.HasArrowConnector."
10
11 DIA.HasConnector <R STR.IsConnectedTo <R L0.IsComposedOf
12     L0.InverseOf DIA.IsConnectorOf
13     L0.HasDomain DIA.Connection
14     --> DIA.Connector
15 DIA.HasTailConnector <R DIA.HasConnector
16     L0.HasDescription "Identifies, where applicable, the beginning of the connection"
17     L0.InverseOf DIA.IsTailConnectorOf
18 DIA.HasHeadConnector <R DIA.HasConnector
19     L0.HasDescription "Identifies, where applicable, the end of the connection"
20     L0.InverseOf DIA.IsHeadConnectorOf
21     DIA.HasInverseAttachment DIA.HasTailConnector
22 DIA.HasPlainConnector <R DIA.HasTailConnector
23     L0.HasDescription "Identifies a connection end where no arrowhead is drawn."
24     L0.InverseOf DIA.IsPlainConnectorOf
25 DIA.HasArrowConnector <R DIA.HasHeadConnector
26     L0.HasDescription "Identifies a connection end with an arrow."
27     L0.InverseOf DIA.IsArrowConnectorOf
28     DIA.HasInverseAttachment DIA.HasPlainConnector
29 DIA.HasBranchPoint <R DIA.HasInteriorRouteNode
30     L0.InverseOf DIA.IsBranchPointOf
31     L0.HasDomain DIA.Connection
32     --> DIA.BranchPoint
33 DIA.AreConnected <R L0.IsWeaklyRelatedTo
34     @L0.symmetric
35     // TODO L0.HasDomain DIA.Connector or DIA.BranchPoint
36     // TODO --> DIA.Connector or DIA.BranchPoint
37
38 DIA.Connector <T STR.Connection : L0.Type
39 // HN: removed, cannot be valid requirements
40     @L0.property DIA.AreConnected
41     @L0.property STR.Connects
42
43 DIA.Connection <T DIA.Element : L0.Type
44     >-- DIA.HasTransform
45     @L0.property DIA.HasPlainConnector
46     @L0.property DIA.HasArrowConnector
47     @L0.property DIA.HasBranchPoint
48     @L0.property STR.HasConnectionType
49     @L0.property DIA.Routing
50     @L0.assert DIA.HasStrokeScale 
51         1.0 : L0.Double
52
53 DIA.BranchPoint <T DIA.InteriorRouteNode
54     @L0.property DIA.Horizontal
55     @L0.property DIA.Vertical
56     @L0.property DIA.AreConnected
57
58 DIA.Horizontal
59     @L0.defTag 
60 DIA.Vertical
61     @L0.defTag
62
63 DIA.RoutingRelation : L0.Relation
64 DIA.Routing : DIA.RoutingRelation
65     @L0.tag L0.Abstract
66     @L0.defTag
67     L0.HasDescription "A relation meant to be inherited to create specific tags describing how a connection should be routed. The relation itself should be made adaptable to a routing strategy class org.simantics.g2d.routing.IRouter2. A connection can only have 0 to 1 Routing tags."
68 DIA.LinearRouting <R DIA.Routing
69     @L0.symmetric
70     L0.HasLabel "Straight"
71     L0.HasDescription "Connection line segments will be routed with straight lines between terminals, route points and branch points."
72 DIA.RightAngledRouting <R DIA.Routing
73     @L0.symmetric
74     L0.HasLabel "Right-angled"
75     L0.HasDescription "Connection line segments will be routed with x/y axis-aligned right-angled lines between so that the connection will is guaranteed to pass through each route and branch point."
76
77 DIA.HasDefaultRouting <R L0.IsRelatedTo
78     L0.HasDomain STR.ConnectionType
79     --> DIA.RoutingRelation
80
81 // NOTE: attach the diagram ontology default attachment relation to default structural modelling rules.
82 STR.DefaultModelingRules
83     STR.HasAttachmentRelation DIA.HasPlainConnector