00001
00002
00003
00004
00005
00006
00007 #ifdef ATLAS_EXPORTS
00008 #define ATLAS_API __declspec(dllexport)
00009 #else
00010 #define ATLAS_API __declspec(dllimport)
00011 #endif
00012
00014 typedef float AT_scalar;
00015
00016
00018 typedef AT_scalar (* AT_CalculateDistanceCallbackType) (int vID0, int vID1, void *userDef);
00019 typedef AT_scalar (* AT_AstarHeuristicCallbackType) (int vID0, int vID1, void *userDef);
00020
00037
00038
00041 #define AT_SUCCESS 0
00042
00043 #define AT_ILLEGAL_VALUE -1
00044
00045 #define AT_EDGE_ALREADY_EXISTS -2
00046
00047 #define AT_NO_PATH_FOUND -3
00048
00049 #define AT_NO_SUCH_VERTEX -4
00050
00051 #define AT_NO_SUCH_EDGE -5
00052
00053 #define AT_GRAPH_DIRECTED -6
00054
00055 #define AT_NEED_RECALCULATION -7
00056
00058 class ATLAS_API CAtlas {
00059
00060 private:
00061 void* main;
00062
00063 public:
00070 CAtlas (int dimension, bool directed);
00071
00075 virtual ~CAtlas ();
00076
00082 int GetDimension (int *dimension);
00083
00084
00092 int AddVertex (AT_scalar *conf, int *vID, void *userDef=NULL);
00093
00099 int RemoveVertex (int vID);
00100
00108 int GetVertexConfiguration (int vID, AT_scalar* conf, void **userDef=NULL);
00109
00115 int GetNrVertices (int *nr);
00116
00122 int GetVertices (int *vIDs);
00123
00130 int SetUserDef (int vID, void *userDef);
00131
00132
00141 int AddEdge (int vID0, int vID1, AT_scalar value, void *userDef=NULL);
00142
00149 int RemoveEdge (int vID0, int vID1);
00150
00157 int GetNrPredecessors (int vID, int *nr);
00158
00165 int GetNrSuccessors (int vID, int *nr);
00166
00174 int GetSuccessor (int vID, int nr, int *nID);
00175
00183 int GetPredecessor (int vID, int nr, int *nID);
00184
00191 int GetPredecessors (int vID, int *ids);
00192
00199 int GetSuccessors (int vID, int *ids);
00200
00209 int SetEdgeConfiguration (int vID0, int vID1, AT_scalar value, void *userDef=NULL);
00210
00219 int GetEdgeConfiguration (int vID0, int vID1, AT_scalar *value, void **userDef=NULL);
00220
00228 int SetEdgeInvalidation (int vID0, int vID1, bool invalidate);
00229
00230
00236 int FindShortestPaths (int startID);
00237
00242 int FindAllPairsShortestPaths ();
00243
00253 int AStar (int startID, int goalID, AT_AstarHeuristicCallbackType ASHCB, int *size, void *userDef=NULL);
00254
00261 int GetAStarQueryVertex (int nr, int *vID);
00262
00270 int Query (int goalID, int *size, AT_scalar *length=NULL);
00271
00280 int Query (int startID, int goalID, int *size, AT_scalar *length=NULL);
00281
00288 int GetQueryVertex (int nr, int* vID);
00289
00297 int VerticesConnected (int vID0, int vID1, bool *connected);
00298
00299
00304 int ResetGraph ();
00305
00311 int LoadGraph (char *fileName);
00312
00318 int SaveGraph (char *fileName);
00319
00330 int CheckUsefulCycle (int startID, int goalID, AT_scalar K, AT_CalculateDistanceCallbackType calcDistCB, bool *result, void *userDef=NULL);
00331 };
00332