diff --git a/esvg/Base.cpp b/esvg/Base.cpp index 678e03e..1416ee7 100644 --- a/esvg/Base.cpp +++ b/esvg/Base.cpp @@ -12,8 +12,8 @@ const float esvg::kappa90(0.5522847493f); esvg::PaintState::PaintState() : - fill(std::pair, std::string>(etk::color::black, "")), - stroke(std::pair, std::string>(etk::color::none, "")), + fill(etk::Pair, etk::String>(etk::color::black, "")), + stroke(etk::Pair, etk::String>(etk::color::none, "")), strokeWidth(1.0f), flagEvenOdd(false), lineCap(esvg::cap_butt), @@ -25,8 +25,8 @@ esvg::PaintState::PaintState() : } void esvg::PaintState::clear() { - fill = std::pair, std::string>(etk::color::black, ""); - stroke = std::pair, std::string>(etk::color::none, ""); + fill = etk::Pair, etk::String>(etk::color::black, ""); + stroke = etk::Pair, etk::String>(etk::color::none, ""); strokeWidth = 1.0; viewPort.first.setValue(0.0f,0.0f); viewPort.first.setValue(0.0f,0.0f); @@ -43,9 +43,9 @@ esvg::Base::Base(PaintState _parentPaintState) { m_paint = _parentPaintState; } -std::string extractTransformData(const std::string& _value, const std::string& _base) { +etk::String extractTransformData(const etk::String& _value, const etk::String& _base) { size_t posStart = _value.find(_base); - if (posStart == std::string::npos) { + if (posStart == etk::String::npos) { // Not find element is a normal case ... return ""; } @@ -69,31 +69,31 @@ std::string extractTransformData(const std::string& _value, const std::string& _ return ""; } size_t posEnd = _value.find(')', posStart); - if (posEnd == std::string::npos) { + if (posEnd == etk::String::npos) { ESVG_ERROR("Missing element ')' in '" << _value << "' for " << _base); return ""; } - ESVG_VERBOSE("Find : '" << std::string(_value.begin()+posStart, _value.begin()+posEnd) << "' for " << _base); - return std::string(_value.begin()+posStart, _value.begin()+posEnd); + ESVG_VERBOSE("Find : '" << etk::String(_value.begin()+posStart, _value.begin()+posEnd) << "' for " << _base); + return etk::String(_value.begin()+posStart, _value.begin()+posEnd); } void esvg::Base::parseTransform(const exml::Element& _element) { if (_element.exist() == false) { return; } - std::string inputString = _element.attributes["transform"]; + etk::String inputString = _element.attributes["transform"]; if (inputString.size() == 0) { return; } ESVG_VERBOSE("find transform : \"" << inputString << "\""); - for (int32_t iii=0; iii esvg::Base::parseLength2(const std::string& _dataInput) { +etk::Pair esvg::Base::parseLength2(const etk::String& _dataInput) { ESVG_VERBOSE(" lenght : '" << _dataInput << "'"); - float n = stof(_dataInput); - std::string unit; + float n = _dataInput.to(); + etk::String unit; for (int32_t iii=0; iii<_dataInput.size(); ++iii) { if( (_dataInput[iii]>='0' && _dataInput[iii]<='9') || _dataInput[iii]=='+' @@ -207,46 +207,46 @@ std::pair esvg::Base::parseLength2(const std::string || _dataInput[iii]=='.') { continue; } - unit = std::string(_dataInput, iii); + unit = etk::String(_dataInput, iii); break; } ESVG_VERBOSE(" lenght : '" << n << "' => unit=" << unit); // note : ";" is for the parsing of the style elements ... if(unit.size() == 0) { - return std::make_pair(n, esvg::distance_pixel); + return etk::makePair(n, esvg::distance_pixel); } else if (unit[0] == '%') { // xxx % - return std::make_pair(n, esvg::distance_pourcent); + return etk::makePair(n, esvg::distance_pourcent); } else if ( unit[0] == 'e' && unit[1] == 'm') { // xxx em - return std::make_pair(n, esvg::distance_element); + return etk::makePair(n, esvg::distance_element); } else if ( unit[0] == 'e' && unit[1] == 'x') { // xxx ex - return std::make_pair(n, esvg::distance_ex); + return etk::makePair(n, esvg::distance_ex); } else if ( unit[0] == 'p' && unit[1] == 'x') { // xxx px - return std::make_pair(n, esvg::distance_pixel); + return etk::makePair(n, esvg::distance_pixel); } else if ( unit[0] == 'p' && unit[1] == 't') { // xxx pt - return std::make_pair(n, esvg::distance_point); + return etk::makePair(n, esvg::distance_point); } else if ( unit[0] == 'p' && unit[1] == 'c') { // xxx pc - return std::make_pair(n, esvg::distance_pc); + return etk::makePair(n, esvg::distance_pc); } else if ( unit[0] == 'm' && unit[1] == 'm') { // xxx mm - return std::make_pair(n, esvg::distance_millimeter); + return etk::makePair(n, esvg::distance_millimeter); } else if ( unit[0] == 'c' && unit[1] == 'm') { // xxx cm - return std::make_pair(n, esvg::distance_centimeter); + return etk::makePair(n, esvg::distance_centimeter); } else if ( unit[0] == 'i' && unit[1] == 'n') { // xxx in - return std::make_pair(n, esvg::distance_inch); + return etk::makePair(n, esvg::distance_inch); } - return std::make_pair(0.0f, esvg::distance_pixel); + return etk::makePair(0.0f, esvg::distance_pixel); } -float esvg::Base::parseLength(const std::string& _dataInput) { - std::pair value = parseLength2(_dataInput); +float esvg::Base::parseLength(const etk::String& _dataInput) { + etk::Pair value = parseLength2(_dataInput); ESVG_VERBOSE(" lenght : '" << value.first << "' => unit=" << value.second); float font_size = 20.0f; switch (value.second) { @@ -280,13 +280,13 @@ void esvg::Base::parsePaintAttr(const exml::Element& _element) { bool fillNone = false; bool strokeNone = false; */ - std::string content; + etk::String content; // ---------------- get unique ID ---------------- m_id = _element.attributes["id"]; // ---------------- stroke ---------------- content = _element.attributes["stroke"]; if (content == "none") { - m_paint.stroke = std::pair, std::string>(etk::color::none, ""); + m_paint.stroke = etk::Pair, etk::String>(etk::color::none, ""); } else { if (content.size()!=0) { m_paint.stroke = parseColor(content); @@ -298,7 +298,7 @@ void esvg::Base::parsePaintAttr(const exml::Element& _element) { content = _element.attributes["stroke-opacity"]; if (content.size()!=0) { float opacity = parseLength(content); - opacity = std::avg(0.0f, opacity, 1.0f); + opacity = etk::avg(0.0f, opacity, 1.0f); m_paint.stroke.first.setA(opacity); } @@ -339,13 +339,13 @@ void esvg::Base::parsePaintAttr(const exml::Element& _element) { content = _element.attributes["stroke-miterlimit"]; if (content.size()!=0) { float tmp = parseLength(content); - m_paint.miterLimit = std::max(0.0f, tmp); + m_paint.miterLimit = etk::max(0.0f, tmp); } } // ---------------- FILL ---------------- content = _element.attributes["fill"]; if (content == "none") { - m_paint.fill = std::pair, std::string>(etk::color::none, ""); + m_paint.fill = etk::Pair, etk::String>(etk::color::none, ""); } else { if (content.size()!=0) { m_paint.fill = parseColor(content); @@ -353,7 +353,7 @@ void esvg::Base::parsePaintAttr(const exml::Element& _element) { content = _element.attributes["fill-opacity"]; if (content.size()!=0) { float opacity = parseLength(content); - opacity = std::avg(0.0f, opacity, 1.0f); + opacity = etk::avg(0.0f, opacity, 1.0f); m_paint.fill.first.setA(opacity); } content = _element.attributes["fill-rule"]; @@ -370,13 +370,13 @@ void esvg::Base::parsePaintAttr(const exml::Element& _element) { content = _element.attributes["opacity"]; if (content.size()!=0) { m_paint.opacity = parseLength(content); - m_paint.opacity = std::avg(0.0f, m_paint.opacity, 1.0f); + m_paint.opacity = etk::avg(0.0f, m_paint.opacity, 1.0f); } } } -std::pair, std::string> esvg::Base::parseColor(const std::string& _inputData) { - std::pair, std::string> localColor(etk::color::white, ""); +etk::Pair, etk::String> esvg::Base::parseColor(const etk::String& _inputData) { + etk::Pair, etk::String> localColor(etk::color::white, ""); if( _inputData.size() > 4 && _inputData[0] == 'u' @@ -384,13 +384,13 @@ std::pair, std::string> esvg::Base::parseColor(const std::st && _inputData[2] == 'l' && _inputData[3] == '(') { if (_inputData[4] == '#') { - std::string color(_inputData.begin() + 5, _inputData.end()-1); - localColor = std::pair, std::string>(etk::color::none, color); + etk::String color(_inputData.begin() + 5, _inputData.end()-1); + localColor = etk::Pair, etk::String>(etk::color::none, color); } else { ESVG_ERROR("Problem in parsing the color : \"" << _inputData << "\" == > url(XXX) is not supported now ..."); } } else { - localColor = std::pair, std::string>(_inputData, ""); + localColor = etk::Pair, etk::String>(_inputData, ""); } ESVG_VERBOSE("Parse color : \"" << _inputData << "\" == > " << localColor.first << " " << localColor.second); return localColor; @@ -419,17 +419,17 @@ void esvg::Base::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t -const std::string& esvg::Base::getId() const { +const etk::String& esvg::Base::getId() const { return m_id; } -void esvg::Base::setId(const std::string& _newId) { +void esvg::Base::setId(const etk::String& _newId) { // TODO : Check if it is UNIQUE ... m_id = _newId; } -void esvg::Base::drawShapePoints(std::vector>& _out, +void esvg::Base::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/Base.hpp b/esvg/Base.hpp index e69ccfa..986c12b 100644 --- a/esvg/Base.hpp +++ b/esvg/Base.hpp @@ -11,7 +11,7 @@ #pragma once #include -#include +#include #include #include #include @@ -38,14 +38,14 @@ namespace esvg { PaintState(); void clear(); public: - std::pair, std::string> fill; - std::pair, std::string> stroke; + etk::Pair, etk::String> fill; + etk::Pair, etk::String> stroke; float strokeWidth; bool flagEvenOdd; //!< Fill rules enum esvg::cap lineCap; enum esvg::join lineJoin; float miterLimit; - std::pair viewPort; //!< min pos, max pos + etk::Pair viewPort; //!< min pos, max pos float opacity; }; @@ -79,7 +79,7 @@ namespace esvg { * @param[in] _basicTrans Parant transformation of the environement * @param[in] _level Level of the tree */ - virtual void drawShapePoints(std::vector>& _out, + virtual void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, @@ -99,8 +99,8 @@ namespace esvg { * @param[in] _dataInput Data C String with the printed lenght * @return standard number of pixels */ - float parseLength(const std::string& _dataInput); - std::pair parseLength2(const std::string& _dataInput); + float parseLength(const etk::String& _dataInput); + etk::Pair parseLength2(const etk::String& _dataInput); /** * @brief parse a Painting attribute of a specific node * @param[in] _element Basic node of the XML that might be parsed @@ -111,19 +111,19 @@ namespace esvg { * @param[in] _inputData Data C String with the xml definition * @return The parsed color (color used and the link if needed) */ - std::pair, std::string> parseColor(const std::string& _inputData); + etk::Pair, etk::String> parseColor(const etk::String& _inputData); protected: - std::string m_id; //!< unique ID of the element. + etk::String m_id; //!< unique ID of the element. public: /** * @brief Get the ID of the Element * @return UniqueId in the svg file */ - const std::string& getId() const; + const etk::String& getId() const; /** * @brief Set the ID of the Element * @param[in] _newId New Id of the element */ - void setId(const std::string& _newId); + void setId(const etk::String& _newId); }; }; diff --git a/esvg/Circle.cpp b/esvg/Circle.cpp index bd4cec8..15c05d0 100644 --- a/esvg/Circle.cpp +++ b/esvg/Circle.cpp @@ -29,7 +29,7 @@ bool esvg::Circle::parseXML(const exml::Element& _element, mat2x3& _parentTrans, // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string content = _element.attributes["cx"]; + etk::String content = _element.attributes["cx"]; if (content.size()!=0) { m_position.setX(parseLength(content)); } @@ -143,7 +143,7 @@ void esvg::Circle::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_ #endif } -void esvg::Circle::drawShapePoints(std::vector>& _out, +void esvg::Circle::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, @@ -156,11 +156,11 @@ void esvg::Circle::drawShapePoints(std::vector>& _out, listPoints = listElement.generateListPoints(_level, _recurtionMax, _threshold); listPoints.applyMatrix(mtx); for (auto &it : listPoints.m_data) { - std::vector listPoint; + etk::Vector listPoint; for (auto &itDot : it) { - listPoint.push_back(itDot.m_pos); + listPoint.pushBack(itDot.m_pos); } - _out.push_back(listPoint); + _out.pushBack(listPoint); } } diff --git a/esvg/Circle.hpp b/esvg/Circle.hpp index b586b45..ad01971 100644 --- a/esvg/Circle.hpp +++ b/esvg/Circle.hpp @@ -18,7 +18,7 @@ namespace esvg { bool parseXML(const exml::Element& _element, mat2x3& _parentTrans, vec2& _sizeMax) override; void display(int32_t _spacing) override; void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level) override; - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/Dimension.cpp b/esvg/Dimension.cpp index 7601457..8a3e383 100644 --- a/esvg/Dimension.cpp +++ b/esvg/Dimension.cpp @@ -33,7 +33,7 @@ esvg::Dimension::Dimension(const vec2& _size, enum esvg::distance _type) : set(_size, _type); } -void esvg::Dimension::set(std::string _config) { +void esvg::Dimension::set(etk::String _config) { m_data.setValue(0,0); m_type = esvg::distance_pixel; enum distance type = esvg::distance_pixel; @@ -71,7 +71,7 @@ void esvg::Dimension::set(std::string _config) { ESVG_VERBOSE(" config dimention : \"" << _config << "\" == > " << *this ); } -static enum esvg::distance parseType(std::string& _config) { +static enum esvg::distance parseType(etk::String& _config) { enum esvg::distance type = esvg::distance_pixel; if (etk::end_with(_config, "%", false) == true) { type = esvg::distance_pourcent; @@ -105,7 +105,7 @@ static enum esvg::distance parseType(std::string& _config) { } -void esvg::Dimension::set(std::string _configX, std::string _configY) { +void esvg::Dimension::set(etk::String _configX, etk::String _configY) { m_data.setValue(0,0); m_type = esvg::distance_pixel; enum distance type = esvg::distance_pixel; @@ -125,8 +125,8 @@ esvg::Dimension::~Dimension() { // nothing to do ... } -esvg::Dimension::operator std::string() const { - std::string str; +esvg::Dimension::operator etk::String() const { + etk::String str; str = getValue(); switch(getType()) { case esvg::distance_pourcent: @@ -214,7 +214,7 @@ vec2 esvg::Dimension::getPixel(const vec2& _upperSize) const { return vec2(128.0f, 128.0f); } -std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::distance _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, enum esvg::distance _obj) { switch(_obj) { case esvg::distance_pourcent: _os << "%"; @@ -256,24 +256,24 @@ std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::distance _obj) { return _os; } -std::ostream& esvg::operator <<(std::ostream& _os, const esvg::Dimension& _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, const esvg::Dimension& _obj) { _os << _obj.getValue() << _obj.getType(); return _os; } namespace etk { - template<> std::string to_string(const esvg::Dimension& _obj) { + template<> etk::String toString(const esvg::Dimension& _obj) { return _obj; } - template<> std::u32string to_u32string(const esvg::Dimension& _obj) { - return etk::to_u32string(etk::to_string(_obj)); + template<> etk::UString toUString(const esvg::Dimension& _obj) { + return etk::toUString(etk::toString(_obj)); } - template<> bool from_string(esvg::Dimension& _variableRet, const std::string& _value) { + template<> bool from_string(esvg::Dimension& _variableRet, const etk::String& _value) { _variableRet = esvg::Dimension(_value); return true; } - template<> bool from_string(esvg::Dimension& _variableRet, const std::u32string& _value) { - return from_string(_variableRet, etk::to_string(_value)); + template<> bool from_string(esvg::Dimension& _variableRet, const etk::UString& _value) { + return from_string(_variableRet, etk::toString(_value)); } }; @@ -289,7 +289,7 @@ esvg::Dimension1D::Dimension1D(float _size, enum esvg::distance _type) : set(_size, _type); } -void esvg::Dimension1D::set(std::string _config) { +void esvg::Dimension1D::set(etk::String _config) { m_data = 0; m_type = esvg::distance_pixel; enum distance type = esvg::distance_pixel; @@ -330,8 +330,8 @@ esvg::Dimension1D::~Dimension1D() { // nothing to do ... } -esvg::Dimension1D::operator std::string() const { - std::string str; +esvg::Dimension1D::operator etk::String() const { + etk::String str; str = getValue(); switch(getType()) { case esvg::distance_pourcent: @@ -419,24 +419,24 @@ float esvg::Dimension1D::getPixel(float _upperSize) const { return 128.0f; } -std::ostream& esvg::operator <<(std::ostream& _os, const esvg::Dimension1D& _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, const esvg::Dimension1D& _obj) { _os << _obj.getValue() << _obj.getType(); return _os; } namespace etk { - template<> std::string to_string(const esvg::Dimension1D& _obj) { + template<> etk::String toString(const esvg::Dimension1D& _obj) { return _obj; } - template<> std::u32string to_u32string(const esvg::Dimension1D& _obj) { - return etk::to_u32string(etk::to_string(_obj)); + template<> etk::UString toUString(const esvg::Dimension1D& _obj) { + return etk::toUString(etk::toString(_obj)); } - template<> bool from_string(esvg::Dimension1D& _variableRet, const std::string& _value) { + template<> bool from_string(esvg::Dimension1D& _variableRet, const etk::String& _value) { _variableRet = esvg::Dimension1D(_value); return true; } - template<> bool from_string(esvg::Dimension1D& _variableRet, const std::u32string& _value) { - return from_string(_variableRet, etk::to_string(_value)); + template<> bool from_string(esvg::Dimension1D& _variableRet, const etk::UString& _value) { + return from_string(_variableRet, etk::toString(_value)); } }; diff --git a/esvg/Dimension.hpp b/esvg/Dimension.hpp index a9873cd..73a7eec 100644 --- a/esvg/Dimension.hpp +++ b/esvg/Dimension.hpp @@ -46,7 +46,7 @@ namespace esvg { * @brief Constructor * @param[in] _config dimension configuration. */ - Dimension(const std::string& _config) : + Dimension(const etk::String& _config) : m_data(0,0), m_type(esvg::distance_pixel) { set(_config); @@ -56,7 +56,7 @@ namespace esvg { * @param[in] _configX dimension X configuration. * @param[in] _configY dimension Y configuration. */ - Dimension(const std::string& _configX, const std::string& _configY) : + Dimension(const etk::String& _configX, const etk::String& _configY) : m_data(0,0), m_type(esvg::distance_pixel) { set(_configX, _configY); @@ -69,7 +69,7 @@ namespace esvg { /** * @brief string cast : */ - operator std::string() const; + operator etk::String() const; /** * @brief get the current dimention. @@ -97,13 +97,13 @@ namespace esvg { * @brief set the current dimention in requested type * @param[in] _config dimension configuration. */ - void set(std::string _config); + void set(etk::String _config); /** * @brief set the current dimention in requested type * @param[in] _configX dimension X configuration. * @param[in] _configY dimension Y configuration. */ - void set(std::string _configX, std::string _configY); + void set(etk::String _configX, etk::String _configY); public: /** * @brief get the current dimention in pixel @@ -142,8 +142,8 @@ namespace esvg { return false; } }; - std::ostream& operator <<(std::ostream& _os, enum esvg::distance _obj); - std::ostream& operator <<(std::ostream& _os, const esvg::Dimension& _obj); + etk::Stream& operator <<(etk::Stream& _os, enum esvg::distance _obj); + etk::Stream& operator <<(etk::Stream& _os, const esvg::Dimension& _obj); /** * @brief in the dimention class we store the data as the more usefull unit (pixel) * but one case need to be dynamic the %, then when requested in % the register the % value @@ -167,7 +167,7 @@ namespace esvg { * @brief Constructor * @param[in] _config dimension configuration. */ - Dimension1D(const std::string& _config) : + Dimension1D(const etk::String& _config) : m_data(0.0f), m_type(esvg::distance_pixel) { set(_config); @@ -180,7 +180,7 @@ namespace esvg { /** * @brief string cast : */ - operator std::string() const; + operator etk::String() const; /** * @brief get the current dimention. @@ -208,7 +208,7 @@ namespace esvg { * @brief set the current dimention in requested type * @param[in] _config dimension configuration. */ - void set(std::string _config); + void set(etk::String _config); public: /** * @brief get the current dimention in pixel @@ -247,6 +247,6 @@ namespace esvg { return false; } }; - std::ostream& operator <<(std::ostream& _os, const esvg::Dimension1D& _obj); + etk::Stream& operator <<(etk::Stream& _os, const esvg::Dimension1D& _obj); } diff --git a/esvg/Ellipse.cpp b/esvg/Ellipse.cpp index a6a64c5..04f5814 100644 --- a/esvg/Ellipse.cpp +++ b/esvg/Ellipse.cpp @@ -30,7 +30,7 @@ bool esvg::Ellipse::parseXML(const exml::Element& _element, mat2x3& _parentTrans m_c.setValue(0,0); m_r.setValue(0,0); - std::string content = _element.attributes["cx"]; + etk::String content = _element.attributes["cx"]; if (content.size()!=0) { m_c.setX(parseLength(content)); } @@ -149,7 +149,7 @@ void esvg::Ellipse::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32 } -void esvg::Ellipse::drawShapePoints(std::vector>& _out, +void esvg::Ellipse::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, @@ -162,11 +162,11 @@ void esvg::Ellipse::drawShapePoints(std::vector>& _out, listPoints = listElement.generateListPoints(_level, _recurtionMax, _threshold); listPoints.applyMatrix(mtx); for (auto &it : listPoints.m_data) { - std::vector listPoint; + etk::Vector listPoint; for (auto &itDot : it) { - listPoint.push_back(itDot.m_pos); + listPoint.pushBack(itDot.m_pos); } - _out.push_back(listPoint); + _out.pushBack(listPoint); } } diff --git a/esvg/Ellipse.hpp b/esvg/Ellipse.hpp index 14550be..02ac432 100644 --- a/esvg/Ellipse.hpp +++ b/esvg/Ellipse.hpp @@ -18,7 +18,7 @@ namespace esvg { bool parseXML(const exml::Element& _element, mat2x3& _parentTrans, vec2& _sizeMax) override; void display(int32_t _spacing) override; void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level) override; - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/Group.cpp b/esvg/Group.cpp index 4c903b4..8172714 100644 --- a/esvg/Group.cpp +++ b/esvg/Group.cpp @@ -85,10 +85,10 @@ bool esvg::Group::parseXML(const exml::Element& _element, mat2x3& _parentTrans, elementParser.reset(); continue; } - _sizeMax.setValue(std::max(_sizeMax.x(), tmpPos.x()), - std::max(_sizeMax.y(), tmpPos.y())); + _sizeMax.setValue(etk::max(_sizeMax.x(), tmpPos.x()), + etk::max(_sizeMax.y(), tmpPos.y())); // add element in the system - m_subElementList.push_back(elementParser); + m_subElementList.pushBack(elementParser); } return true; } @@ -114,7 +114,7 @@ void esvg::Group::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t } } -void esvg::Group::drawShapePoints(std::vector>& _out, +void esvg::Group::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/Group.hpp b/esvg/Group.hpp index 1be6fe1..9f8bedb 100644 --- a/esvg/Group.hpp +++ b/esvg/Group.hpp @@ -6,19 +6,19 @@ #pragma once #include -#include +#include namespace esvg { class Group : public esvg::Base { private: - std::vector> m_subElementList; //!< sub elements ... + etk::Vector> m_subElementList; //!< sub elements ... public: Group(PaintState _parentPaintState); ~Group(); bool parseXML(const exml::Element& _element, mat2x3& _parentTrans, vec2& _sizeMax) override; void display(int32_t spacing) override; void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level) override; - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/Line.cpp b/esvg/Line.cpp index 7de0c89..a31cef8 100644 --- a/esvg/Line.cpp +++ b/esvg/Line.cpp @@ -30,7 +30,7 @@ bool esvg::Line::parseXML(const exml::Element& _element, mat2x3& _parentTrans, v // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string content = _element.attributes["x1"]; + etk::String content = _element.attributes["x1"]; if (content.size() != 0) { m_startPos.setX(parseLength(content)); } @@ -46,8 +46,8 @@ bool esvg::Line::parseXML(const exml::Element& _element, mat2x3& _parentTrans, v if (content.size() != 0) { m_stopPos.setY(parseLength(content)); } - _sizeMax.setValue(std::max(m_startPos.x(), m_stopPos.x()), - std::max(m_startPos.y(), m_stopPos.y())); + _sizeMax.setValue(etk::max(m_startPos.x(), m_stopPos.x()), + etk::max(m_startPos.y(), m_stopPos.y())); return true; } @@ -116,7 +116,7 @@ void esvg::Line::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t } -void esvg::Line::drawShapePoints(std::vector>& _out, +void esvg::Line::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, @@ -129,11 +129,11 @@ void esvg::Line::drawShapePoints(std::vector>& _out, listPoints = listElement.generateListPoints(_level, _recurtionMax, _threshold); listPoints.applyMatrix(mtx); for (auto &it : listPoints.m_data) { - std::vector listPoint; + etk::Vector listPoint; for (auto &itDot : it) { - listPoint.push_back(itDot.m_pos); + listPoint.pushBack(itDot.m_pos); } - _out.push_back(listPoint); + _out.pushBack(listPoint); } } diff --git a/esvg/Line.hpp b/esvg/Line.hpp index 997b5f2..bff9baa 100644 --- a/esvg/Line.hpp +++ b/esvg/Line.hpp @@ -18,7 +18,7 @@ namespace esvg { bool parseXML(const exml::Element& _element, mat2x3& _parentTrans, vec2& _sizeMax) override; void display(int32_t _spacing) override; void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level) override; - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/LinearGradient.cpp b/esvg/LinearGradient.cpp index b3a9987..c96e871 100644 --- a/esvg/LinearGradient.cpp +++ b/esvg/LinearGradient.cpp @@ -41,8 +41,8 @@ bool esvg::LinearGradient::parseXML(const exml::Element& _element, mat2x3& _pare // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string contentX = _element.attributes["x1"]; - std::string contentY = _element.attributes["y1"]; + etk::String contentX = _element.attributes["x1"]; + etk::String contentY = _element.attributes["y1"]; if ( contentX != "" && contentY != "") { m_pos1.set(contentX, contentY); @@ -78,7 +78,7 @@ bool esvg::LinearGradient::parseXML(const exml::Element& _element, mat2x3& _pare // note: xlink:href is incompatible with subNode "stop" m_href = _element.attributes["xlink:href"]; if (m_href.size() != 0) { - m_href = std::string(m_href.begin()+1, m_href.end()); + m_href = etk::String(m_href.begin()+1, m_href.end()); } // parse all sub node : for(const auto it : _element.nodes) { @@ -90,9 +90,9 @@ bool esvg::LinearGradient::parseXML(const exml::Element& _element, mat2x3& _pare if (child.getValue() == "stop") { float offset = 100; etk::Color stopColor = etk::color::none; - std::string content = child.attributes["offset"]; + etk::String content = child.attributes["offset"]; if (content.size()!=0) { - std::pair tmp = parseLength2(content); + etk::Pair tmp = parseLength2(content); if (tmp.second == esvg::distance_pixel) { // special case ==> all time % then no type define ==> % in [0.0 .. 1.0] offset = tmp.first*100.0f; @@ -110,11 +110,11 @@ bool esvg::LinearGradient::parseXML(const exml::Element& _element, mat2x3& _pare content = child.attributes["stop-opacity"]; if (content.size()!=0) { float opacity = parseLength(content); - opacity = std::avg(0.0f, opacity, 1.0f); + opacity = etk::avg(0.0f, opacity, 1.0f); stopColor.setA(opacity); ESVG_VERBOSE(" opacity : '" << content << "' == > " << stopColor); } - m_data.push_back(std::pair>(offset, stopColor)); + m_data.pushBack(etk::Pair>(offset, stopColor)); } else { ESVG_ERROR("(l " << child.getPos() << ") node not suported : '" << child.getValue() << "' must be [stop]"); } @@ -147,7 +147,7 @@ const esvg::Dimension& esvg::LinearGradient::getPosition2() { return m_pos2; } -const std::vector>>& esvg::LinearGradient::getColors(esvg::Document* _document) { +const etk::Vector>>& esvg::LinearGradient::getColors(esvg::Document* _document) { if (m_href == "") { return m_data; } diff --git a/esvg/LinearGradient.hpp b/esvg/LinearGradient.hpp index f9347fb..84d4630 100644 --- a/esvg/LinearGradient.hpp +++ b/esvg/LinearGradient.hpp @@ -19,8 +19,8 @@ namespace esvg { enum gradientUnits m_unit; enum spreadMethod m_spread; private: - std::string m_href; //!< in case of using a single gradient in multiple gradient, the gradient is store in an other element... - std::vector>> m_data; //!< incompatible with href + etk::String m_href; //!< in case of using a single gradient in multiple gradient, the gradient is store in an other element... + etk::Vector>> m_data; //!< incompatible with href public: LinearGradient(PaintState _parentPaintState); ~LinearGradient(); @@ -30,7 +30,7 @@ namespace esvg { public: const esvg::Dimension& getPosition1(); const esvg::Dimension& getPosition2(); - const std::vector>>& getColors(esvg::Document* _document); + const etk::Vector>>& getColors(esvg::Document* _document); }; } diff --git a/esvg/Path.cpp b/esvg/Path.cpp index ec09b5e..5370b3c 100644 --- a/esvg/Path.cpp +++ b/esvg/Path.cpp @@ -19,7 +19,7 @@ esvg::Path::~Path() { // return the next char position ... (after 'X' or NULL) -const char * extractCmd(const char* _input, char& _cmd, std::vector& _outputList) { +const char * extractCmd(const char* _input, char& _cmd, etk::Vector& _outputList) { if (*_input == '\0') { return nullptr; } @@ -46,7 +46,7 @@ const char * extractCmd(const char* _input, char& _cmd, std::vector& _out while( sscanf(&_input[iii], "%1[, ]%f%n", spacer, &element, &nbElementRead) == 2 || sscanf(&_input[iii], "%f%n", &element, &nbElementRead) == 1) { ESVG_VERBOSE("Find element : " << element); - _outputList.push_back(element); + _outputList.pushBack(element); iii += nbElementRead; } outputPointer = &_input[iii]; @@ -56,8 +56,8 @@ const char * extractCmd(const char* _input, char& _cmd, std::vector& _out //outputPointer++; return outputPointer; } -std::string cleanBadSpaces(const std::string& _input) { - std::string out; +etk::String cleanBadSpaces(const etk::String& _input) { + etk::String out; bool haveSpace = false; for (auto &it : _input) { if ( it == ' ' @@ -87,7 +87,7 @@ bool esvg::Path::parseXML(const exml::Element& _element, mat2x3& _parentTrans, v m_transformMatrix *= _parentTrans; - std::string elementXML1 = _element.attributes["d"]; + etk::String elementXML1 = _element.attributes["d"]; if (elementXML1.size() == 0) { ESVG_WARNING("(l "<<_element.getPos()<<") path: missing 'd' attribute or empty"); return false; @@ -95,7 +95,7 @@ bool esvg::Path::parseXML(const exml::Element& _element, mat2x3& _parentTrans, v ESVG_VERBOSE("Parse Path : \"" << elementXML1 << "\""); char command; - std::vector listDot; + etk::Vector listDot; elementXML1 = cleanBadSpaces(elementXML1); const char* elementXML = elementXML1.c_str(); @@ -325,7 +325,7 @@ void esvg::Path::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t } -void esvg::Path::drawShapePoints(std::vector>& _out, +void esvg::Path::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, @@ -339,11 +339,11 @@ void esvg::Path::drawShapePoints(std::vector>& _out, listPoints = m_listElement.generateListPoints(_level, _recurtionMax, _threshold); listPoints.applyMatrix(mtx); for (auto &it : listPoints.m_data) { - std::vector listPoint; + etk::Vector listPoint; for (auto &itDot : it) { - listPoint.push_back(itDot.m_pos); + listPoint.pushBack(itDot.m_pos); } - _out.push_back(listPoint); + _out.pushBack(listPoint); } } diff --git a/esvg/Path.hpp b/esvg/Path.hpp index e725c2f..2427089 100644 --- a/esvg/Path.hpp +++ b/esvg/Path.hpp @@ -18,7 +18,7 @@ namespace esvg { bool parseXML(const exml::Element& _element, mat2x3& _parentTrans, vec2& _sizeMax) override; void display(int32_t _spacing) override; void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level) override; - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/Polygon.cpp b/esvg/Polygon.cpp index 0e271b3..8f2f4ce 100644 --- a/esvg/Polygon.cpp +++ b/esvg/Polygon.cpp @@ -31,7 +31,7 @@ bool esvg::Polygon::parseXML(const exml::Element& _element, mat2x3& _parentTrans ESVG_VERBOSE("parsed P2. trans: " << m_transformMatrix); - const std::string sss1 = _element.attributes["points"]; + const etk::String sss1 = _element.attributes["points"]; if (sss1.size() == 0) { ESVG_ERROR("(l "/*<<_element->Pos()*/<<") polygon: missing points attribute"); return false; @@ -43,10 +43,10 @@ bool esvg::Polygon::parseXML(const exml::Element& _element, mat2x3& _parentTrans vec2 pos(0,0); int32_t n; if (sscanf(sss, "%f,%f%n", &pos.m_floats[0], &pos.m_floats[1], &n) == 2) { - m_listPoint.push_back(pos); + m_listPoint.pushBack(pos); sss += n; - _sizeMax.setValue(std::max(_sizeMax.x(), pos.x()), - std::max(_sizeMax.y(), pos.y())); + _sizeMax.setValue(etk::max(_sizeMax.x(), pos.x()), + etk::max(_sizeMax.y(), pos.y())); if(sss[0] == ' ' || sss[0] == ',') { sss++; } @@ -130,7 +130,7 @@ void esvg::Polygon::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32 } -void esvg::Polygon::drawShapePoints(std::vector>& _out, +void esvg::Polygon::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, @@ -143,11 +143,11 @@ void esvg::Polygon::drawShapePoints(std::vector>& _out, listPoints = listElement.generateListPoints(_level, _recurtionMax, _threshold); listPoints.applyMatrix(mtx); for (auto &it : listPoints.m_data) { - std::vector listPoint; + etk::Vector listPoint; for (auto &itDot : it) { - listPoint.push_back(itDot.m_pos); + listPoint.pushBack(itDot.m_pos); } - _out.push_back(listPoint); + _out.pushBack(listPoint); } } diff --git a/esvg/Polygon.hpp b/esvg/Polygon.hpp index ef215e1..e6223a6 100644 --- a/esvg/Polygon.hpp +++ b/esvg/Polygon.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include namespace esvg { /* @@ -17,7 +17,7 @@ namespace esvg { */ class Polygon : public esvg::Base { private: - std::vector m_listPoint; //!< list of all point of the polygone + etk::Vector m_listPoint; //!< list of all point of the polygone //enum esvg::polygonMode m_diplayMode; //!< polygone specific display mode public: Polygon(PaintState parentPaintState); @@ -25,7 +25,7 @@ namespace esvg { bool parseXML(const exml::Element& _element, mat2x3& _parentTrans, vec2& _sizeMax) override; void display(int32_t _spacing) override; void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level) override; - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/Polyline.cpp b/esvg/Polyline.cpp index 50b93f8..5d5ba93 100644 --- a/esvg/Polyline.cpp +++ b/esvg/Polyline.cpp @@ -29,7 +29,7 @@ bool esvg::Polyline::parseXML(const exml::Element& _element, mat2x3& _parentTran // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string sss1 = _element.attributes["points"]; + etk::String sss1 = _element.attributes["points"]; if (sss1.size() == 0) { ESVG_ERROR("(l "<<_element.getPos()<<") polyline: missing points attribute"); return false; @@ -41,9 +41,9 @@ bool esvg::Polyline::parseXML(const exml::Element& _element, mat2x3& _parentTran vec2 pos; int32_t n; if (sscanf(sss, "%f,%f %n", &pos.m_floats[0], &pos.m_floats[1], &n) == 2) { - m_listPoint.push_back(pos); - _sizeMax.setValue(std::max(_sizeMax.x(), pos.x()), - std::max(_sizeMax.y(), pos.y())); + m_listPoint.pushBack(pos); + _sizeMax.setValue(etk::max(_sizeMax.x(), pos.x()), + etk::max(_sizeMax.y(), pos.y())); sss += n; } else { break; @@ -127,7 +127,7 @@ void esvg::Polyline::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int3 } -void esvg::Polyline::drawShapePoints(std::vector>& _out, +void esvg::Polyline::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, @@ -140,10 +140,10 @@ void esvg::Polyline::drawShapePoints(std::vector>& _out, listPoints = listElement.generateListPoints(_level, _recurtionMax, _threshold); listPoints.applyMatrix(mtx); for (auto &it : listPoints.m_data) { - std::vector listPoint; + etk::Vector listPoint; for (auto &itDot : it) { - listPoint.push_back(itDot.m_pos); + listPoint.pushBack(itDot.m_pos); } - _out.push_back(listPoint); + _out.pushBack(listPoint); } } diff --git a/esvg/Polyline.hpp b/esvg/Polyline.hpp index 956d148..844202f 100644 --- a/esvg/Polyline.hpp +++ b/esvg/Polyline.hpp @@ -6,19 +6,19 @@ #pragma once #include -#include +#include namespace esvg { class Polyline : public esvg::Base { private: - std::vector m_listPoint; //!< list of all point of the polyline + etk::Vector m_listPoint; //!< list of all point of the polyline public: Polyline(PaintState _parentPaintState); ~Polyline(); bool parseXML(const exml::Element& _element, mat2x3& _parentTrans, vec2& _sizeMax) override; void display(int32_t _spacing) override; void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level) override; - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/RadialGradient.cpp b/esvg/RadialGradient.cpp index 49e5fa9..15f7d31 100644 --- a/esvg/RadialGradient.cpp +++ b/esvg/RadialGradient.cpp @@ -42,8 +42,8 @@ bool esvg::RadialGradient::parseXML(const exml::Element& _element, mat2x3& _pare // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string contentX = _element.attributes["cx"]; - std::string contentY = _element.attributes["cy"]; + etk::String contentX = _element.attributes["cx"]; + etk::String contentY = _element.attributes["cy"]; if ( contentX != "" && contentY != "") { m_center.set(contentX, contentY); @@ -83,7 +83,7 @@ bool esvg::RadialGradient::parseXML(const exml::Element& _element, mat2x3& _pare // note: xlink:href is incompatible with subNode "stop" m_href = _element.attributes["xlink:href"]; if (m_href.size() != 0) { - m_href = std::string(m_href.begin()+1, m_href.end()); + m_href = etk::String(m_href.begin()+1, m_href.end()); } // parse all sub node : for(auto it : _element.nodes) { @@ -95,9 +95,9 @@ bool esvg::RadialGradient::parseXML(const exml::Element& _element, mat2x3& _pare if (child.getValue() == "stop") { float offset = 100; etk::Color stopColor = etk::color::none; - std::string content = child.attributes["offset"]; + etk::String content = child.attributes["offset"]; if (content.size()!=0) { - std::pair tmp = parseLength2(content); + etk::Pair tmp = parseLength2(content); if (tmp.second == esvg::distance_pixel) { // special case ==> all time % then no type define ==> % in [0.0 .. 1.0] offset = tmp.first*100.0f; @@ -115,11 +115,11 @@ bool esvg::RadialGradient::parseXML(const exml::Element& _element, mat2x3& _pare content = child.attributes["stop-opacity"]; if (content.size()!=0) { float opacity = parseLength(content); - opacity = std::avg(0.0f, opacity, 1.0f); + opacity = etk::avg(0.0f, opacity, 1.0f); stopColor.setA(opacity); ESVG_VERBOSE(" opacity : '" << content << "' == > " << stopColor); } - m_data.push_back(std::pair>(offset, stopColor)); + m_data.pushBack(etk::Pair>(offset, stopColor)); } else { ESVG_ERROR("(l " << child.getPos() << ") node not suported : '" << child.getValue() << "' must be [stop]"); } @@ -156,7 +156,7 @@ const esvg::Dimension1D& esvg::RadialGradient::getRadius() { return m_radius; } -const std::vector>>& esvg::RadialGradient::getColors(esvg::Document* _document) { +const etk::Vector>>& esvg::RadialGradient::getColors(esvg::Document* _document) { if (m_href == "") { return m_data; } diff --git a/esvg/RadialGradient.hpp b/esvg/RadialGradient.hpp index cd3f751..05f1caf 100644 --- a/esvg/RadialGradient.hpp +++ b/esvg/RadialGradient.hpp @@ -20,8 +20,8 @@ namespace esvg { enum gradientUnits m_unit; enum spreadMethod m_spread; private: - std::string m_href; //!< in case of using a single gradient in multiple gradient, the gradient is store in an other element... - std::vector>> m_data; //!< incompatible with href + etk::String m_href; //!< in case of using a single gradient in multiple gradient, the gradient is store in an other element... + etk::Vector>> m_data; //!< incompatible with href public: RadialGradient(PaintState _parentPaintState); ~RadialGradient(); @@ -32,7 +32,7 @@ namespace esvg { const esvg::Dimension& getCenter(); const esvg::Dimension& getFocal(); const esvg::Dimension1D& getRadius(); - const std::vector>>& getColors(esvg::Document* _document); + const etk::Vector>>& getColors(esvg::Document* _document); }; } diff --git a/esvg/Rectangle.cpp b/esvg/Rectangle.cpp index b9bed10..ca85311 100644 --- a/esvg/Rectangle.cpp +++ b/esvg/Rectangle.cpp @@ -35,7 +35,7 @@ bool esvg::Rectangle::parseXML(const exml::Element& _element, mat2x3& _parentTra parsePosition(_element, m_position, m_size); - std::string content = _element.attributes["rx"]; + etk::String content = _element.attributes["rx"]; if (content.size()!=0) { m_roundedCorner.setX(parseLength(content)); } @@ -144,7 +144,7 @@ void esvg::Rectangle::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int } -void esvg::Rectangle::drawShapePoints(std::vector>& _out, +void esvg::Rectangle::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, @@ -157,10 +157,10 @@ void esvg::Rectangle::drawShapePoints(std::vector>& _out, listPoints = listElement.generateListPoints(_level, _recurtionMax, _threshold); listPoints.applyMatrix(mtx); for (auto &it : listPoints.m_data) { - std::vector listPoint; + etk::Vector listPoint; for (auto &itDot : it) { - listPoint.push_back(itDot.m_pos); + listPoint.pushBack(itDot.m_pos); } - _out.push_back(listPoint); + _out.pushBack(listPoint); } } diff --git a/esvg/Rectangle.hpp b/esvg/Rectangle.hpp index dffa586..1234bb4 100644 --- a/esvg/Rectangle.hpp +++ b/esvg/Rectangle.hpp @@ -19,7 +19,7 @@ namespace esvg { bool parseXML(const exml::Element& _element, mat2x3& _parentTrans, vec2& _sizeMax) override; void display(int32_t _spacing) override; void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level) override; - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/Renderer.cpp b/esvg/Renderer.cpp index 795f210..128ebb7 100644 --- a/esvg/Renderer.cpp +++ b/esvg/Renderer.cpp @@ -58,11 +58,11 @@ void esvg::Renderer::print(const esvg::render::Weight& _weightFill, ememory::SharedPtr& _colorStroke, float _opacity) { if (_colorFill != nullptr) { - //_colorFill->setViewPort(std::pair(vec2(0,0), vec2(sizeX, sizeY))); + //_colorFill->setViewPort(etk::Pair(vec2(0,0), vec2(sizeX, sizeY))); _colorFill->generate(m_document); } if (_colorStroke != nullptr) { - //_colorStroke->setViewPort(std::pair(vec2(0,0), vec2(sizeX, sizeY))); + //_colorStroke->setViewPort(etk::Pair(vec2(0,0), vec2(sizeX, sizeY))); _colorStroke->generate(m_document); } // all together @@ -123,7 +123,7 @@ void esvg::Renderer::print(const esvg::render::Weight& _weightFill, false); /* mat2x3 m_matrix; - std::pair m_viewPort; + etk::Pair m_viewPort; vec2 m_pos1; vec2 m_pos2; */ @@ -141,25 +141,25 @@ void esvg::Renderer::print(const esvg::render::Weight& _weightFill, // for each lines: for (int32_t yyy=0; yyy availlableSegmentPixel; + etk::Vector availlableSegmentPixel; for (auto &it : _listSegment.m_data) { if ( it.p0.y() * m_factor <= float(yyy+1) && it.p1.y() * m_factor >= float(yyy)) { - availlableSegmentPixel.push_back(it); + availlableSegmentPixel.pushBack(it); } } //find all the segment that cross the middle of the line of the center of the pixel line: float subSamplingCenterPos = yyy + 0.5f; - std::vector availlableSegment; + etk::Vector availlableSegment; // find in the subList ... for (auto &it : availlableSegmentPixel) { if ( it.p0.y() * m_factor <= subSamplingCenterPos && it.p1.y() * m_factor >= subSamplingCenterPos ) { - availlableSegment.push_back(it); + availlableSegment.pushBack(it); } } // x position, angle - std::vector> listPosition; + etk::Vector> listPosition; for (auto &it : availlableSegment) { vec2 delta = it.p0 * m_factor - it.p1 * m_factor; // x = coefficent*y+bbb; @@ -181,29 +181,29 @@ void esvg::Renderer::print(const esvg::render::Weight& _weightFill, // for each colomn: for (int32_t xxx=0; xxx availlableSegmentPixel; + etk::Vector availlableSegmentPixel; for (auto &it : _listSegment.m_data) { if ( ( it.p0.x() * m_factor <= float(xxx+1) && it.p1.x() * m_factor >= float(xxx) ) || ( it.p0.x() * m_factor >= float(xxx+1) && it.p1.x() * m_factor <= float(xxx) ) ) { - availlableSegmentPixel.push_back(it); + availlableSegmentPixel.pushBack(it); } } //find all the segment that cross the middle of the line of the center of the pixel line: float subSamplingCenterPos = xxx + 0.5f; - std::vector availlableSegment; + etk::Vector availlableSegment; // find in the subList ... for (auto &it : availlableSegmentPixel) { if ( ( it.p0.x() * m_factor <= subSamplingCenterPos && it.p1.x() * m_factor >= subSamplingCenterPos) || ( it.p0.x() * m_factor >= subSamplingCenterPos && it.p1.x() * m_factor <= subSamplingCenterPos) ) { - availlableSegment.push_back(it); + availlableSegment.pushBack(it); } } // x position, angle - std::vector> listPosition; + etk::Vector> listPosition; for (auto &it : availlableSegment) { vec2 delta = it.p0 * m_factor - it.p1 * m_factor; // x = coefficent*y+bbb; @@ -229,7 +229,7 @@ void esvg::Renderer::print(const esvg::render::Weight& _weightFill, #endif -void esvg::Renderer::writePPM(const std::string& _fileName) { +void esvg::Renderer::writePPM(const etk::String& _fileName) { if (m_buffer.size() == 0) { return; } @@ -290,7 +290,7 @@ extern "C" { }; #pragma pack(pop) } -void esvg::Renderer::writeBMP(const std::string& _fileName) { +void esvg::Renderer::writeBMP(const etk::String& _fileName) { if (m_buffer.size() == 0) { return; } @@ -385,7 +385,7 @@ const ivec2& esvg::Renderer::getSize() const { return m_size; } -std::vector> esvg::Renderer::getData() { +etk::Vector> esvg::Renderer::getData() { return m_buffer; } @@ -393,7 +393,7 @@ std::vector> esvg::Renderer::getData() { void esvg::Renderer::setInterpolationRecurtionMax(int32_t _value) { - m_interpolationRecurtionMax = std::avg(1, _value, 200); + m_interpolationRecurtionMax = etk::avg(1, _value, 200); } int32_t esvg::Renderer::getInterpolationRecurtionMax() const { @@ -401,7 +401,7 @@ int32_t esvg::Renderer::getInterpolationRecurtionMax() const { } void esvg::Renderer::setInterpolationThreshold(float _value) { - m_interpolationThreshold = std::avg(0.0f, _value, 20000.0f); + m_interpolationThreshold = etk::avg(0.0f, _value, 20000.0f); } float esvg::Renderer::getInterpolationThreshold() const { @@ -409,7 +409,7 @@ float esvg::Renderer::getInterpolationThreshold() const { } void esvg::Renderer::setNumberSubScanLine(int32_t _value) { - m_nbSubScanLine = std::avg(1, _value, 200); + m_nbSubScanLine = etk::avg(1, _value, 200); } int32_t esvg::Renderer::getNumberSubScanLine() const { diff --git a/esvg/Renderer.hpp b/esvg/Renderer.hpp index c7bc7ed..53db33a 100644 --- a/esvg/Renderer.hpp +++ b/esvg/Renderer.hpp @@ -28,9 +28,9 @@ namespace esvg { void setSize(const ivec2& _size); const ivec2& getSize() const; protected: - std::vector> m_buffer; + etk::Vector> m_buffer; public: - std::vector> getData(); + etk::Vector> getData(); protected: int32_t m_interpolationRecurtionMax; public: @@ -47,8 +47,8 @@ namespace esvg { void setNumberSubScanLine(int32_t _value); int32_t getNumberSubScanLine() const; public: - void writePPM(const std::string& _fileName); - void writeBMP(const std::string& _fileName); + void writePPM(const etk::String& _fileName); + void writeBMP(const etk::String& _fileName); protected: etk::Color mergeColor(etk::Color _base, etk::Color _integration); public: @@ -59,7 +59,7 @@ namespace esvg { float _opacity); #ifdef DEBUG void addDebugSegment(const esvg::render::SegmentList& _listSegment); - void addDebug(const std::vector>& _info); + void addDebug(const etk::Vector>& _info); #endif protected: esvg::Document* m_document; diff --git a/esvg/cap.cpp b/esvg/cap.cpp index 07ab16f..c77719a 100644 --- a/esvg/cap.cpp +++ b/esvg/cap.cpp @@ -13,7 +13,7 @@ static const char* values[] = { "square" }; -std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::cap _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, enum esvg::cap _obj) { _os << values[_obj]; return _os; } diff --git a/esvg/cap.hpp b/esvg/cap.hpp index 26bd88c..3ceda11 100644 --- a/esvg/cap.hpp +++ b/esvg/cap.hpp @@ -16,6 +16,6 @@ namespace esvg { /** * @brief Debug operator To display the curent element in a Human redeable information */ - std::ostream& operator <<(std::ostream& _os, enum esvg::cap _obj); + etk::Stream& operator <<(etk::Stream& _os, enum esvg::cap _obj); } diff --git a/esvg/esvg.cpp b/esvg/esvg.cpp index 915e993..3aaf47a 100644 --- a/esvg/esvg.cpp +++ b/esvg/esvg.cpp @@ -58,10 +58,10 @@ void esvg::Document::draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int3 } // FOR TEST only ... -void esvg::Document::generateAnImage(const std::string& _fileName, bool _visualDebug) { +void esvg::Document::generateAnImage(const etk::String& _fileName, bool _visualDebug) { generateAnImage(m_size, _fileName, _visualDebug); } -void esvg::Document::generateAnImage(const ivec2& _size, const std::string& _fileName, bool _visualDebug) { +void esvg::Document::generateAnImage(const ivec2& _size, const etk::String& _fileName, bool _visualDebug) { ivec2 sizeRender = _size; if (sizeRender.x() <= 0) { sizeRender.setX(m_size.x()); @@ -88,7 +88,7 @@ void esvg::Document::generateAnImage(const ivec2& _size, const std::string& _fil } -std::vector> esvg::Document::renderImageFloatRGBA(ivec2& _size) { +etk::Vector> esvg::Document::renderImageFloatRGBA(ivec2& _size) { if (_size.x() <= 0) { _size.setX(m_size.x()); } @@ -106,10 +106,10 @@ std::vector> esvg::Document::renderImageFloatRGBA(ivec2& _si return renderedElement->getData(); } -std::vector> esvg::Document::renderImageFloatRGB(ivec2& _size) { - std::vector> data = renderImageFloatRGBA(_size); +etk::Vector> esvg::Document::renderImageFloatRGB(ivec2& _size) { + etk::Vector> data = renderImageFloatRGBA(_size); // Reduce scope: - std::vector> out; + etk::Vector> out; out.resize(data.size()); for (size_t iii=0; iii> esvg::Document::renderImageFloatRGB(ivec2& _siz return out; } -std::vector> esvg::Document::renderImageU8RGBA(ivec2& _size) { - std::vector> data = renderImageFloatRGBA(_size); +etk::Vector> esvg::Document::renderImageU8RGBA(ivec2& _size) { + etk::Vector> data = renderImageFloatRGBA(_size); // Reduce scope: - std::vector> out; + etk::Vector> out; out.resize(data.size()); for (size_t iii=0; iii> esvg::Document::renderImageU8RGBA(ivec2& _siz return out; } -std::vector> esvg::Document::renderImageU8RGB(ivec2& _size) { - std::vector> data = renderImageFloatRGBA(_size); +etk::Vector> esvg::Document::renderImageU8RGB(ivec2& _size) { + etk::Vector> data = renderImageFloatRGBA(_size); // Reduce scope: - std::vector> out; + etk::Vector> out; out.resize(data.size()); for (size_t iii=0; iii listStyle = etk::split(content, ';'); + etk::Vector listStyle = etk::split(content, ';'); for (auto &it : listStyle) { - std::vector value = etk::split(it, ':'); + etk::Vector value = etk::split(it, ':'); if (value.size() != 2) { ESVG_ERROR("parsing style with a wrong patern : " << it << " missing ':'"); continue; @@ -333,9 +333,9 @@ bool esvg::Document::parseXMLData(const exml::Element& _root, bool _isReference) } // add element in the system if (_isReference == false) { - m_subElementList.push_back(elementParser); + m_subElementList.pushBack(elementParser); } else { - m_refList.push_back(elementParser); + m_refList.pushBack(elementParser); } } if ( m_size.x() == 0 @@ -352,7 +352,7 @@ bool esvg::Document::parseXMLData(const exml::Element& _root, bool _isReference) -ememory::SharedPtr esvg::Document::getReference(const std::string& _name) { +ememory::SharedPtr esvg::Document::getReference(const etk::String& _name) { if (_name == "") { ESVG_ERROR("request a reference with no name ... "); return nullptr; @@ -369,8 +369,8 @@ ememory::SharedPtr esvg::Document::getReference(const std::string& _ return nullptr; } -std::vector> esvg::Document::getLines(vec2 _size) { - std::vector> out; +etk::Vector> esvg::Document::getLines(vec2 _size) { + etk::Vector> out; if (_size.x() <= 0) { _size.setX(m_size.x()); } @@ -386,7 +386,7 @@ std::vector> esvg::Document::getLines(vec2 _size) { } -void esvg::Document::drawShapePoints(std::vector>& _out, +void esvg::Document::drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/esvg.hpp b/esvg/esvg.hpp index 235263e..cee6601 100644 --- a/esvg/esvg.hpp +++ b/esvg/esvg.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include #include #include @@ -18,12 +18,12 @@ namespace esvg { class Document : public esvg::Base { private: - std::string m_fileName; + etk::String m_fileName; bool m_loadOK; - std::string m_version; - std::string m_title; - std::vector> m_subElementList; //!< sub-element list - std::vector> m_refList; //!< reference elements ... + etk::String m_version; + etk::String m_title; + etk::Vector> m_subElementList; //!< sub-element list + etk::Vector> m_refList; //!< reference elements ... vec2 m_size; public: Document(); @@ -35,28 +35,28 @@ namespace esvg { * @return false : An error occured * @return true : Parsing is OK */ - bool parse(const std::string& _data); + bool parse(const etk::String& _data); /** * @brief generate a string that contain the created SVG * @param[out] _data Data where the svg is stored * @return false : An error occured * @return true : Parsing is OK */ - bool generate(std::string& _data); + bool generate(etk::String& _data); /** * @brief Load the file that might contain the svg * @param[in] _file Filename of the svg (compatible with etk FSNode naming) * @return false : An error occured * @return true : Parsing is OK */ - bool load(const std::string& _file); + bool load(const etk::String& _file); /** * @brief Store the SVG in the file * @param[in] _file Filename of the svg (compatible with etk FSNode naming) * @return false : An error occured * @return true : Parsing is OK */ - bool store(const std::string& _file); + bool store(const etk::String& _file); protected: /** * @brief change all style in a xml atribute @@ -72,30 +72,30 @@ namespace esvg { */ void displayDebug(); // TODO: remove this fucntion : use generic function ... - void generateAnImage(const std::string& _fileName, bool _visualDebug=false); - void generateAnImage(const ivec2& _size, const std::string& _fileName, bool _visualDebug=false); + void generateAnImage(const etk::String& _fileName, bool _visualDebug=false); + void generateAnImage(const ivec2& _size, const etk::String& _fileName, bool _visualDebug=false); /** * @brief Generate Image in a specific format. * @param[in,out] _size Size expected of the rendered image (value <=0 if it need to be automatic.) return the size generate * @return Vector of the data used to display (simple vector: generic to transmit) */ - std::vector> renderImageFloatRGBA(ivec2& _size); + etk::Vector> renderImageFloatRGBA(ivec2& _size); //! @previous - std::vector> renderImageFloatRGB(ivec2& _size); + etk::Vector> renderImageFloatRGB(ivec2& _size); //! @previous - std::vector> renderImageU8RGBA(ivec2& _size); + etk::Vector> renderImageU8RGBA(ivec2& _size); //! @previous - std::vector> renderImageU8RGB(ivec2& _size); - std::vector> getLines(vec2 _size=vec2(256,256)); + etk::Vector> renderImageU8RGB(ivec2& _size); + etk::Vector> getLines(vec2 _size=vec2(256,256)); protected: void draw(esvg::Renderer& _myRenderer, mat2x3& _basicTrans, int32_t _level=0) override; public: vec2 getDefinedSize() { return m_size; }; - ememory::SharedPtr getReference(const std::string& _name); + ememory::SharedPtr getReference(const etk::String& _name); protected: - void drawShapePoints(std::vector>& _out, + void drawShapePoints(etk::Vector>& _out, int32_t _recurtionMax, float _threshold, mat2x3& _basicTrans, diff --git a/esvg/gradientUnits.cpp b/esvg/gradientUnits.cpp index 0018317..a01ebe2 100644 --- a/esvg/gradientUnits.cpp +++ b/esvg/gradientUnits.cpp @@ -12,7 +12,7 @@ static const char* values[] = { "objectBoundingBox" }; -std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::gradientUnits _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, enum esvg::gradientUnits _obj) { _os << values[_obj]; return _os; } diff --git a/esvg/gradientUnits.hpp b/esvg/gradientUnits.hpp index 3204195..73c4ad2 100644 --- a/esvg/gradientUnits.hpp +++ b/esvg/gradientUnits.hpp @@ -15,5 +15,5 @@ namespace esvg { /** * @brief Debug operator To display the curent element in a Human redeable information */ - std::ostream& operator <<(std::ostream& _os, enum esvg::gradientUnits _obj); + etk::Stream& operator <<(etk::Stream& _os, enum esvg::gradientUnits _obj); } diff --git a/esvg/join.cpp b/esvg/join.cpp index 1556931..db89cf3 100644 --- a/esvg/join.cpp +++ b/esvg/join.cpp @@ -13,7 +13,7 @@ static const char* values[] = { "bevel" }; -std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::join _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, enum esvg::join _obj) { _os << values[_obj]; return _os; } diff --git a/esvg/join.hpp b/esvg/join.hpp index 859f749..c97c024 100644 --- a/esvg/join.hpp +++ b/esvg/join.hpp @@ -16,7 +16,7 @@ namespace esvg { /** * @brief Debug operator To display the curent element in a Human redeable information */ - std::ostream& operator <<(std::ostream& _os, enum esvg::join _obj); + etk::Stream& operator <<(etk::Stream& _os, enum esvg::join _obj); } diff --git a/esvg/render/DynamicColor.cpp b/esvg/render/DynamicColor.cpp index 407a89b..eb1d298 100644 --- a/esvg/render/DynamicColor.cpp +++ b/esvg/render/DynamicColor.cpp @@ -10,7 +10,7 @@ #include #include -esvg::render::DynamicColorSpecial::DynamicColorSpecial(const std::string& _link, const mat2x3& _mtx) : +esvg::render::DynamicColorSpecial::DynamicColorSpecial(const etk::String& _link, const mat2x3& _mtx) : m_linear(true), m_colorName(_link), m_matrix(_mtx), @@ -18,7 +18,7 @@ esvg::render::DynamicColorSpecial::DynamicColorSpecial(const std::string& _link, } -void esvg::render::DynamicColorSpecial::setViewPort(const std::pair& _viewPort) { +void esvg::render::DynamicColorSpecial::setViewPort(const etk::Pair& _viewPort) { m_viewPort = _viewPort; } @@ -162,7 +162,7 @@ etk::Color esvg::render::DynamicColorSpecial::getColorLinear(const ivec } return etk::color::green; } -static std::pair intersectLineToCircle(const vec2& _pos1, +static etk::Pair intersectLineToCircle(const vec2& _pos1, const vec2& _pos2, const vec2& _center = vec2(0.0f, 0.0f), float _radius = 1.0f) { @@ -180,10 +180,10 @@ static std::pair intersectLineToCircle(const vec2& _pos1, float distToCenter = (midpt - _center).length2(); if (distToCenter > _radius * _radius) { - return std::pair(vec2(0.0,0.0), vec2(0.0,0.0)); + return etk::Pair(vec2(0.0,0.0), vec2(0.0,0.0)); } if (distToCenter == _radius * _radius) { - return std::pair(midpt, midpt); + return etk::Pair(midpt, midpt); } float distToIntersection; if (distToCenter == 0.0f) { @@ -200,7 +200,7 @@ static std::pair intersectLineToCircle(const vec2& _pos1, // normalize... v1.safeNormalize(); v1 *= distToIntersection; - return std::pair(midpt + v1, midpt - v1); + return etk::Pair(midpt + v1, midpt - v1); } etk::Color esvg::render::DynamicColorSpecial::getColorRadial(const ivec2& _pos) const { @@ -252,7 +252,7 @@ etk::Color esvg::render::DynamicColorSpecial::getColorRadial(const ivec if (focalCenter == currentPoint) { ratio = 0.0f; } else { - std::pair positions = intersectLineToCircle(focalCenter, currentPoint); + etk::Pair positions = intersectLineToCircle(focalCenter, currentPoint); float lenghtBase = (currentPoint - focalCenter).length(); float lenghtBorder1 = (positions.first - focalCenter).length(); float lenghtBorder2 = (positions.second - focalCenter).length(); @@ -439,7 +439,7 @@ void esvg::render::DynamicColorSpecial::generate(esvg::Document* _document) { } } -ememory::SharedPtr esvg::render::createColor(std::pair, std::string> _color, const mat2x3& _mtx) { +ememory::SharedPtr esvg::render::createColor(etk::Pair, etk::String> _color, const mat2x3& _mtx) { // Check if need to create a color: if ( _color.first.a() == 0x00 && _color.second == "") { diff --git a/esvg/render/DynamicColor.hpp b/esvg/render/DynamicColor.hpp index 0237b3c..ea48718 100644 --- a/esvg/render/DynamicColor.hpp +++ b/esvg/render/DynamicColor.hpp @@ -24,7 +24,7 @@ namespace esvg { virtual ~DynamicColor() {}; virtual etk::Color getColor(const ivec2& _pos) const = 0; virtual void generate(esvg::Document* _document) = 0; - virtual void setViewPort(const std::pair& _viewPort) = 0; + virtual void setViewPort(const etk::Pair& _viewPort) = 0; }; class DynamicColorUni : public esvg::render::DynamicColor { public: @@ -40,7 +40,7 @@ namespace esvg { virtual void generate(esvg::Document* _document) { // nothing to do ... } - virtual void setViewPort(const std::pair& _viewPort) { + virtual void setViewPort(const etk::Pair& _viewPort) { // nothing to do ... }; }; @@ -49,9 +49,9 @@ namespace esvg { bool m_linear; esvg::spreadMethod m_spread; esvg::gradientUnits m_unit; - std::string m_colorName; + etk::String m_colorName; mat2x3 m_matrix; - std::pair m_viewPort; + etk::Pair m_viewPort; vec2 m_pos1; // in radius ==> center vec2 m_pos2; // in radius ==> radius end position vec2 m_focal; // Specific radius @@ -61,19 +61,19 @@ namespace esvg { float m_focalLength; bool m_clipOut; bool m_centerIsFocal; - std::vector>> m_data; + etk::Vector>> m_data; public: - DynamicColorSpecial(const std::string& _link, const mat2x3& _mtx); + DynamicColorSpecial(const etk::String& _link, const mat2x3& _mtx); virtual etk::Color getColor(const ivec2& _pos) const; private: etk::Color getColorLinear(const ivec2& _pos) const; etk::Color getColorRadial(const ivec2& _pos) const; public: virtual void generate(esvg::Document* _document); - virtual void setViewPort(const std::pair& _viewPort); + virtual void setViewPort(const etk::Pair& _viewPort); }; - ememory::SharedPtr createColor(std::pair, std::string> _color, const mat2x3& _mtx); + ememory::SharedPtr createColor(etk::Pair, etk::String> _color, const mat2x3& _mtx); } } diff --git a/esvg/render/Element.cpp b/esvg/render/Element.cpp index b9761c5..c46c695 100644 --- a/esvg/render/Element.cpp +++ b/esvg/render/Element.cpp @@ -7,7 +7,7 @@ #include #include -std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::render::path _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, enum esvg::render::path _obj) { switch (_obj) { case esvg::render::path_stop: _os << "path_stop"; @@ -48,9 +48,9 @@ std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::render::path _obj) }; return _os; } -std::ostream& esvg::operator <<(std::ostream& _os, const esvg::render::Element& _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, const esvg::render::Element& _obj) { _os << _obj.getType(); - _os << ": rel=" << etk::to_string(_obj.getRelative()) << " "; + _os << ": rel=" << etk::toString(_obj.getRelative()) << " "; _os << _obj.display(); return _os; } diff --git a/esvg/render/Element.hpp b/esvg/render/Element.hpp index eb1b11f..8bfed54 100644 --- a/esvg/render/Element.hpp +++ b/esvg/render/Element.hpp @@ -74,17 +74,17 @@ namespace esvg { m_pos2 = _val; } public: - virtual std::string display() const = 0; + virtual etk::String display() const = 0; }; } /** * @brief Debug operator To display the curent element in a Human redeable information */ - std::ostream& operator <<(std::ostream& _os, const esvg::render::Element& _obj); + etk::Stream& operator <<(etk::Stream& _os, const esvg::render::Element& _obj); /** * @brief Debug operator To display the curent element in a Human redeable information */ - std::ostream& operator <<(std::ostream& _os, enum esvg::render::path _obj); + etk::Stream& operator <<(etk::Stream& _os, enum esvg::render::path _obj); } #include diff --git a/esvg/render/ElementBezierCurveTo.cpp b/esvg/render/ElementBezierCurveTo.cpp index aa9f7dc..7a4a386 100644 --- a/esvg/render/ElementBezierCurveTo.cpp +++ b/esvg/render/ElementBezierCurveTo.cpp @@ -13,6 +13,6 @@ esvg::render::ElementBezierCurveTo::ElementBezierCurveTo(bool _relative, const v m_pos1 = _pos1; } -std::string esvg::render::ElementBezierCurveTo::display() const { - return std::string("pos=") + etk::to_string(m_pos) + " pos1=" + etk::to_string(m_pos1); +etk::String esvg::render::ElementBezierCurveTo::display() const { + return etk::String("pos=") + etk::toString(m_pos) + " pos1=" + etk::toString(m_pos1); } \ No newline at end of file diff --git a/esvg/render/ElementBezierCurveTo.hpp b/esvg/render/ElementBezierCurveTo.hpp index 8b403ac..42cda1f 100644 --- a/esvg/render/ElementBezierCurveTo.hpp +++ b/esvg/render/ElementBezierCurveTo.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementBezierCurveTo(bool _relative, const vec2& _pos1, const vec2& _pos); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementBezierSmoothCurveTo.cpp b/esvg/render/ElementBezierSmoothCurveTo.cpp index 4920be5..a57adce 100644 --- a/esvg/render/ElementBezierSmoothCurveTo.cpp +++ b/esvg/render/ElementBezierSmoothCurveTo.cpp @@ -13,6 +13,6 @@ esvg::render::ElementBezierSmoothCurveTo::ElementBezierSmoothCurveTo(bool _relat } -std::string esvg::render::ElementBezierSmoothCurveTo::display() const { - return std::string("pos=") + etk::to_string(m_pos); +etk::String esvg::render::ElementBezierSmoothCurveTo::display() const { + return etk::String("pos=") + etk::toString(m_pos); } \ No newline at end of file diff --git a/esvg/render/ElementBezierSmoothCurveTo.hpp b/esvg/render/ElementBezierSmoothCurveTo.hpp index 3f0aa11..eb779f3 100644 --- a/esvg/render/ElementBezierSmoothCurveTo.hpp +++ b/esvg/render/ElementBezierSmoothCurveTo.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementBezierSmoothCurveTo(bool _relative, const vec2& _pos); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementClose.cpp b/esvg/render/ElementClose.cpp index 36550ee..73eec7f 100644 --- a/esvg/render/ElementClose.cpp +++ b/esvg/render/ElementClose.cpp @@ -12,7 +12,7 @@ esvg::render::ElementClose::ElementClose(bool _relative): } -std::string esvg::render::ElementClose::display() const { +etk::String esvg::render::ElementClose::display() const { return ""; } diff --git a/esvg/render/ElementClose.hpp b/esvg/render/ElementClose.hpp index 81e0360..5fd2304 100644 --- a/esvg/render/ElementClose.hpp +++ b/esvg/render/ElementClose.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementClose(bool _relative=false); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementCurveTo.cpp b/esvg/render/ElementCurveTo.cpp index e375802..638895f 100644 --- a/esvg/render/ElementCurveTo.cpp +++ b/esvg/render/ElementCurveTo.cpp @@ -16,6 +16,6 @@ esvg::render::ElementCurveTo::ElementCurveTo(bool _relative, const vec2& _pos1, -std::string esvg::render::ElementCurveTo::display() const { - return std::string("pos=") + etk::to_string(m_pos) + " pos1=" + etk::to_string(m_pos1) + " pos2=" + etk::to_string(m_pos2); +etk::String esvg::render::ElementCurveTo::display() const { + return etk::String("pos=") + etk::toString(m_pos) + " pos1=" + etk::toString(m_pos1) + " pos2=" + etk::toString(m_pos2); } \ No newline at end of file diff --git a/esvg/render/ElementCurveTo.hpp b/esvg/render/ElementCurveTo.hpp index cd4b1f8..8d79a98 100644 --- a/esvg/render/ElementCurveTo.hpp +++ b/esvg/render/ElementCurveTo.hpp @@ -14,7 +14,7 @@ namespace esvg { public: ElementCurveTo(bool _relative, const vec2& _pos1, const vec2& _pos2, const vec2& _pos); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementElliptic.cpp b/esvg/render/ElementElliptic.cpp index b62bd48..2d14496 100644 --- a/esvg/render/ElementElliptic.cpp +++ b/esvg/render/ElementElliptic.cpp @@ -22,10 +22,10 @@ esvg::render::ElementElliptic::ElementElliptic(bool _relative, } -std::string esvg::render::ElementElliptic::display() const { - return std::string("pos=") + etk::to_string(m_pos) - + " radius=" + etk::to_string(m_pos1) - + " angle=" + etk::to_string(m_angle) - + " largeArcFlag=" + etk::to_string(m_largeArcFlag) - + " sweepFlag=" + etk::to_string(m_sweepFlag); +etk::String esvg::render::ElementElliptic::display() const { + return etk::String("pos=") + etk::toString(m_pos) + + " radius=" + etk::toString(m_pos1) + + " angle=" + etk::toString(m_angle) + + " largeArcFlag=" + etk::toString(m_largeArcFlag) + + " sweepFlag=" + etk::toString(m_sweepFlag); } \ No newline at end of file diff --git a/esvg/render/ElementElliptic.hpp b/esvg/render/ElementElliptic.hpp index 1f116f8..c00474a 100644 --- a/esvg/render/ElementElliptic.hpp +++ b/esvg/render/ElementElliptic.hpp @@ -24,7 +24,7 @@ namespace esvg { bool _sweepFlag, const vec2& _pos); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementLineTo.cpp b/esvg/render/ElementLineTo.cpp index 8124fae..e54cf0e 100644 --- a/esvg/render/ElementLineTo.cpp +++ b/esvg/render/ElementLineTo.cpp @@ -13,6 +13,6 @@ esvg::render::ElementLineTo::ElementLineTo(bool _relative, const vec2& _pos): } -std::string esvg::render::ElementLineTo::display() const { - return std::string("pos=") + etk::to_string(m_pos); +etk::String esvg::render::ElementLineTo::display() const { + return etk::String("pos=") + etk::toString(m_pos); } \ No newline at end of file diff --git a/esvg/render/ElementLineTo.hpp b/esvg/render/ElementLineTo.hpp index bb9ba69..9688bbd 100644 --- a/esvg/render/ElementLineTo.hpp +++ b/esvg/render/ElementLineTo.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementLineTo(bool _relative, const vec2& _pos); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementLineToH.cpp b/esvg/render/ElementLineToH.cpp index 3c78cdc..ab73437 100644 --- a/esvg/render/ElementLineToH.cpp +++ b/esvg/render/ElementLineToH.cpp @@ -13,6 +13,6 @@ esvg::render::ElementLineToH::ElementLineToH(bool _relative, float _posX): } -std::string esvg::render::ElementLineToH::display() const { - return std::string("posX=") + etk::to_string(m_pos.x()); +etk::String esvg::render::ElementLineToH::display() const { + return etk::String("posX=") + etk::toString(m_pos.x()); } \ No newline at end of file diff --git a/esvg/render/ElementLineToH.hpp b/esvg/render/ElementLineToH.hpp index 4942b97..3a0edee 100644 --- a/esvg/render/ElementLineToH.hpp +++ b/esvg/render/ElementLineToH.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementLineToH(bool _relative, float _posX); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementLineToV.cpp b/esvg/render/ElementLineToV.cpp index 033e980..17b10f9 100644 --- a/esvg/render/ElementLineToV.cpp +++ b/esvg/render/ElementLineToV.cpp @@ -13,6 +13,6 @@ esvg::render::ElementLineToV::ElementLineToV(bool _relative, float _posY): } -std::string esvg::render::ElementLineToV::display() const { - return std::string("posY=") + etk::to_string(m_pos.y()); +etk::String esvg::render::ElementLineToV::display() const { + return etk::String("posY=") + etk::toString(m_pos.y()); } \ No newline at end of file diff --git a/esvg/render/ElementLineToV.hpp b/esvg/render/ElementLineToV.hpp index db84d13..9b01f86 100644 --- a/esvg/render/ElementLineToV.hpp +++ b/esvg/render/ElementLineToV.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementLineToV(bool _relative, float _posY); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementMoveTo.cpp b/esvg/render/ElementMoveTo.cpp index f3f293d..c833e7b 100644 --- a/esvg/render/ElementMoveTo.cpp +++ b/esvg/render/ElementMoveTo.cpp @@ -13,6 +13,6 @@ esvg::render::ElementMoveTo::ElementMoveTo(bool _relative, const vec2& _pos): } -std::string esvg::render::ElementMoveTo::display() const { - return std::string("pos=") + etk::to_string(m_pos); +etk::String esvg::render::ElementMoveTo::display() const { + return etk::String("pos=") + etk::toString(m_pos); } \ No newline at end of file diff --git a/esvg/render/ElementMoveTo.hpp b/esvg/render/ElementMoveTo.hpp index 80183cc..eb52b72 100644 --- a/esvg/render/ElementMoveTo.hpp +++ b/esvg/render/ElementMoveTo.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementMoveTo(bool _relative, const vec2& _pos); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementSmoothCurveTo.cpp b/esvg/render/ElementSmoothCurveTo.cpp index eb816f1..03428d0 100644 --- a/esvg/render/ElementSmoothCurveTo.cpp +++ b/esvg/render/ElementSmoothCurveTo.cpp @@ -14,6 +14,6 @@ esvg::render::ElementSmoothCurveTo::ElementSmoothCurveTo(bool _relative, const v } -std::string esvg::render::ElementSmoothCurveTo::display() const { - return std::string("pos=") + etk::to_string(m_pos) + " pos2=" + etk::to_string(m_pos2); +etk::String esvg::render::ElementSmoothCurveTo::display() const { + return etk::String("pos=") + etk::toString(m_pos) + " pos2=" + etk::toString(m_pos2); } \ No newline at end of file diff --git a/esvg/render/ElementSmoothCurveTo.hpp b/esvg/render/ElementSmoothCurveTo.hpp index 095d0bc..0119c6c 100644 --- a/esvg/render/ElementSmoothCurveTo.hpp +++ b/esvg/render/ElementSmoothCurveTo.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementSmoothCurveTo(bool _relative, const vec2& _pos2, const vec2& _pos); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/ElementStop.cpp b/esvg/render/ElementStop.cpp index f4a7db9..47af044 100644 --- a/esvg/render/ElementStop.cpp +++ b/esvg/render/ElementStop.cpp @@ -12,7 +12,7 @@ esvg::render::ElementStop::ElementStop(): } -std::string esvg::render::ElementStop::display() const { +etk::String esvg::render::ElementStop::display() const { return ""; } diff --git a/esvg/render/ElementStop.hpp b/esvg/render/ElementStop.hpp index f52d33c..680077c 100644 --- a/esvg/render/ElementStop.hpp +++ b/esvg/render/ElementStop.hpp @@ -15,7 +15,7 @@ namespace esvg { public: ElementStop(); public: - virtual std::string display() const; + virtual etk::String display() const; }; } } diff --git a/esvg/render/Path.cpp b/esvg/render/Path.cpp index d5e20d8..5a88bc5 100644 --- a/esvg/render/Path.cpp +++ b/esvg/render/Path.cpp @@ -12,43 +12,43 @@ void esvg::render::Path::clear() { } void esvg::render::Path::stop() { - m_listElement.push_back(ememory::makeShared()); + m_listElement.pushBack(ememory::makeShared()); } void esvg::render::Path::close(bool _relative) { - m_listElement.push_back(ememory::makeShared(_relative)); + m_listElement.pushBack(ememory::makeShared(_relative)); } void esvg::render::Path::moveTo(bool _relative, const vec2& _pos) { - m_listElement.push_back(ememory::makeShared(_relative, _pos)); + m_listElement.pushBack(ememory::makeShared(_relative, _pos)); } void esvg::render::Path::lineTo(bool _relative, const vec2& _pos) { - m_listElement.push_back(ememory::makeShared(_relative, _pos)); + m_listElement.pushBack(ememory::makeShared(_relative, _pos)); } void esvg::render::Path::lineToH(bool _relative, float _posX) { - m_listElement.push_back(ememory::makeShared(_relative, _posX)); + m_listElement.pushBack(ememory::makeShared(_relative, _posX)); } void esvg::render::Path::lineToV(bool _relative, float _posY) { - m_listElement.push_back(ememory::makeShared(_relative, _posY)); + m_listElement.pushBack(ememory::makeShared(_relative, _posY)); } void esvg::render::Path::curveTo(bool _relative, const vec2& _pos1, const vec2& _pos2, const vec2& _pos) { - m_listElement.push_back(ememory::makeShared(_relative, _pos1, _pos2, _pos)); + m_listElement.pushBack(ememory::makeShared(_relative, _pos1, _pos2, _pos)); } void esvg::render::Path::smoothCurveTo(bool _relative, const vec2& _pos2, const vec2& _pos) { - m_listElement.push_back(ememory::makeShared(_relative, _pos2, _pos)); + m_listElement.pushBack(ememory::makeShared(_relative, _pos2, _pos)); } void esvg::render::Path::bezierCurveTo(bool _relative, const vec2& _pos1, const vec2& _pos) { - m_listElement.push_back(ememory::makeShared(_relative, _pos1, _pos)); + m_listElement.pushBack(ememory::makeShared(_relative, _pos1, _pos)); } void esvg::render::Path::bezierSmoothCurveTo(bool _relative, const vec2& _pos) { - m_listElement.push_back(ememory::makeShared(_relative, _pos)); + m_listElement.pushBack(ememory::makeShared(_relative, _pos)); } void esvg::render::Path::ellipticTo(bool _relative, @@ -57,7 +57,7 @@ void esvg::render::Path::ellipticTo(bool _relative, bool _largeArcFlag, bool _sweepFlag, const vec2& _pos) { - m_listElement.push_back(ememory::makeShared(_relative, _radius, _angle, _largeArcFlag, _sweepFlag, _pos)); + m_listElement.pushBack(ememory::makeShared(_relative, _radius, _angle, _largeArcFlag, _sweepFlag, _pos)); } static const char* spacingDist(int32_t _spacing) { @@ -79,7 +79,7 @@ void esvg::render::Path::display(int32_t _spacing) { } -void interpolateCubicBezier(std::vector& _listPoint, +void interpolateCubicBezier(etk::Vector& _listPoint, int32_t _recurtionMax, float _threshold, vec2 _pos1, @@ -105,7 +105,7 @@ void interpolateCubicBezier(std::vector& _listPoint, #endif if ((distance2 + distance3)*(distance2 + distance3) < _threshold * delta.length2()) { - _listPoint.push_back(esvg::render::Point(_pos4, _type) ); + _listPoint.pushBack(esvg::render::Point(_pos4, _type) ); return; } vec2 pos123 = (pos12+pos23)*0.5f; @@ -125,7 +125,7 @@ static float vectorAngle(vec2 _uuu, vec2 _vvv) { esvg::render::PointList esvg::render::Path::generateListPoints(int32_t _level, int32_t _recurtionMax, float _threshold) { ESVG_VERBOSE(spacingDist(_level) << "Generate List Points ... from a path"); esvg::render::PointList out; - std::vector tmpListPoint; + etk::Vector tmpListPoint; vec2 lastPosition(0.0f, 0.0f); vec2 lastAngle(0.0f, 0.0f); int32_t lastPointId = -1; @@ -161,7 +161,7 @@ esvg::render::PointList esvg::render::Path::generateListPoints(int32_t _level, i vec2 delta = (tmpListPoint.front().m_pos - tmpListPoint.back().m_pos).absolute(); if ( delta.x() <= 0.00001 && delta.y() <= 0.00001) { - tmpListPoint.pop_back(); + tmpListPoint.popBack(); ESVG_VERBOSE(" Remove point Z property : " << tmpListPoint.back().m_pos << " with delta=" << delta); } out.addList(tmpListPoint); @@ -183,49 +183,49 @@ esvg::render::PointList esvg::render::Path::generateListPoints(int32_t _level, i lastPosition = vec2(0.0f, 0.0f); } lastPosition += it->getPos(); - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::start)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::start)); lastAngle = lastPosition; break; case esvg::render::path_lineTo: // If no previous point, we need to create the last point has start ... if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::start)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::start)); } if (it->getRelative() == false) { lastPosition = vec2(0.0f, 0.0f); } lastPosition += it->getPos(); - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); lastAngle = lastPosition; break; case esvg::render::path_lineToH: // If no previous point, we need to create the last point has start ... if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::start)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::start)); } if (it->getRelative() == false) { lastPosition = vec2(0.0f, 0.0f); } lastPosition += it->getPos(); - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); lastAngle = lastPosition; break; case esvg::render::path_lineToV: // If no previous point, we need to create the last point has start ... if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::start)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::start)); } if (it->getRelative() == false) { lastPosition = vec2(0.0f, 0.0f); } lastPosition += it->getPos(); - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); lastAngle = lastPosition; break; case esvg::render::path_curveTo: // If no previous point, we need to create the last point has start ... if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); } { vec2 lastPosStore(lastPosition); @@ -251,7 +251,7 @@ esvg::render::PointList esvg::render::Path::generateListPoints(int32_t _level, i case esvg::render::path_smoothCurveTo: // If no previous point, we need to create the last point has start ... if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); } { vec2 lastPosStore(lastPosition); @@ -278,7 +278,7 @@ esvg::render::PointList esvg::render::Path::generateListPoints(int32_t _level, i case esvg::render::path_bezierCurveTo: // If no previous point, we need to create the last point has start ... if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); } { vec2 lastPosStore(lastPosition); @@ -306,7 +306,7 @@ esvg::render::PointList esvg::render::Path::generateListPoints(int32_t _level, i case esvg::render::path_bezierSmoothCurveTo: // If no previous point, we need to create the last point has start ... if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); } { vec2 lastPosStore(lastPosition); @@ -334,7 +334,7 @@ esvg::render::PointList esvg::render::Path::generateListPoints(int32_t _level, i case esvg::render::path_elliptic: // If no previous point, we need to create the last point has start ... if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); } { ememory::SharedPtr tmpIt(ememory::dynamicPointerCast(it)); @@ -363,9 +363,9 @@ esvg::render::PointList esvg::render::Path::generateListPoints(int32_t _level, i || radius.y() < 1e-6f) { ESVG_WARNING("Degenerate arc in Line"); if (tmpListPoint.size() == 0) { - tmpListPoint.push_back(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(lastPosition, esvg::render::Point::type::join)); } - tmpListPoint.push_back(esvg::render::Point(pos, esvg::render::Point::type::join)); + tmpListPoint.pushBack(esvg::render::Point(pos, esvg::render::Point::type::join)); } else { // Convert to center point parameterization. // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes diff --git a/esvg/render/Path.hpp b/esvg/render/Path.hpp index dc892a1..d1e27c1 100644 --- a/esvg/render/Path.hpp +++ b/esvg/render/Path.hpp @@ -18,7 +18,7 @@ namespace esvg { namespace render { class Path { public: - std::vector> m_listElement; + etk::Vector> m_listElement; #ifdef DEBUG esvg::render::SegmentList m_debugInformation; #endif diff --git a/esvg/render/Point.hpp b/esvg/render/Point.hpp index 5bc9c2b..1517c86 100644 --- a/esvg/render/Point.hpp +++ b/esvg/render/Point.hpp @@ -31,6 +31,12 @@ namespace esvg { vec2 m_posNext; vec2 m_delta; float m_len; + // TODO: Update etk::Vector to support not having it ... + Point() : + m_pos(0,0), + m_type(esvg::render::Point::type::join) { + // nothing to do ... + } Point(const vec2& _pos, enum esvg::render::Point::type _type = esvg::render::Point::type::join) : m_pos(_pos), m_type(_type) { diff --git a/esvg/render/PointList.cpp b/esvg/render/PointList.cpp index fa3c750..d326ed8 100644 --- a/esvg/render/PointList.cpp +++ b/esvg/render/PointList.cpp @@ -11,8 +11,8 @@ esvg::render::PointList::PointList() { // nothing to do ... } -void esvg::render::PointList::addList(std::vector& _list) { - m_data.push_back(_list); +void esvg::render::PointList::addList(etk::Vector& _list) { + m_data.pushBack(_list); // TODO : Add a checker of correct list ... } @@ -24,8 +24,8 @@ void esvg::render::PointList::applyMatrix(const mat2x3& _transformationMatrix) { } } -std::pair esvg::render::PointList::getViewPort() { - std::pair out(vec2(9999999999.0,9999999999.0),vec2(-9999999999.0,-9999999999.0)); +etk::Pair esvg::render::PointList::getViewPort() { + etk::Pair out(vec2(9999999999.0,9999999999.0),vec2(-9999999999.0,-9999999999.0)); for (auto &it : m_data) { for (auto &it2 : it) { out.first.setMin(it2.m_pos); diff --git a/esvg/render/PointList.hpp b/esvg/render/PointList.hpp index 9a1348a..bf12396 100644 --- a/esvg/render/PointList.hpp +++ b/esvg/render/PointList.hpp @@ -15,13 +15,13 @@ namespace esvg { namespace render { class PointList { public: - std::vector> m_data; + etk::Vector> m_data; public: PointList(); - void addList(std::vector& _list); + void addList(etk::Vector& _list); void display(); void applyMatrix(const mat2x3& _transformationMatrix); - std::pair getViewPort(); + etk::Pair getViewPort(); }; } } diff --git a/esvg/render/Scanline.hpp b/esvg/render/Scanline.hpp index e8c3deb..3f8f9a6 100644 --- a/esvg/render/Scanline.hpp +++ b/esvg/render/Scanline.hpp @@ -12,7 +12,7 @@ namespace esvg { namespace render { class Scanline { private: - std::vector m_data; + etk::Vector m_data; public: // constructor : Scanline(size_t _size=32); diff --git a/esvg/render/Segment.cpp b/esvg/render/Segment.cpp index aa5b875..a47c210 100644 --- a/esvg/render/Segment.cpp +++ b/esvg/render/Segment.cpp @@ -7,6 +7,12 @@ #include #include +esvg::render::Segment::Segment() { + p0 = vec2(0,0); + p1 = vec2(0,0); + direction = 0; +} + esvg::render::Segment::Segment(const vec2& _p0, const vec2& _p1) { // segment register all time the lower at P0n then we need to register the sens of the path p0 = _p0; diff --git a/esvg/render/Segment.hpp b/esvg/render/Segment.hpp index d616b3f..46b6615 100644 --- a/esvg/render/Segment.hpp +++ b/esvg/render/Segment.hpp @@ -13,6 +13,8 @@ namespace esvg { namespace render { class Segment { public: + // TODO: Update etk::Vector to support not having it ... + Segment(); Segment(const vec2& _p0, const vec2& _p1); vec2 p0; vec2 p1; diff --git a/esvg/render/SegmentList.cpp b/esvg/render/SegmentList.cpp index 67a26f0..187c060 100644 --- a/esvg/render/SegmentList.cpp +++ b/esvg/render/SegmentList.cpp @@ -13,7 +13,7 @@ esvg::render::SegmentList::SegmentList() { } #ifdef DEBUG void esvg::render::SegmentList::addSegment(const vec2& _pos0, const vec2& _pos1) { - m_data.push_back(Segment(_pos0, _pos1)); + m_data.pushBack(Segment(_pos0, _pos1)); } #endif @@ -23,7 +23,7 @@ void esvg::render::SegmentList::addSegment(const esvg::render::Point& _pos0, con // remove /0 operation return; } - m_data.push_back(Segment(_pos0.m_pos, _pos1.m_pos)); + m_data.pushBack(Segment(_pos0.m_pos, _pos1.m_pos)); } void esvg::render::SegmentList::addSegment(const esvg::render::Point& _pos0, const esvg::render::Point& _pos1, bool _disableHorizontal) { @@ -33,11 +33,11 @@ void esvg::render::SegmentList::addSegment(const esvg::render::Point& _pos0, con // remove /0 operation return; } - m_data.push_back(Segment(_pos0.m_pos, _pos1.m_pos)); + m_data.pushBack(Segment(_pos0.m_pos, _pos1.m_pos)); } -std::pair esvg::render::SegmentList::getViewPort() { - std::pair out(vec2(9999999999.0,9999999999.0),vec2(-9999999999.0,-9999999999.0)); +etk::Pair esvg::render::SegmentList::getViewPort() { + etk::Pair out(vec2(9999999999.0,9999999999.0),vec2(-9999999999.0,-9999999999.0)); for (auto &it : m_data) { out.first.setMin(it.p0); out.second.setMax(it.p0); diff --git a/esvg/render/SegmentList.hpp b/esvg/render/SegmentList.hpp index 45ed0c7..e7e5d5d 100644 --- a/esvg/render/SegmentList.hpp +++ b/esvg/render/SegmentList.hpp @@ -16,7 +16,7 @@ namespace esvg { namespace render { class SegmentList { public: - std::vector m_data; + etk::Vector m_data; public: SegmentList(); #ifdef DEBUG @@ -43,7 +43,7 @@ namespace esvg { float _width, bool _isStart); public: - std::pair getViewPort(); + etk::Pair getViewPort(); void applyMatrix(const mat2x3& _transformationMatrix); }; } diff --git a/esvg/render/Weight.cpp b/esvg/render/Weight.cpp index 7dc6fbc..584cf34 100644 --- a/esvg/render/Weight.cpp +++ b/esvg/render/Weight.cpp @@ -82,7 +82,7 @@ void esvg::render::Weight::append(int32_t _posY, const esvg::render::Scanline& _ } } -bool sortXPosFunction(const std::pair& _e1, const std::pair& _e2) { +bool sortXPosFunction(const etk::Pair& _e1, const etk::Pair& _e2) { return _e1.first < _e2.first; } @@ -93,11 +93,11 @@ void esvg::render::Weight::generate(ivec2 _size, int32_t _subSamplingCount, cons for (int32_t yyy=0; yyy<_size.y(); ++yyy) { ESVG_VERBOSE("Weighting ... " << yyy << " / " << _size.y()); // Reduce the number of lines in the subsampling parsing: - std::vector availlableSegmentPixel; + etk::Vector availlableSegmentPixel; for (auto &it : _listSegment.m_data) { if ( it.p0.y() < float(yyy+1) && it.p1.y() > float(yyy)) { - availlableSegmentPixel.push_back(it); + availlableSegmentPixel.pushBack(it); } } if (availlableSegmentPixel.size() == 0) { @@ -111,7 +111,7 @@ void esvg::render::Weight::generate(ivec2 _size, int32_t _subSamplingCount, cons Scanline scanline(_size.x()); //find all the segment that cross the middle of the line of the center of the pixel line: float subSamplingCenterPos = yyy + deltaSize*0.5f + deltaSize*kkk; - std::vector availlableSegment; + etk::Vector availlableSegment; // find in the subList ... for (auto &it : availlableSegmentPixel) { if ( it.p0.y() <= subSamplingCenterPos @@ -122,7 +122,7 @@ void esvg::render::Weight::generate(ivec2 _size, int32_t _subSamplingCount, cons && availlableSegment.back().direction == it.direction) { // we not add this point in this case to prevent double count of the same point. } else { - availlableSegment.push_back(it); + availlableSegment.pushBack(it); } } } @@ -134,18 +134,18 @@ void esvg::render::Weight::generate(ivec2 _size, int32_t _subSamplingCount, cons ESVG_VERBOSE(" Availlable Segment " << it.p0 << " -> " << it.p1 << " dir=" << it.direction); } // x position, angle - std::vector> listPosition; + etk::Vector> listPosition; for (auto &it : availlableSegment) { vec2 delta = it.p0 - it.p1; // x = coefficent*y+bbb; float coefficient = delta.x()/delta.y(); float bbb = it.p0.x() - coefficient*it.p0.y(); float xpos = coefficient * subSamplingCenterPos + bbb; - listPosition.push_back(std::pair(xpos, it.direction)); + listPosition.pushBack(etk::Pair(xpos, it.direction)); } ESVG_VERBOSE(" List position " << listPosition.size()); // now we order position of the xPosition: - std::sort(listPosition.begin(), listPosition.end(), sortXPosFunction); + listPosition.sort(0, listPosition.size(), sortXPosFunction); // move through all element in the point: int32_t lastState = 0; float currentValue = 0.0f; @@ -160,9 +160,9 @@ void esvg::render::Weight::generate(ivec2 _size, int32_t _subSamplingCount, cons if (currentPos != int32_t(it.first)) { // fill to the new pos -1: #if __CPP_VERSION__ >= 2011 && !defined(__TARGET_OS__MacOs) && !defined(__TARGET_OS__IOs) - float endValue = float(std::min(1,std::abs(lastState))) * deltaSize; + float endValue = float(etk::min(1,std::abs(lastState))) * deltaSize; #else - float endValue = float(std::min(1,abs(lastState))) * deltaSize; + float endValue = float(etk::min(1,abs(lastState))) * deltaSize; #endif for (int32_t iii=currentPos+1; iii m_data; + etk::Vector m_data; public: // constructor : Weight(); diff --git a/esvg/spreadMethod.cpp b/esvg/spreadMethod.cpp index a59e96b..bd97c1a 100644 --- a/esvg/spreadMethod.cpp +++ b/esvg/spreadMethod.cpp @@ -13,7 +13,7 @@ static const char* values[] = { "repeat" }; -std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::spreadMethod _obj) { +etk::Stream& esvg::operator <<(etk::Stream& _os, enum esvg::spreadMethod _obj) { _os << values[_obj]; return _os; } diff --git a/esvg/spreadMethod.hpp b/esvg/spreadMethod.hpp index 47d12a4..5548633 100644 --- a/esvg/spreadMethod.hpp +++ b/esvg/spreadMethod.hpp @@ -16,7 +16,7 @@ namespace esvg { /** * @brief Debug operator To display the curent element in a Human redeable information */ - std::ostream& operator <<(std::ostream& _os, enum esvg::spreadMethod _obj); + etk::Stream& operator <<(etk::Stream& _os, enum esvg::spreadMethod _obj); } diff --git a/test/main.cpp b/test/main.cpp index 7c62bb3..821102f 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include @@ -18,7 +18,7 @@ int main(int _argc, const char *_argv[]) { ::testing::InitGoogleTest(&_argc, const_cast(_argv)); etk::init(_argc, _argv); for (int32_t iii=0; iii<_argc ; ++iii) { - std::string data = _argv[iii]; + etk::String data = _argv[iii]; #ifdef DEBUG if (data == "--visual-test") { TEST_PRINT("visual-test=enable"); diff --git a/test/testCap.cpp b/test/testCap.cpp index 72d148e..0559bfb 100644 --- a/test/testCap.cpp +++ b/test/testCap.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestCap, butt) { - std::string data("" + etk::String data("" "" " " " " @@ -23,7 +23,7 @@ TEST(TestCap, butt) { } TEST(TestCap, round) { - std::string data("" + etk::String data("" "" " " " " @@ -35,7 +35,7 @@ TEST(TestCap, round) { } TEST(TestCap, square) { - std::string data("" + etk::String data("" "" " " " " @@ -48,7 +48,7 @@ TEST(TestCap, square) { TEST(TestCap, buttVert) { - std::string data("" + etk::String data("" "" " " " " @@ -60,7 +60,7 @@ TEST(TestCap, buttVert) { } TEST(TestCap, roundVert) { - std::string data("" + etk::String data("" "" " " " " @@ -72,7 +72,7 @@ TEST(TestCap, roundVert) { } TEST(TestCap, squareVert) { - std::string data("" + etk::String data("" "" " " " " @@ -86,7 +86,7 @@ TEST(TestCap, squareVert) { TEST(TestCap, buttDiag1) { - std::string data("" + etk::String data("" "" " " " " @@ -98,7 +98,7 @@ TEST(TestCap, buttDiag1) { } TEST(TestCap, roundDiag1) { - std::string data("" + etk::String data("" "" " " " " @@ -110,7 +110,7 @@ TEST(TestCap, roundDiag1) { } TEST(TestCap, squareDiag1) { - std::string data("" + etk::String data("" "" " " " " @@ -123,7 +123,7 @@ TEST(TestCap, squareDiag1) { TEST(TestCap, buttDiag2) { - std::string data("" + etk::String data("" "" " " " " @@ -135,7 +135,7 @@ TEST(TestCap, buttDiag2) { } TEST(TestCap, roundDiag2) { - std::string data("" + etk::String data("" "" " " " " @@ -147,7 +147,7 @@ TEST(TestCap, roundDiag2) { } TEST(TestCap, squareDiag2) { - std::string data("" + etk::String data("" "" " " " " diff --git a/test/testCircle.cpp b/test/testCircle.cpp index 7e070da..77bb5bc 100644 --- a/test/testCircle.cpp +++ b/test/testCircle.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestCircle, fill) { - std::string data("" + etk::String data("" "" " " ""); @@ -22,7 +22,7 @@ TEST(TestCircle, fill) { } TEST(TestCircle, stroke) { - std::string data("" + etk::String data("" "" " " ""); @@ -33,7 +33,7 @@ TEST(TestCircle, stroke) { } TEST(TestCircle, fill_and_stroke) { - std::string data("" + etk::String data("" "" " " ""); diff --git a/test/testColor.cpp b/test/testColor.cpp index a5986dc..90f7dce 100644 --- a/test/testColor.cpp +++ b/test/testColor.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestColor, blending) { - std::string data("" + etk::String data("" "" " " ""); @@ -22,7 +22,7 @@ TEST(TestColor, blending) { } TEST(TestColor, opacity) { - std::string data("" + etk::String data("" "" " " ""); @@ -33,7 +33,7 @@ TEST(TestColor, opacity) { } TEST(TestColor, blending_and_opacity) { - std::string data("" + etk::String data("" "" " " ""); @@ -44,7 +44,7 @@ TEST(TestColor, blending_and_opacity) { } TEST(TestColor, multiple_layer) { - std::string data("" + etk::String data("" "" " " " " diff --git a/test/testEllipse.cpp b/test/testEllipse.cpp index fff7d7d..1e8c4f3 100644 --- a/test/testEllipse.cpp +++ b/test/testEllipse.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestEllipse, fill) { - std::string data("" + etk::String data("" "" " " ""); @@ -22,7 +22,7 @@ TEST(TestEllipse, fill) { } TEST(TestEllipse, stroke) { - std::string data("" + etk::String data("" "" " " ""); @@ -33,7 +33,7 @@ TEST(TestEllipse, stroke) { } TEST(TestEllipse, fill_and_stroke) { - std::string data("" + etk::String data("" "" " " ""); diff --git a/test/testGradientLinear.cpp b/test/testGradientLinear.cpp index 8c4d572..b7d4759 100644 --- a/test/testGradientLinear.cpp +++ b/test/testGradientLinear.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestGradientLinear, horizontal) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -31,7 +31,7 @@ TEST(TestGradientLinear, horizontal) { TEST(TestGradientLinear, vertical) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -50,7 +50,7 @@ TEST(TestGradientLinear, vertical) { } TEST(TestGradientLinear, diag1) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -69,7 +69,7 @@ TEST(TestGradientLinear, diag1) { } TEST(TestGradientLinear, diag1Partiel) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -86,7 +86,7 @@ TEST(TestGradientLinear, diag1Partiel) { } TEST(TestGradientLinear, diag2) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -107,7 +107,7 @@ TEST(TestGradientLinear, diag2) { TEST(TestGradientLinear, diag2Rotate0) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -126,7 +126,7 @@ TEST(TestGradientLinear, diag2Rotate0) { } TEST(TestGradientLinear, diag2Rotate1) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -145,7 +145,7 @@ TEST(TestGradientLinear, diag2Rotate1) { } TEST(TestGradientLinear, diag2Rotate2) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -164,7 +164,7 @@ TEST(TestGradientLinear, diag2Rotate2) { } TEST(TestGradientLinear, diag2scale) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -183,7 +183,7 @@ TEST(TestGradientLinear, diag2scale) { } TEST(TestGradientLinear, internalHref) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -204,7 +204,7 @@ TEST(TestGradientLinear, internalHref) { TEST(TestGradientLinear, unitBox_spreadNone) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -221,7 +221,7 @@ TEST(TestGradientLinear, unitBox_spreadNone) { } TEST(TestGradientLinear, unitBox_spreadPad) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -239,7 +239,7 @@ TEST(TestGradientLinear, unitBox_spreadPad) { TEST(TestGradientLinear, unitBox_spreadReflect) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -257,7 +257,7 @@ TEST(TestGradientLinear, unitBox_spreadReflect) { TEST(TestGradientLinear, unitBox_spreadRepeat) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -274,7 +274,7 @@ TEST(TestGradientLinear, unitBox_spreadRepeat) { } TEST(TestGradientLinear, unitUser_spreadNone) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -291,7 +291,7 @@ TEST(TestGradientLinear, unitUser_spreadNone) { } TEST(TestGradientLinear, unitUser_spreadPad) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -309,7 +309,7 @@ TEST(TestGradientLinear, unitUser_spreadPad) { TEST(TestGradientLinear, unitUser_spreadReflect) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -327,7 +327,7 @@ TEST(TestGradientLinear, unitUser_spreadReflect) { TEST(TestGradientLinear, unitUser_spreadRepeate) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" diff --git a/test/testGradientRadial.cpp b/test/testGradientRadial.cpp index 326561d..d75fb10 100644 --- a/test/testGradientRadial.cpp +++ b/test/testGradientRadial.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestGradientRadial, circle) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -31,7 +31,7 @@ TEST(TestGradientRadial, circle) { TEST(TestGradientRadial, full) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -51,7 +51,7 @@ TEST(TestGradientRadial, full) { TEST(TestGradientRadial, partial) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -70,7 +70,7 @@ TEST(TestGradientRadial, partial) { } TEST(TestGradientRadial, unitBox_spreadNone) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -89,7 +89,7 @@ TEST(TestGradientRadial, unitBox_spreadNone) { } TEST(TestGradientRadial, unitBox_spreadPad) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -108,7 +108,7 @@ TEST(TestGradientRadial, unitBox_spreadPad) { } TEST(TestGradientRadial, unitBox_spreadReflect) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -128,7 +128,7 @@ TEST(TestGradientRadial, unitBox_spreadReflect) { TEST(TestGradientRadial, unitBox_spreadRepeat) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -148,7 +148,7 @@ TEST(TestGradientRadial, unitBox_spreadRepeat) { TEST(TestGradientRadial, unitUser_spreadNone) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -167,7 +167,7 @@ TEST(TestGradientRadial, unitUser_spreadNone) { } TEST(TestGradientRadial, unitUser_spreadPad) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -186,7 +186,7 @@ TEST(TestGradientRadial, unitUser_spreadPad) { } TEST(TestGradientRadial, unitUser_spreadReflect) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -206,7 +206,7 @@ TEST(TestGradientRadial, unitUser_spreadReflect) { TEST(TestGradientRadial, unitUser_spreadRepeat) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -225,7 +225,7 @@ TEST(TestGradientRadial, unitUser_spreadRepeat) { } TEST(TestGradientRadial, unitUser_spreadPad_unCenter) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -244,7 +244,7 @@ TEST(TestGradientRadial, unitUser_spreadPad_unCenter) { } TEST(TestGradientRadial, unitUser_spreadReflect_unCenter) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -263,7 +263,7 @@ TEST(TestGradientRadial, unitUser_spreadReflect_unCenter) { } TEST(TestGradientRadial, unitUser_spreadRepeat_unCenter) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -282,7 +282,7 @@ TEST(TestGradientRadial, unitUser_spreadRepeat_unCenter) { } TEST(TestGradientRadial, unitUser_spreadRepeat_unCenter2) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" @@ -302,7 +302,7 @@ TEST(TestGradientRadial, unitUser_spreadRepeat_unCenter2) { TEST(TestGradientRadial, unitUser_spreadRepeat_out) { - std::string data("\n" + etk::String data("\n" "\n" " \n" " \n" diff --git a/test/testJoin.cpp b/test/testJoin.cpp index 269d3e7..f86ff1c 100644 --- a/test/testJoin.cpp +++ b/test/testJoin.cpp @@ -13,7 +13,7 @@ // ------------------------------------------------------ Miter test ----------------------------------------------------- TEST(TestJoin, miterRight1) { - std::string data("" + etk::String data("" "" " " ""); @@ -24,7 +24,7 @@ TEST(TestJoin, miterRight1) { } TEST(TestJoin, miterRight2) { - std::string data("" + etk::String data("" "" " " ""); @@ -35,7 +35,7 @@ TEST(TestJoin, miterRight2) { } TEST(TestJoin, miterRight3) { - std::string data("" + etk::String data("" "" " " ""); @@ -46,7 +46,7 @@ TEST(TestJoin, miterRight3) { } TEST(TestJoin, miterRight4) { - std::string data("" + etk::String data("" "" " " ""); @@ -57,7 +57,7 @@ TEST(TestJoin, miterRight4) { } TEST(TestJoin, miterLeft1) { - std::string data("" + etk::String data("" "" " " ""); @@ -68,7 +68,7 @@ TEST(TestJoin, miterLeft1) { } TEST(TestJoin, miterLeft2) { - std::string data("" + etk::String data("" "" " " ""); @@ -79,7 +79,7 @@ TEST(TestJoin, miterLeft2) { } TEST(TestJoin, miterLeft3) { - std::string data("" + etk::String data("" "" " " ""); @@ -90,7 +90,7 @@ TEST(TestJoin, miterLeft3) { } TEST(TestJoin, miterLeft4) { - std::string data("" + etk::String data("" "" " " ""); @@ -101,7 +101,7 @@ TEST(TestJoin, miterLeft4) { } TEST(TestJoin, miterLimit1) { - std::string data("" + etk::String data("" "" " " ""); @@ -112,7 +112,7 @@ TEST(TestJoin, miterLimit1) { } TEST(TestJoin, miterLimit2) { - std::string data("" + etk::String data("" "" " " ""); @@ -123,7 +123,7 @@ TEST(TestJoin, miterLimit2) { } TEST(TestJoin, miterLimit3) { - std::string data("" + etk::String data("" "" " " ""); @@ -134,7 +134,7 @@ TEST(TestJoin, miterLimit3) { } TEST(TestJoin, miterLimit4) { - std::string data("" + etk::String data("" "" " " ""); @@ -145,7 +145,7 @@ TEST(TestJoin, miterLimit4) { } TEST(TestJoin, miterCornerCasePath) { - std::string data("" + etk::String data("" "" " " + etk::String data("" "" " " + etk::String data("" "" " " ""); @@ -184,7 +184,7 @@ TEST(TestJoin, roundRight1) { } TEST(TestJoin, roundRight2) { - std::string data("" + etk::String data("" "" " " ""); @@ -195,7 +195,7 @@ TEST(TestJoin, roundRight2) { } TEST(TestJoin, roundRight3) { - std::string data("" + etk::String data("" "" " " ""); @@ -206,7 +206,7 @@ TEST(TestJoin, roundRight3) { } TEST(TestJoin, roundRight4) { - std::string data("" + etk::String data("" "" " " ""); @@ -217,7 +217,7 @@ TEST(TestJoin, roundRight4) { } TEST(TestJoin, roundLeft1) { - std::string data("" + etk::String data("" "" " " ""); @@ -228,7 +228,7 @@ TEST(TestJoin, roundLeft1) { } TEST(TestJoin, roundLeft2) { - std::string data("" + etk::String data("" "" " " ""); @@ -239,7 +239,7 @@ TEST(TestJoin, roundLeft2) { } TEST(TestJoin, roundLeft3) { - std::string data("" + etk::String data("" "" " " ""); @@ -250,7 +250,7 @@ TEST(TestJoin, roundLeft3) { } TEST(TestJoin, roundLeft4) { - std::string data("" + etk::String data("" "" " " ""); @@ -261,7 +261,7 @@ TEST(TestJoin, roundLeft4) { } TEST(TestJoin, roundCornerCasePath) { - std::string data("" + etk::String data("" "" " " + etk::String data("" "" " " ""); @@ -288,7 +288,7 @@ TEST(TestJoin, bevelRight1) { } TEST(TestJoin, bevelRight2) { - std::string data("" + etk::String data("" "" " " ""); @@ -299,7 +299,7 @@ TEST(TestJoin, bevelRight2) { } TEST(TestJoin, bevelRight3) { - std::string data("" + etk::String data("" "" " " ""); @@ -310,7 +310,7 @@ TEST(TestJoin, bevelRight3) { } TEST(TestJoin, bevelRight4) { - std::string data("" + etk::String data("" "" " " ""); @@ -321,7 +321,7 @@ TEST(TestJoin, bevelRight4) { } TEST(TestJoin, bevelLeft1) { - std::string data("" + etk::String data("" "" " " ""); @@ -332,7 +332,7 @@ TEST(TestJoin, bevelLeft1) { } TEST(TestJoin, bevelLeft2) { - std::string data("" + etk::String data("" "" " " ""); @@ -343,7 +343,7 @@ TEST(TestJoin, bevelLeft2) { } TEST(TestJoin, bevelLeft3) { - std::string data("" + etk::String data("" "" " " ""); @@ -354,7 +354,7 @@ TEST(TestJoin, bevelLeft3) { } TEST(TestJoin, bevelLeft4) { - std::string data("" + etk::String data("" "" " " ""); @@ -365,7 +365,7 @@ TEST(TestJoin, bevelLeft4) { } TEST(TestJoin, bevelCornerCasePath) { - std::string data("" + etk::String data("" "" " " + etk::String data("" "" " " ""); diff --git a/test/testPath.cpp b/test/testPath.cpp index c5bef27..21466b7 100644 --- a/test/testPath.cpp +++ b/test/testPath.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestPath, fill) { - std::string data("" + etk::String data("" "" " " @@ -23,7 +23,7 @@ TEST(TestPath, fill) { } TEST(TestPath, stroke) { - std::string data("" + etk::String data("" "" " " @@ -35,7 +35,7 @@ TEST(TestPath, stroke) { } TEST(TestPath, fill_and_stroke) { - std::string data("" + etk::String data("" "" " " @@ -47,7 +47,7 @@ TEST(TestPath, fill_and_stroke) { } TEST(TestPath, curveTo) { - std::string data("" + etk::String data("" "" " " @@ -61,7 +61,7 @@ TEST(TestPath, curveTo) { TEST(TestPath, smoothCurveTo) { - std::string data("" + etk::String data("" "" " " @@ -75,7 +75,7 @@ TEST(TestPath, smoothCurveTo) { TEST(TestPath, bezierCurveTo) { - std::string data("" + etk::String data("" "" " " @@ -89,7 +89,7 @@ TEST(TestPath, bezierCurveTo) { TEST(TestPath, bezierSmoothCurveTo) { - std::string data("" + etk::String data("" "" " " @@ -101,7 +101,7 @@ TEST(TestPath, bezierSmoothCurveTo) { } TEST(TestPath, arc) { - std::string data("" + etk::String data("" "" " " + etk::String data("" "" " " + etk::String data("" "" " " ""); @@ -22,7 +22,7 @@ TEST(TestPolygon, fill) { } TEST(TestPolygon, stroke) { - std::string data("" + etk::String data("" "" " " ""); @@ -33,7 +33,7 @@ TEST(TestPolygon, stroke) { } TEST(TestPolygon, fill_and_stroke) { - std::string data("" + etk::String data("" "" " " ""); diff --git a/test/testPolyline.cpp b/test/testPolyline.cpp index 1b77ac0..e75404a 100644 --- a/test/testPolyline.cpp +++ b/test/testPolyline.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestPolyLine, fill) { - std::string data("" + etk::String data("" "" " " ""); @@ -22,7 +22,7 @@ TEST(TestPolyLine, fill) { } TEST(TestPolyLine, stroke) { - std::string data("" + etk::String data("" "" " " ""); @@ -33,7 +33,7 @@ TEST(TestPolyLine, stroke) { } TEST(TestPolyLine, fill_and_stroke) { - std::string data("" + etk::String data("" "" " " ""); diff --git a/test/testRectangle.cpp b/test/testRectangle.cpp index 7619e12..ac8d0a9 100644 --- a/test/testRectangle.cpp +++ b/test/testRectangle.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestRectangle, fill) { - std::string data("" + etk::String data("" "" " " ""); @@ -22,7 +22,7 @@ TEST(TestRectangle, fill) { } TEST(TestRectangle, stroke) { - std::string data("" + etk::String data("" "" " " ""); @@ -33,7 +33,7 @@ TEST(TestRectangle, stroke) { } TEST(TestRectangle, fill_and_stroke) { - std::string data("" + etk::String data("" "" " " ""); @@ -44,7 +44,7 @@ TEST(TestRectangle, fill_and_stroke) { } TEST(TestRectangle, corned_fill) { - std::string data("" + etk::String data("" "" " " ""); @@ -55,7 +55,7 @@ TEST(TestRectangle, corned_fill) { } TEST(TestRectangle, corned_stroke) { - std::string data("" + etk::String data("" "" " " ""); @@ -66,7 +66,7 @@ TEST(TestRectangle, corned_stroke) { } TEST(TestRectangle, corned_fill_and_stroke) { - std::string data("" + etk::String data("" "" " " ""); diff --git a/test/testStyle.cpp b/test/testStyle.cpp index 8f40777..ad7ab72 100644 --- a/test/testStyle.cpp +++ b/test/testStyle.cpp @@ -11,7 +11,7 @@ #include "main.hpp" TEST(TestExtern, worddown) { - std::string data("\n" + etk::String data("\n" "\n" "\n" " -#include +#include #include #include @@ -21,12 +21,12 @@ static void usage() { int main(int _argc, const char *_argv[]) { etk::init(_argc, _argv); - std::string inputFile; + etk::String inputFile; bool visualTest = false; for (int32_t iii=0; iii<_argc ; ++iii) { - std::string data = _argv[iii]; + etk::String data = _argv[iii]; if (etk::start_with(data, "--file=") == true) { - inputFile = std::string(&data[7]); + inputFile = etk::String(&data[7]); TEST_PRINT("file='" << inputFile << "'"); } else if (data == "--visual") { visualTest = true;