~ubuntu-branches/ubuntu/dapper/boost/dapper

« back to all changes in this revision

Viewing changes to libs/graph/src/python/circle_layout.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli, Christophe Prud'homme, Domenico Andreoli
  • Date: 2006-01-11 11:11:42 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060111111142-xy6z1i5himlgu8iw
Tags: 1.33.1-2
[ Christophe Prud'homme ]
* Bug fix: "libboost-wave-dev: Dependency on libboost-filesystem-dev
  missing", thanks to Martin v . Löwis (Closes: #346367).

[ Domenico Andreoli ]
* boost/graph/topological_sort.hpp: removed name of unused parameter
  to prevent long compiler warning.  Closes: #347519.
* Applied patch from upstream CVS to fix parsing of valid options
  with a common root.  Closes: #345714.
* libboost-python-dev now correctly depends on python2.4-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2005 The Trustees of Indiana University.
2
 
 
3
 
// Use, modification and distribution is subject to the Boost Software
4
 
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5
 
// http://www.boost.org/LICENSE_1_0.txt)
6
 
 
7
 
//  Authors: Douglas Gregor
8
 
//           Andrew Lumsdaine
9
 
#include <boost/graph/circle_layout.hpp>
10
 
#include "graph.hpp"
11
 
#include "digraph.hpp"
12
 
#include "point2d.hpp"
13
 
 
14
 
namespace boost { namespace graph { namespace python {
15
 
 
16
 
template<typename Graph>
17
 
void 
18
 
circle_graph_layout
19
 
  (Graph& g,
20
 
   const vector_property_map<point2d, typename Graph::VertexIndexMap>* in_pos,
21
 
   double radius)
22
 
{
23
 
  typedef vector_property_map<point2d, typename Graph::VertexIndexMap> 
24
 
    PositionMap;
25
 
 
26
 
  PositionMap pos = 
27
 
    in_pos? *in_pos : g.template get_vertex_map<point2d>("position");
28
 
 
29
 
  circle_graph_layout(g, pos, radius);
30
 
}
31
 
 
32
 
void export_circle_graph_layout()
33
 
{
34
 
  using boost::python::arg;
35
 
  using boost::python::def;
36
 
 
37
 
  def("circle_graph_layout", 
38
 
      &circle_graph_layout<Graph>,
39
 
      (arg("graph"), 
40
 
       arg("position") = 
41
 
         (vector_property_map<point2d, Graph::VertexIndexMap>*)0,
42
 
       arg("radius") = 250.0));
43
 
 
44
 
  def("circle_graph_layout", 
45
 
      &circle_graph_layout<Digraph>,
46
 
      (arg("graph"), 
47
 
       arg("position") = 
48
 
         (vector_property_map<point2d, Digraph::VertexIndexMap>*)0,
49
 
       arg("radius") = 250.0));
50
 
}
51
 
 
52
 
} } } // end namespace boost::graph::python