demo/descriptor_map_demo.cc
changeset 2121 09a07a851506
parent 1956 a055123339d5
child 2207 75a29ac69c19
equal deleted inserted replaced
5:a47f3f3882db 6:71967e61a165
    14  * express or implied, and with no claim as to its suitability for any
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    15  * purpose.
    16  *
    16  *
    17  */
    17  */
    18 
    18 
       
    19 /// \ingroup demos
       
    20 /// \file
       
    21 /// \brief Using descriptor map and own special map types.
       
    22 ///
       
    23 /// This demo shows how can be used the DescriptorMap class
       
    24 /// which helps to use unique label for each node or edge.
       
    25 /// And it gives an example how easy is creating own map types.
       
    26 ///
       
    27 /// \include descriptor_map_demo.cc
       
    28 
    19 #include <lemon/list_graph.h>
    29 #include <lemon/list_graph.h>
    20 #include <lemon/graph_utils.h>
    30 #include <lemon/graph_utils.h>
    21 #include <lemon/graph_writer.h>
    31 #include <lemon/graph_writer.h>
    22 #include <lemon/xy.h>
    32 #include <lemon/xy.h>
    23 #include <lemon/graph_to_eps.h>
    33 #include <lemon/graph_to_eps.h>
    28 #include <cmath>
    38 #include <cmath>
    29 #include <ctime>
    39 #include <ctime>
    30 
    40 
    31 using namespace lemon;
    41 using namespace lemon;
    32 
    42 
    33 // Special map type
    43 // Special xy<double> map type 
    34 // It gives back a position for each node. The position of the nodes 
    44 //
       
    45 // It gives back a position for each node. The position of the nodes
    35 // are on the circle with the given center and radius.
    46 // are on the circle with the given center and radius.
    36 //
    47 //
    37 // Because we use the descriptor map it will hold the proprty described above
    48 // Because we use the descriptor map it will hold the proprty
    38 // even if a node added or deleted. 
    49 // described above even if a node added or deleted.
    39 template <typename Graph>
    50 template <typename Graph>
    40 class CircleMap {
    51 class CircleMap {
    41 public:
    52 public:
    42 
    53 
    43   typedef xy<double> Value;
    54   typedef xy<double> Value;