IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
PathMapTileEdge.h
Go to the documentation of this file.
1 /**
2  * \file IMP/bff/PathMapTileEdge.h
3  * \brief Tile edges used in path search by PathMap
4  *
5  * \authors Thomas-Otavio Peulen
6  * Copyright 2007-2022 IMP Inventors. All rights reserved.
7  *
8  */
9 #ifndef IMPBFF_PATHMAPTILEEDGE_H
10 #define IMPBFF_PATHMAPTILEEDGE_H
11 
12 #include <IMP/bff/bff_config.h>
13 #include <IMP/Value.h>
14 #include <IMP/value_macros.h>
15 #include <IMP/showable_macros.h>
16 
17 #include <vector>
18 
19 IMPBFF_BEGIN_NAMESPACE
20 
21 class PathMap;
22 class PathMapTile;
23 
24 
25 class PathMapTileEdge : public Value {
26 
27 friend class PathMapTile;
28 friend class PathMap;
29 
30 
31 protected:
32 
33  int tile_idx; /// The tile the edge is pointing to
34  float length; /// the path length / cost of going to the tile
35 
36 public:
37 
38  /// Length of an edge (usually cartesian distance between tiles)
39  float get_length() const{
40  return length;
41  }
42 
43  /*!
44  *
45  * @param edge_target
46  * @param edge_cost
47  */
48  PathMapTileEdge(
49  int edge_target = -1,
50  float edge_cost = std::numeric_limits<float>::max()
51  ) :
52  tile_idx(edge_target), length(edge_cost){}
53 
54  IMP_SHOWABLE_INLINE(PathMapTileEdge,
55  { out << "PathMapTileEdge"; });
56 };
57 IMP_VALUES(PathMapTileEdge, PathMapTileEdges);
58 
59 
60 IMPBFF_END_NAMESPACE
61 
62 #endif //IMPBFF_PATHMAPTILEEDGE_H
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
A more IMP-like version of the std::vector.
Definition: Vector.h:50
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
Base class for a simple primitive-like type.
Macros to help in implementing Value objects.
Macros to help with objects that can be printed to a stream.