379 class GridUGraph : public ExtendedGridUGraphBase { |
379 class GridUGraph : public ExtendedGridUGraphBase { |
380 public: |
380 public: |
381 |
381 |
382 typedef ExtendedGridUGraphBase Parent; |
382 typedef ExtendedGridUGraphBase Parent; |
383 |
383 |
384 /// \brief Map to get the indices of the nodes as xy<int>. |
384 /// \brief Map to get the indices of the nodes as dim2::Point<int>. |
385 /// |
385 /// |
386 /// Map to get the indices of the nodes as xy<int>. |
386 /// Map to get the indices of the nodes as dim2::Point<int>. |
387 class IndexMap { |
387 class IndexMap { |
388 public: |
388 public: |
389 /// \brief The key type of the map |
389 /// \brief The key type of the map |
390 typedef GridUGraph::Node Key; |
390 typedef GridUGraph::Node Key; |
391 /// \brief The value type of the map |
391 /// \brief The value type of the map |
392 typedef xy<int> Value; |
392 typedef dim2::Point<int> Value; |
393 |
393 |
394 /// \brief Constructor |
394 /// \brief Constructor |
395 /// |
395 /// |
396 /// Constructor |
396 /// Constructor |
397 IndexMap(const GridUGraph& _graph) : graph(_graph) {} |
397 IndexMap(const GridUGraph& _graph) : graph(_graph) {} |
398 |
398 |
399 /// \brief The subscript operator |
399 /// \brief The subscript operator |
400 /// |
400 /// |
401 /// The subscript operator. |
401 /// The subscript operator. |
402 Value operator[](Key key) const { |
402 Value operator[](Key key) const { |
403 return xy<int>(graph.row(key), graph.col(key)); |
403 return dim2::Point<int>(graph.row(key), graph.col(key)); |
404 } |
404 } |
405 |
405 |
406 private: |
406 private: |
407 const GridUGraph& graph; |
407 const GridUGraph& graph; |
408 }; |
408 }; |