aboutsummaryrefslogtreecommitdiff
path: root/src/compensations.h
blob: f034abcf94ae5897ed35f29b6b60544f455bc605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef INCLUDED_COMPENSATIONS_H
#define INCLUDED_COMPENSATIONS_H

#include "critical_points.h"

enum compensation_replace {
  CR_FROM_BEG_TO_BEG = 0b00,
  CR_FROM_BEG_TO_END = 0b01,
  CR_FROM_END_TO_BEG = 0b10,
  CR_FROM_END_TO_END = 0b11,
};

enum compensation_type {
  CT_IN,
  CT_OUT,
  CT_TRANSFER,
  CT_LOOP,
};

struct polyline {
  struct vec2 *items;
  uint32_t count;
  uint32_t capacity;
};

struct compensation {
  struct vec2 initial_position;
  struct polyline polyline;
  struct path_element *from;
  struct path_element *to;
  enum compensation_replace replace;
};

struct compensations {
  struct compensation *items;
  uint32_t count;
  uint32_t capacity;
};

struct compensations synthesize_compensations (const struct critical_points *);

#endif // INCLUDED_COMPENSATIONS_H