lib/measures/tbd/resources/model.rb
def split_edge(edge, new_vertex)
      v1 = edge.v1

      # simulate friend access to set v1 on edge
      edge.instance_variable_set(:@v1, new_vertex)
      edge.recalculate

      # make a new edge
      new_edge = get_edge(new_vertex, v1)

      # update the directed edges referencing this edge
      parents = edge.parents.dup
      parents.each do |directed_edge|
        split_directed_edge(directed_edge, new_edge)
      end
    end
##
# Adds new vertex between edges's v0 and v1, edge now goes from
# v0 to new vertex and a new_edge goes from new vertex to v1.
# Updates directed edges which reference edge.
#
# @param [Edge] edge Edge to modify
# @param [Vertex] new_vertex Vertex to add
Adds new vertex between edges's v0 and v1, edge now goes from
v0 to new vertex and a new_edge goes from new vertex to v1.
Updates directed edges which reference edge.
Adds new vertex between edges ' s v0 and v1 edge now goes from v0 to new vertex and a new_edge goes from new vertex to v1 . Updates directed edges which reference edge .
def split_edge(edge, new_vertex)
      v1 = edge.v1
      edge.instance_variable_set(:@v1, new_vertex)
      edge.recalculate
      new_edge = get_edge(new_vertex, v1)
      parents = edge.parents.dup
      parents.each do |directed_edge|
        split_directed_edge(directed_edge, new_edge)
      end
    end
def split_edge ( edge , new_vertex ) v1 = edge . v1 edge . instance_variable_set ( :@v1 , new_vertex ) edge . recalculate new_edge = get_edge ( new_vertex , v1 ) parents = edge . parents . dup parents . each do | directed_edge | split_directed_edge ( directed_edge , new_edge ) end end
Adds new vertex between edges's v0 and v1, edge now goes from
v0 to new vertex and a new_edge goes from new vertex to v1.
Adds new vertex between edges ' s v0 and v1 edge now goes from v0 to new vertex and a new_edge goes from new vertex to v1 .
# simulate friend access to set v1 on edge # make a new edge # update the directed edges referencing this edge
edge
new_vertex
new_vertex Vertex to add
new_vertex Vertex to add