Class: Lutaml::Ea::Diagram::PathBuilder
- Inherits:
-
Object
- Object
- Lutaml::Ea::Diagram::PathBuilder
- Includes:
- Util
- Defined in:
- lib/lutaml/ea/diagram/path_builder.rb
Overview
Path builder for connector rendering
This class calculates SVG path data for connectors between diagram elements, supporting various connector types and routing algorithms.
Instance Attribute Summary collapse
-
#connector ⇒ Object
readonly
Returns the value of attribute connector.
-
#source_element ⇒ Object
readonly
Returns the value of attribute source_element.
-
#target_element ⇒ Object
readonly
Returns the value of attribute target_element.
Instance Method Summary collapse
-
#build_path ⇒ String
Build SVG path data for the connector.
-
#initialize(connector, source_element = nil, target_element = nil) ⇒ PathBuilder
constructor
A new instance of PathBuilder.
Methods included from Util
#parse_ea_geometry, #parse_geometry_offsets
Constructor Details
#initialize(connector, source_element = nil, target_element = nil) ⇒ PathBuilder
Returns a new instance of PathBuilder.
18 19 20 21 22 |
# File 'lib/lutaml/ea/diagram/path_builder.rb', line 18 def initialize(connector, source_element = nil, target_element = nil) @connector = connector @source_element = source_element @target_element = target_element end |
Instance Attribute Details
#connector ⇒ Object (readonly)
Returns the value of attribute connector.
16 17 18 |
# File 'lib/lutaml/ea/diagram/path_builder.rb', line 16 def connector @connector end |
#source_element ⇒ Object (readonly)
Returns the value of attribute source_element.
16 17 18 |
# File 'lib/lutaml/ea/diagram/path_builder.rb', line 16 def source_element @source_element end |
#target_element ⇒ Object (readonly)
Returns the value of attribute target_element.
16 17 18 |
# File 'lib/lutaml/ea/diagram/path_builder.rb', line 16 def target_element @target_element end |
Instance Method Details
#build_path ⇒ String
Build SVG path data for the connector
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/lutaml/ea/diagram/path_builder.rb', line 26 def build_path return straight_path if simple_connector? return waypoint_path if geometry_has_waypoints? case connector[:routing_type] when "orthogonal" then orthogonal_path when "bezier" then bezier_path else manhattan_path end end |