11
2- struct AliasGraph{G, A}
3- graph:: G
2+ struct AliasGraph{G,A}
3+ graph:: G
44 alias:: A
55end
66
@@ -25,23 +25,23 @@ The following transformation orders are accepted:
2525Create a new, empty `FrameSystem` object of order `O`, datatype `T` and timescale `S`.
2626The parameter `S` can be dropped, in case the default (`BarycentricDynamicalTime`) is used.
2727"""
28- struct FrameSystem{O, T<: Number , S<: AbstractTimeScale }
29- points:: AliasGraph{PointsGraph{O, T}, Dict{Symbol, Int}}
30- axes:: AliasGraph{AxesGraph{O, T}, Dict{Symbol, Int}}
31- dir:: Dict{Symbol, Direction{O, T}}
28+ struct FrameSystem{O,T<: Number ,S<: AbstractTimeScale }
29+ points:: AliasGraph{PointsGraph{O,T},Dict{Symbol,Int}}
30+ axes:: AliasGraph{AxesGraph{O,T},Dict{Symbol,Int}}
31+ dir:: Dict{Symbol,Direction{O,T}}
3232end
3333
34- function FrameSystem {O, T, S} () where {O, T, S}
35- return FrameSystem {O, T, S} (
36- AliasGraph (MappedGraph (FramePointNode{O, T}), Dict {Symbol, Int} ()),
37- AliasGraph (MappedGraph (FrameAxesNode{O, T}), Dict {Symbol, Int} ()),
34+ function FrameSystem {O,T, S} () where {O,T, S}
35+ return FrameSystem {O,T, S} (
36+ AliasGraph (MappedGraph (FramePointNode{O,T}), Dict {Symbol,Int} ()),
37+ AliasGraph (MappedGraph (FrameAxesNode{O,T}), Dict {Symbol,Int} ()),
3838 Dict ()
3939 )
4040end
4141
42- @inline FrameSystem {O, T} () where {O, T} = FrameSystem {O, T, BarycentricDynamicalTime} ()
42+ @inline FrameSystem {O,T} () where {O,T} = FrameSystem {O,T, BarycentricDynamicalTime} ()
4343
44- function Base. summary (io:: IO , :: FrameSystem{O, T, S} ) where {O, T, S}
44+ function Base. summary (io:: IO , :: FrameSystem{O,T, S} ) where {O,T, S}
4545 return println (io, " FrameSystem{$O , $T , $S }" )
4646end
4747
5050
5151Return the frame system order `O`.
5252"""
53- @inline order (:: FrameSystem{O} ) where O = O
53+ @inline order (:: FrameSystem{O} ) where {O} = O
5454
5555"""
5656 timescale(frames::FrameSystem{O, T, S}) where {O, T, S}
5757
5858Return the frame system order timescale `S`.
5959"""
60- @inline timescale (:: FrameSystem{O, T, S} ) where {O, T, S} = S
60+ @inline timescale (:: FrameSystem{O,T, S} ) where {O,T, S} = S
6161
6262"""
6363 points_graph(frames::FrameSystem)
@@ -99,7 +99,7 @@ Return the direction dictionary.
9999
100100Get the `id` associate to a point.
101101"""
102- @inline point_id (:: FrameSystem , id:: Int ) = id
102+ @inline point_id (:: FrameSystem , id:: Int ) = id
103103@inline point_id (f:: FrameSystem , name:: Symbol ) = points_alias (f)[name]
104104
105105"""
@@ -115,7 +115,7 @@ Get the `id` associate to an axes.
115115
116116Add point to the frame system.
117117"""
118- function add_point! (fs:: FrameSystem{O, T} , p:: FramePointNode{O, T} ) where {O,T}
118+ function add_point! (fs:: FrameSystem{O,T} , p:: FramePointNode{O,T} ) where {O,T}
119119 push! (fs. points. alias, Pair (p. name, p. id))
120120 return add_vertex! (fs. points. graph, p)
121121end
125125
126126Add axes to the frame system.
127127"""
128- function add_axes! (fs:: FrameSystem{O, T} , ax:: FrameAxesNode{O, T} ) where {O,T}
128+ function add_axes! (fs:: FrameSystem{O,T} , ax:: FrameAxesNode{O,T} ) where {O,T}
129129 push! (fs. axes. alias, Pair (ax. name, ax. id))
130130 return add_vertex! (fs. axes. graph, ax)
131131end
@@ -162,7 +162,7 @@ function _fmt_node(n::FrameAxesNode)
162162 return " $(n. name) (id=$(n. id) )"
163163end
164164
165- function prettyprint (g:: Union{AxesGraph, PointsGraph} )
165+ function prettyprint (g:: Union{AxesGraph,PointsGraph} )
166166 if ! isempty (g. nodes)
167167 println (_fmt_node (g. nodes[1 ]))
168168 _print_frame_graph (g, get_node_id (g. nodes[1 ]), 2 , " " , " │ " )
@@ -180,11 +180,12 @@ function _print_frame_graph(g, pid::Int, idx::Int, last::String, prefix::String)
180180 end
181181end
182182
183- function Base. show (io:: IO , g:: FrameSystem{O, T, S} ) where {O, T, S}
183+ function Base. show (io:: IO , g:: FrameSystem{O,T, S} ) where {O,T, S}
184184 println (
185- io,
186- " FrameSystem{$O , $T , $S } with $(length (points_graph (g). nodes)) "
187- * " points, $(length (axes_graph (g). nodes)) axes and $(length (g. dir)) directions"
185+ io,
186+ " FrameSystem{$O , $T , $S } with $(length (points_graph (g). nodes)) "
187+ *
188+ " points, $(length (axes_graph (g). nodes)) axes and $(length (g. dir)) directions"
188189 )
189190 if ! isempty (points_graph (g). nodes)
190191 printstyled (io, " \n Points: \n " ; bold= true )
0 commit comments