diff -r ac1744536b33 -r 47e7773c7841 src/misc.h --- a/src/misc.h Tue Jan 07 08:26:15 2014 +0200 +++ b/src/misc.h Tue Jan 07 08:53:27 2014 +0200 @@ -45,7 +45,8 @@ // Grid stuff struct gridinfo -{ const char* const name; +{ + const char* const name; float* const confs[4]; }; @@ -54,12 +55,14 @@ extern const gridinfo g_GridInfo[3]; inline const gridinfo& currentGrid() -{ return g_GridInfo[grid]; +{ + return g_GridInfo[grid]; } // ============================================================================= enum RotationPoint -{ ObjectOrigin, +{ + ObjectOrigin, WorldOrigin, CustomPoint }; @@ -69,14 +72,17 @@ // ============================================================================= namespace Grid -{ enum Type - { Coarse, +{ + enum Type + { + Coarse, Medium, Fine }; enum Config - { X, + { + X, Y, Z, Angle @@ -87,7 +93,8 @@ // ----------------------------------------------------------------------------- class InvokationDeferer : public QObject -{ Q_OBJECT +{ + Q_OBJECT public: using FunctionType = void(*)(); @@ -110,40 +117,48 @@ // ----------------------------------------------------------------------------- // Plural expression template static inline const char* plural (T n) -{ return (n != 1) ? "s" : ""; +{ + return (n != 1) ? "s" : ""; } // ----------------------------------------------------------------------------- // Templated clamp template static inline T clamp (T a, T min, T max) -{ return (a > max) ? max : (a < min) ? min : a; +{ + return (a > max) ? max : (a < min) ? min : a; } // Templated minimum template static inline T min (T a, T b) -{ return (a < b) ? a : b; +{ + return (a < b) ? a : b; } // Templated maximum template static inline T max (T a, T b) -{ return (a > b) ? a : b; +{ + return (a > b) ? a : b; } // Templated absolute value template static inline T abs (T a) -{ return (a >= 0) ? a : -a; +{ + return (a >= 0) ? a : -a; } template inline bool isZero (T a) -{ return abs (a) < 0.0001; +{ + return abs (a) < 0.0001; } template inline bool isInteger (T a) -{ return isZero (a - (int) a); +{ + return isZero (a - (int) a); } template void removeDuplicates (QList& a) -{ std::sort (a.begin(), a.end()); +{ + std::sort (a.begin(), a.end()); a.erase (std::unique (a.begin(), a.end()), a.end()); }