diff --git a/dollar/EngineN.cpp b/dollar/EngineN.cpp index 7cfe1c2..02d119f 100644 --- a/dollar/EngineN.cpp +++ b/dollar/EngineN.cpp @@ -38,7 +38,7 @@ static float angleBetweenUnitVectors(const vec2& _vect1, const vec2& _vect2) { if (n < -1.0 || n > +1.0){ n = round(n*100000.0f)/100000.0f; } - return std::acos(n); // arc cosine of the vector dot product + return etk::acos(n); // arc cosine of the vector dot product } static float pathDistance(const etk::Vector& _path1, const etk::Vector& _path2) { @@ -123,8 +123,8 @@ float dollar::EngineN::optimalCosineDistance(const etk::Vector& _vect1, co DOLLAR_ERROR("devide by 0"); return M_PI; } - float angle = std::atan(somCross / somDot); - return std::acos(somDot * std::cos(angle) + somCross * std::sin(angle)); + float angle = etk::atan(somCross / somDot); + return etk::acos(somDot * etk::cos(angle) + somCross * etk::sin(angle)); } diff --git a/dollar/EnginePPlus.cpp b/dollar/EnginePPlus.cpp index 00e72ce..9cc5bfd 100644 --- a/dollar/EnginePPlus.cpp +++ b/dollar/EnginePPlus.cpp @@ -219,7 +219,7 @@ float dollar::EnginePPlus::calculatePPlusDistance(const etk::Vector& _poin // now we add panality: fullDistance += float(nbTestNotUsed)* m_penalityNotLinkSample; fullDistance += float(nbReferenceNotUsed)* m_penalityNotLinkRef; - fullDistance += std::abs(_inputAspectRatio - _referenceAspectRatio)*m_penalityAspectRatio; + fullDistance += etk::abs(_inputAspectRatio - _referenceAspectRatio)*m_penalityAspectRatio; for (size_t kkk=0; kkkgetEnginePoints(), dataPair, inputAspectRatio, gesture->getAspectRatio()); //distance = calculatePPlusDistanceSimple(points, gesture->getEnginePoints(), dataPair); if (nbStrokeRef != nbStrokeSample) { - distance += 0.1f*float(std::abs(nbStrokeRef-nbStrokeSample)); + distance += 0.1f*float(etk::abs(nbStrokeRef-nbStrokeSample)); } //storeSVG("out_dollar/lib/recognizePPlus/" + gesture->getName() + "_" + etk::toString(gesture->getId()) + ".svg", gesture, _strokes, points, dataPair, m_scaleKeepRatio); for (size_t kkk=0; kkk> loadPointsJson(const ejson::Document& _doc return out; } -etk::Vector> dollar::loadPoints(const etk::String& _fileName, etk::String* _label, std::string* _type) { +etk::Vector> dollar::loadPoints(const etk::String& _fileName, etk::String* _label, etk::String* _type) { ejson::Document doc; doc.load(_fileName); if (_label != nullptr) { diff --git a/dollar/Gesture.hpp b/dollar/Gesture.hpp index 1817fc0..59c0f6a 100644 --- a/dollar/Gesture.hpp +++ b/dollar/Gesture.hpp @@ -46,5 +46,5 @@ namespace dollar { * @brief Load all point from a specific file * */ - etk::Vector> loadPoints(const etk::String& _fileName, etk::String* _label=nullptr, std::string* _type=nullptr); + etk::Vector> loadPoints(const etk::String& _fileName, etk::String* _label=nullptr, etk::String* _type=nullptr); } diff --git a/dollar/tools.cpp b/dollar/tools.cpp index 1fa9754..6af8edb 100644 --- a/dollar/tools.cpp +++ b/dollar/tools.cpp @@ -32,8 +32,8 @@ vec2 dollar::getBaryCenter(const etk::Vector& _points) { etk::Vector dollar::rotateBy(const etk::Vector& _points, float _rotation) { etk::Vector out; vec2 center = getBaryCenter(_points); - float cosine = std::cos(_rotation); - float sine = std::sin(_rotation); + float cosine = etk::cos(_rotation); + float sine = etk::sin(_rotation); for (auto &it : _points) { float qx = (it.x() - center.x()) * cosine - (it.y() - center.y()) * sine + center.x(); float qy = (it.x() - center.x()) * sine + (it.y() - center.y()) * cosine + center.y(); @@ -44,7 +44,7 @@ etk::Vector dollar::rotateBy(const etk::Vector& _points, float _rota etk::Vector dollar::rotateToZero(const etk::Vector& _points) { vec2 center = getBaryCenter(_points); - float rotation = std::atan2(center.y() - _points[0].y(), center.x() - _points[0].x()); + float rotation = etk::atan2(center.y() - _points[0].y(), center.x() - _points[0].x()); return rotateBy(_points, -rotation); } diff --git a/lutin_dollar-test.py b/lutin_dollar-test.py index 14b223e..4854994 100644 --- a/lutin_dollar-test.py +++ b/lutin_dollar-test.py @@ -32,7 +32,7 @@ def configure(target, my_module): 'dollar', 'dollar-data', 'test-debug', - 'gtest', + 'etest', ]) my_module.copy_path('data/test/*.json', 'test') return True diff --git a/test/main.cpp b/test/main.cpp index bf0e11f..7c4e035 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -9,14 +9,14 @@ #include #include -#include +#include int main(int _argc, const char *_argv[]) { // init Google test : ::testing::InitGoogleTest(&_argc, const_cast(_argv)); // init etk log system and file interface: etk::init(_argc, _argv); - // Run all test with gtest + // Run all test with etest return RUN_ALL_TESTS(); } diff --git a/tool/generate-form/main.cpp b/tool/generate-form/main.cpp index 5ce825c..00c9533 100644 --- a/tool/generate-form/main.cpp +++ b/tool/generate-form/main.cpp @@ -119,7 +119,7 @@ int main(int _argc, const char *_argv[]) { return testCorpus(srcCorpus); } -void generateFile(const etk::String& _fileName, const etk::Vector& _list, const std::string& _refName) { +void generateFile(const etk::String& _fileName, const etk::Vector& _list, const etk::String& _refName) { TEST_PRINT(" " << _fileName); etk::String data("\n"); data += "\n"; diff --git a/tool/recorder/appl/widget/TextAreaRecognition.cpp b/tool/recorder/appl/widget/TextAreaRecognition.cpp index ae020b3..045638c 100644 --- a/tool/recorder/appl/widget/TextAreaRecognition.cpp +++ b/tool/recorder/appl/widget/TextAreaRecognition.cpp @@ -55,7 +55,7 @@ void appl::widget::TextAreaRecognition::setCompare(const etk::String& _compare) m_compare = _compare; } -void appl::widget::TextAreaRecognition::store(const etk::String& _userName, const etk::String& _value, const std::string& _type) { +void appl::widget::TextAreaRecognition::store(const etk::String& _userName, const etk::String& _value, const etk::String& _type) { if (m_dataList.size() == 0) { return; } diff --git a/tool/recorder/appl/widget/TextAreaRecognition.hpp b/tool/recorder/appl/widget/TextAreaRecognition.hpp index 2b40a80..6edf629 100644 --- a/tool/recorder/appl/widget/TextAreaRecognition.hpp +++ b/tool/recorder/appl/widget/TextAreaRecognition.hpp @@ -63,7 +63,7 @@ namespace appl { public: void clear(); void undo(); - void store(const etk::String& _userName, const etk::String& _value, const std::string& _type); + void store(const etk::String& _userName, const etk::String& _value, const etk::String& _type); void setCompare(const etk::String& _compare); public: void onDraw() override; diff --git a/tool/recorder/lutin_dollar-recorder.py b/tool/recorder/lutin_dollar-recorder.py index 8d99552..c63155b 100644 --- a/tool/recorder/lutin_dollar-recorder.py +++ b/tool/recorder/lutin_dollar-recorder.py @@ -43,7 +43,7 @@ def configure(target, my_module): ]) my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" ]) my_module.add_path(".") my_module.set_pkg("VERSION_CODE", 1)