lib/measures/tbd/resources/model.rb
def split_directed_edge(directed_edge, new_edge)

      # directed edge is pointing to the new updated edge
      directed_edge.recalculate

      # make a new directed edge for the new edge
      offset = nil
      new_directed_edge = nil
      if directed_edge.inverted
        offset = 0
        new_directed_edge = get_directed_edge(new_edge.v1, new_edge.v0)
      else
        offset = 1
        new_directed_edge = get_directed_edge(new_edge.v0, new_edge.v1)
      end

      # update the wires referencing this directed edge
      parents = directed_edge.parents.dup
      parents.each do |wire|
        split_wire(wire, directed_edge, offset, new_directed_edge)
      end
    end
##
# Creates a new directed edge in same direction for the new edge.
# Updates wires which reference directed edge.
#
# @param [DirectedEdge] directed_edge Existing directed edge
# @param [Edge] new_edge New edge
Creates a new directed edge in same direction for the new edge.
Updates wires which reference directed edge.
Creates a new directed edge in same direction for the new edge . Updates wires which reference directed edge .
def split_directed_edge(directed_edge, new_edge)
      directed_edge.recalculate
      offset = nil
      new_directed_edge = nil
      if directed_edge.inverted
        offset = 0
        new_directed_edge = get_directed_edge(new_edge.v1, new_edge.v0)
      else
        offset = 1
        new_directed_edge = get_directed_edge(new_edge.v0, new_edge.v1)
      end
      parents = directed_edge.parents.dup
      parents.each do |wire|
        split_wire(wire, directed_edge, offset, new_directed_edge)
      end
    end
def split_directed_edge ( directed_edge , new_edge ) directed_edge . recalculate offset = nil new_directed_edge = nil if directed_edge . inverted offset = 0 new_directed_edge = get_directed_edge ( new_edge . v1 , new_edge . v0 ) else offset = 1 new_directed_edge = get_directed_edge ( new_edge . v0 , new_edge . v1 ) end parents = directed_edge . parents . dup parents . each do | wire | split_wire ( wire , directed_edge , offset , new_directed_edge ) end end
Creates a new directed edge in same direction for the new edge.
Creates a new directed edge in same direction for the new edge .
# directed edge is pointing to the new updated edge # make a new directed edge for the new edge # update the wires referencing this directed edge
directed_edge
new_edge
new_edge New edge
new_edge New edge