LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
const.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <assert.h>
4 #include <cad/settings.h>
5 
6 #define LCTOLERANCE Settings::val("LCTOLERANCE")
7 #define LCARCTOLERANCE 1.0e-10
8 #define BBHEURISTIC 1.0e-5
9 #define BBHEURISTIC2 1.0e-3
10 //squared tolerance
11 #define TOLERANCE15 1.5e-15
12 #define TOLERANCE2 1.0e-20
13 #define TOLERANCE_ANGLE 1.0e-8
14 
15 #ifndef M_PI
16 #define M_PI 3.14159265358979323846
17 #endif
18 
19 #define DECLARE_SHORT_SHARED_PTR(type) \
20  using type##_SPtr = std::shared_ptr<type>; \
21  using type##_CSPtr = std::shared_ptr<const type>;
22 
23 template<typename T>
24 T * ptr(T & obj) { return &obj; } //turn reference into pointer!
25 
26 template<typename T>
27 T * ptr(T * obj) { return obj; } //obj is already pointer, return it!
28 
29 
30 namespace lc {
31 enum class Units {
32  Inch,
33  Foot,
34  Mile,
35  Millimeter,
36  Centimeter,
37  Meter,
38  Kilometer,
39  Microinch,
40  Mil,
41  Yard,
42  Angstrom,
43  Nanometer,
44  Micron,
45  Decimeter,
46  Decameter,
47  Hectometer,
48  Gigameter,
49  Astro,
50  Lightyear,
51  Parsec,
52  None
53 };
54 
55 enum class AngleFormat {
58  Gradians,
59  Radians,
60  Surveyors
61 };
62 
63 }
64 
AngleFormat
Definition: const.h:55
Units
Definition: const.h:31
Definition: cadentity.h:12
T * ptr(T &obj)
Definition: const.h:24