graph_defs.hpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /**
  2. * @file tests/plot/graph_defs.hpp
  3. * @author The PARADEVS Development Team
  4. * See the AUTHORS or Authors.txt file
  5. */
  6. /*
  7. * PARADEVS - the multimodeling and simulation environment
  8. * This file is a part of the PARADEVS environment
  9. *
  10. * Copyright (C) 2013-2015 ULCO http://www.univ-litoral.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #ifndef __TESTS_PLOT_GRAPH_DEFS_HPP
  26. #define __TESTS_PLOT_GRAPH_DEFS_HPP 1
  27. #include <boost/graph/adjacency_list.hpp>
  28. #include <vector>
  29. namespace paradevs { namespace tests { namespace boost_graph {
  30. struct Point
  31. {
  32. double _x;
  33. double _y;
  34. Point() : _x(0), _y(0)
  35. { }
  36. Point(double x, double y) : _x(x), _y(y)
  37. { }
  38. Point(const Point& pt) : _x(pt._x), _y(pt._y)
  39. { }
  40. };
  41. typedef std::vector < Point > Points;
  42. struct VertexProperties
  43. {
  44. int _index;
  45. double _weight;
  46. Points _points;
  47. int _neighbour_number;
  48. VertexProperties() : _index(0), _weight(0), _neighbour_number(0)
  49. { }
  50. VertexProperties(int index, double weight, const Points& points,
  51. int neighbour_number) :
  52. _index(index), _weight(weight), _points(points),
  53. _neighbour_number(neighbour_number)
  54. { }
  55. VertexProperties(const VertexProperties& vp) :
  56. _index(vp._index), _weight(vp._weight), _points(vp._points),
  57. _neighbour_number(vp._neighbour_number)
  58. { }
  59. };
  60. struct EdgeProperties
  61. {
  62. double _weight;
  63. EdgeProperties() : _weight(0)
  64. { }
  65. EdgeProperties(double weight) : _weight(weight)
  66. { }
  67. };
  68. typedef boost::adjacency_list < boost::vecS,
  69. boost::vecS,
  70. boost::bidirectionalS,
  71. VertexProperties,
  72. EdgeProperties > OrientedGraph;
  73. typedef boost::adjacency_list < boost::vecS,
  74. boost::vecS,
  75. boost::undirectedS,
  76. VertexProperties,
  77. EdgeProperties > UnorientedGraph;
  78. } } } // namespace paradevs tests boost_graph
  79. #endif