src/miscallenous.h

changeset 1217
314e12e23c3a
parent 1012
413ecd6b9801
child 1221
7f6715f08faf
equal deleted inserted replaced
1216:12f9ea615cbc 1217:314e12e23c3a
25 class LDDocument; 25 class LDDocument;
26 class QColor; 26 class QColor;
27 class QAction; 27 class QAction;
28 28
29 // Simplifies the given fraction. 29 // Simplifies the given fraction.
30 void Simplify (int& numer, int& denom); 30 void Simplify(int& numer, int& denom);
31 31
32 using ApplyToMatrixFunction = std::function<void (int, double&)>; 32 using ApplyToMatrixFunction = std::function<void(int, double&)>;
33 using ApplyToMatrixConstFunction = std::function<void (int, double)>; 33 using ApplyToMatrixConstFunction = std::function<void(int, double)>;
34 34
35 void RoundToDecimals (double& a, int decimals); 35 void RoundToDecimals(double& a, int decimals);
36 void ApplyToMatrix (Matrix& a, ApplyToMatrixFunction func); 36 void ApplyToMatrix(Matrix& a, ApplyToMatrixFunction func);
37 void ApplyToMatrix (const Matrix& a, ApplyToMatrixConstFunction func); 37 void ApplyToMatrix(const Matrix& a, ApplyToMatrixConstFunction func);
38 38
39 double GetCoordinateOf (const Vertex& a, Axis ax); 39 double GetCoordinateOf(const Vertex& a, Axis ax);
40 QString MakePrettyFileSize (qint64 size); 40 QString MakePrettyFileSize(qint64 size);
41 41
42 QString Join (QList<StringFormatArg> vals, QString delim = " "); 42 QString Join(QList<StringFormatArg> vals, QString delim = " ");
43 43
44 // Grid stuff 44 // Grid stuff
45 float gridCoordinateSnap(); 45 float gridCoordinateSnap();
46 float gridAngleSnap(); 46 float gridAngleSnap();
47 float gridBezierCurveSegments(); 47 float gridBezierCurveSegments();
53 WorldOrigin, 53 WorldOrigin,
54 CustomPoint, 54 CustomPoint,
55 NumValues 55 NumValues
56 }; 56 };
57 57
58 Vertex GetRotationPoint (const LDObjectList& objs); 58 Vertex GetRotationPoint(const LDObjectList& objs);
59 void ConfigureRotationPoint(); 59 void ConfigureRotationPoint();
60 60
61 // ============================================================================= 61 // =============================================================================
62 namespace Grid 62 namespace Grid
63 { 63 {
72 { 72 {
73 Coordinate, 73 Coordinate,
74 Angle 74 Angle
75 }; 75 };
76 76
77 double Snap (double value, const Grid::Config type); 77 double Snap(double value, const Grid::Config type);
78 } 78 }

mercurial