11 enum class Orientation { LEFT, RIGHT, UP, DOWN };
15 enum class ObjectType {
57 enum class PatchType { OTHER, TRACK, PAD, PAD_TH, VIA, PLANE, HOLE_PTH, HOLE_NPTH, BOARD_EDGE, TEXT };
59 extern const LutEnumStr<PatchType> patch_type_lut;
60 extern const LutEnumStr<ObjectType> object_type_lut;
61 extern const LutEnumStr<Orientation> orientation_lut;
71 template <
typename T>
class Coord {
82 Coord(T ix, T iy) : x(ix), y(iy)
88 Coord(std::vector<T> v) : x(v.at(0)), y(v.at(1))
119 bool operator==(
const Coord<T> &a)
const 121 return a.x == x && a.y == y;
123 bool operator!=(
const Coord<T> &a)
const 125 return !(a == *
this);
127 bool operator<(const Coord<T> &a)
const 141 return Coord<T>(std::min(a.x, b.x), std::min(a.y, b.y));
149 return Coord<T>(std::max(a.x, b.x), std::max(a.y, b.y));
168 return x * a.x + y * a.y;
176 return x * x + y * y;
197 std::array<T, 2> as_array()
const 212 Color(
double ir,
double ig,
double ib) : r(ir), g(ig), b(ib)
217 static Color new_from_int(
unsigned int ir,
unsigned ig,
unsigned ib)
219 return Color(ir / 255.0, ig / 255.0, ib / 255.0);
221 Color() : r(0), g(0), b(0)
226 constexpr int64_t
operator"" _mm(
long double i)
230 constexpr int64_t
operator"" _mm(
unsigned long long int i)
T dot(const Coord< T > &a) const
Definition: common.hpp:166
static Coord< T > min(const Coord< T > &a, const Coord< T > &b)
Definition: common.hpp:139
static Coord< float > euler(float r, float phi)
Definition: common.hpp:157
Class SHAPE.
Definition: shape.h:58
T mag_sq() const
Definition: common.hpp:174
static Coord< T > max(const Coord< T > &a, const Coord< T > &b)
Definition: common.hpp:147
GAL_LAYER_ID operator+(const GAL_LAYER_ID &a, int b)
Used for via types.
Definition: layers_id_colors_and_visibility.h:214
Definition: common.hpp:207
Your typical coordinate class.
Definition: common.hpp:71