This repository has been archived on 2023-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
GINPA/Headers/structures.h

71 lines
925 B
C

#pragma once
#include <inttypes.h>
#include <stdbool.h>
#include <time.h>
#include <SFML/Graphics.h>
typedef struct Agglomerat Agglomerat;
typedef struct Route Route;
typedef struct Intersection Intersection;
typedef enum {NONE, AGGLOMERAT, ROUTE} TypePt;
typedef struct
{
double lat;
double lon;
} Coordonnees;
typedef struct
{
time_t date;
Coordonnees pos;
TypePt type;
} Point;
struct Agglomerat
{
Coordonnees moy;
Point **agglo;
uint32_t nbPts;
Route **ptRoute;
double rayon;
};
struct Route
{
Point **chemin;
uint32_t nbPts;
Agglomerat *ptAgglo[2];
};
struct Intersection
{
Route **ptRoute;
Point **intersection;
uint32_t nbPts;
};
typedef enum
{
SUCCESS,
LOAD_SUCCESS,
MISSING_FILE,
CORRUPTED_FILE,
ALLOCATION_FAILURE,
REQUEST_FAILURE
} ErrEnum;
typedef struct
{
sfVector2f centre;
double rayon;
} Cercle;
typedef struct
{
sfVector2f positionHG;
sfVector2f positionBD;
} Rectangle;