is_straight_line_drawing.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <HTML>
  2. <!-- Copyright 2007 Aaron Windsor
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt)
  6. -->
  7. <Head>
  8. <Title>Boost Graph Library: is_straight_line_drawing</Title>
  9. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  10. ALINK="#ff0000">
  11. <IMG SRC="../../../boost.png"
  12. ALT="C++ Boost" width="277" height="86">
  13. <BR Clear>
  14. <H1><tt>is_straight_line_drawing</tt></H1>
  15. <p>
  16. <pre>
  17. template &lt;typename Graph, typename GridPositionMap, typename VertexIndexMap&gt;
  18. bool is_straight_line_drawing(const Graph& g, GridPositionMap drawing, VertexIndexMap vm);
  19. </pre>
  20. <p>
  21. If <tt>drawing</tt> is a property map modeling the PositionMap
  22. concept, <tt>is_straight_line_drawing</tt> returns true exactly when no two of
  23. the line segments induced by edges in the graph under <tt>drawing</tt>
  24. intersect. This function works correctly in the presence of self-loops and
  25. parallel edges, and can be used to verify the output of the function
  26. <tt>
  27. <a href="straight_line_drawing.html">chrobak_payne_straight_line_embedding.</a>
  28. </tt>
  29. <p>
  30. <h3>Complexity</h3>
  31. Runs in time <i>O(n log n)</i> on a planar graph with <i>n</i> vertices.
  32. <H3>Where Defined</H3>
  33. <P>
  34. <a href="../../../boost/graph/is_straight_line_drawing.hpp"><TT>boost/graph/is_straight_line_drawing.hpp</TT></a>
  35. <h3>Parameters</h3>
  36. IN: <tt>Graph&amp; g</tt>
  37. <blockquote>
  38. An undirected graph. The graph type must be a model of <a
  39. href="EdgeListGraph.html">Edge List Graph</a>
  40. </blockquote>
  41. IN: <tt>PositionMap</tt>
  42. <blockquote>
  43. A <a href="../../property_map/doc/LvaluePropertyMap.html">Readable LValue Property
  44. Map</a> that models the Position Map concept. The Position Map concept requires
  45. that the value mapped to be an object that has members <tt>x</tt> and
  46. <tt>y</tt>. For example, if <tt>p</tt> models PositionMap and <tt>v</tt>
  47. is a vertex in the graph, <tt>p[v].x</tt> and <tt>p[v].y</tt> are valid
  48. expressions. The type of <tt>x</tt> and <tt>y</tt> must be implicitly
  49. convertable to <tt>std::size_t</tt>.
  50. </blockquote>
  51. IN: <tt>VertexIndexMap vm</tt>
  52. <blockquote>
  53. A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map</a> that maps vertices from <tt>g</tt> to distinct integers in the range <tt>[0, num_vertices(g) )</tt><br>
  54. <b>Default</b>: <tt>get(vertex_index,g)</tt><br>
  55. </blockquote>
  56. <H3>Example</H3>
  57. <P>
  58. <a href="../example/straight_line_drawing.cpp"><TT>examples/straight_line_drawing.cpp</TT></a>
  59. <h3>See Also</h3>
  60. <p>
  61. <ul>
  62. <li><a href="planar_graphs.html">Planar Graphs in the Boost Graph Library</a>
  63. <li><a href="straight_line_drawing.html">
  64. <tt>chrobak_payne_straight_line_drawing</tt></a>
  65. </ul>
  66. <br>
  67. <HR>
  68. Copyright &copy; 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">aaron.windsor@gmail.com</a>)
  69. </BODY>
  70. </HTML>