src/miscallenous.h

changeset 861
83426c5fa732
parent 859
ebc7a186699c
child 862
a9aced38b8ba
equal deleted inserted replaced
860:a496e72af069 861:83426c5fa732
31 31
32 // Prime numbers 32 // Prime numbers
33 extern const int PrimeNumbers[NUM_PRIMES]; 33 extern const int PrimeNumbers[NUM_PRIMES];
34 34
35 // Simplifies the given fraction. 35 // Simplifies the given fraction.
36 void simplify (int& numer, int& denom); 36 void Simplify (int& numer, int& denom);
37 37
38 using ApplyToMatrixFunction = std::function<void (int, double&)>; 38 using ApplyToMatrixFunction = std::function<void (int, double&)>;
39 using ApplyToMatrixConstFunction = std::function<void (int, double)>; 39 using ApplyToMatrixConstFunction = std::function<void (int, double)>;
40 40
41 void RoundToDecimals (double& a, int decimals); 41 void RoundToDecimals (double& a, int decimals);
42 void applyToMatrix (Matrix& a, ApplyToMatrixFunction func); 42 void ApplyToMatrix (Matrix& a, ApplyToMatrixFunction func);
43 void applyToMatrix (const Matrix& a, ApplyToMatrixConstFunction func); 43 void ApplyToMatrix (const Matrix& a, ApplyToMatrixConstFunction func);
44 44
45 double GetCoordinateOf (const Vertex& a, Axis ax); 45 double GetCoordinateOf (const Vertex& a, Axis ax);
46 QString MakePrettyFileSize (qint64 size); 46 QString MakePrettyFileSize (qint64 size);
47 47
48 QString Join (QList<StringFormatArg> vals, QString delim = ""); 48 QString Join (QList<StringFormatArg> vals, QString delim = "");
89 { 89 {
90 Coordinate, 90 Coordinate,
91 Angle 91 Angle
92 }; 92 };
93 93
94 double snap (double value, const Grid::Config type); 94 double Snap (double value, const Grid::Config type);
95 } 95 }

mercurial