snake_typedefs.h 1.26 KB
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2 3 4 5
#pragma once

#include <vector>
#include <array>
#include <boost/geometry.hpp>
Valentin Platzgummer's avatar
Valentin Platzgummer committed
6

7
#include <boost/units/systems/si.hpp>
Valentin Platzgummer's avatar
Valentin Platzgummer committed
8 9 10 11 12
#include <boost/units/systems/si/io.hpp>
#include <boost/units/systems/si/plane_angle.hpp>
#include <boost/units/systems/si/prefixes.hpp>
#include <boost/units/systems/angle/degrees.hpp>

Valentin Platzgummer's avatar
Valentin Platzgummer committed
13 14

namespace bg = boost::geometry;
15
namespace bu = boost::units;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
16 17 18 19 20 21 22
namespace snake {

typedef bg::model::point<double, 2, bg::cs::cartesian>  BoostPoint;
//typedef std::vector<BoostPoint>                        BoostPointList;
typedef bg::model::polygon<BoostPoint>                  BoostPolygon;
typedef bg::model::linestring<BoostPoint>               BoostLineString;
typedef std::vector<std::vector<int64_t>>               Int64Matrix;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
23
typedef bg::model::box<BoostPoint>                      BoostBox;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
24

25 26 27
typedef bu::quantity<bu::si::length> Length;
typedef bu::quantity<bu::si::area> Area;
typedef bu::quantity<bu::si::plane_angle> Angle;
28

Valentin Platzgummer's avatar
Valentin Platzgummer committed
29
}
30 31 32 33 34 35 36 37 38 39 40 41 42

namespace boost{
namespace geometry{
namespace model {
bool operator==(snake::BoostPoint p1, snake::BoostPoint p2){
    return (p1.get<0>() == p2.get<0>()) && (p1.get<1>() == p2.get<1>());
}
bool operator!=(snake::BoostPoint p1, snake::BoostPoint p2){
    return !(p1 == p2);
}
} // namespace model
} // namespace geometry
} // namespace boost