Пример #1
0
  void operator()(
    std::ostream& out,
    const edge_descriptor& ed
  ) const noexcept {
    const ribi::cmap::Edge edge = get(m_my_custom_edge_map, ed);
    out << "[label=\""
      << edge //Can be Graphviz unfriendly
      << "\", "
    ;

    if (get(m_is_selected_map, ed))
    {
      out << "style = \"dashed\", ";
    }

    const bool has_head{edge.HasHeadArrow()};
    const bool has_tail{edge.HasTailArrow()};
    if ( has_head &&  has_tail) out << "dir = \"both\", arrowhead = \"normal\", arrowtail = \"normal\"";
    if ( has_head && !has_tail) out << "dir = \"forward\", arrowhead = \"normal\"";
    if (!has_head &&  has_tail) out << "dir = \"back\", arrowtail = \"normal\"";
    out << "]";
  }
bool ribi::cmap::operator==(const ribi::cmap::Edge& lhs, const ribi::cmap::Edge& rhs)
{
  assert(lhs.GetConcept()); assert(rhs.GetConcept());
  #ifndef NDEBUG
  if (*lhs.GetConcept()   != *rhs.GetConcept()) TRACE("Concept differs");
  if (*lhs.GetFrom()      != *rhs.GetFrom()) TRACE("From node differs");
  if (*lhs.GetTo()        != *rhs.GetTo()) TRACE("To node differs");
  if ( lhs.GetX()         != rhs.GetX()) TRACE("X differs");
  if ( lhs.GetY()         != rhs.GetY()) TRACE("Y differs");
  if ( lhs.HasHeadArrow() != rhs.HasHeadArrow()) TRACE("Has head arrow differs");
  if ( lhs.HasTailArrow() != rhs.HasTailArrow()) TRACE("Has tail arrow differs");
  #endif
  return
       *lhs.GetConcept()   == *rhs.GetConcept()
    && *lhs.GetFrom()      == *rhs.GetFrom()
    && *lhs.GetTo()        == *rhs.GetTo()
    &&  lhs.GetX()         == rhs.GetX()
    &&  lhs.GetY()         == rhs.GetY()
    &&  lhs.HasHeadArrow() == rhs.HasHeadArrow()
    &&  lhs.HasTailArrow() == rhs.HasTailArrow();
}