From fbc979aab5cb54214e47387af8060711d3e9afcb Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 28 Aug 2017 00:03:33 +0200 Subject: [PATCH] [DEV] continue removing stl --- ege/Component.cpp | 4 +- ege/Component.hpp | 2 +- ege/Engine.cpp | 4 +- ege/Engine.hpp | 2 +- ege/Entity.cpp | 42 ++++---- ege/Entity.hpp | 10 +- ege/Environement.cpp | 36 +++---- ege/Environement.hpp | 50 ++++----- ege/Light.cpp | 4 +- ege/Light.hpp | 6 +- ege/Material.cpp | 4 +- ege/Material.hpp | 6 +- ege/Ray.cpp | 2 +- ege/Ray.hpp | 2 +- ege/camera/View.cpp | 26 ++--- ege/elements/ElementBase.cpp | 2 +- ege/elements/ElementBase.hpp | 2 +- ege/elements/ElementPhysic.cpp | 6 +- ege/elements/ElementPhysic.hpp | 6 +- ege/ia/Component.cpp | 4 +- ege/ia/Component.hpp | 2 +- ege/ia/Engine.cpp | 4 +- ege/ia/Engine.hpp | 4 +- ege/particule/Component.cpp | 4 +- ege/particule/Component.hpp | 2 +- ege/particule/Engine.cpp | 8 +- ege/particule/Engine.hpp | 8 +- ege/physics/Component.cpp | 28 ++--- ege/physics/Component.hpp | 12 +-- ege/physics/Engine.cpp | 20 ++-- ege/physics/Engine.hpp | 10 +- ege/physics/shape/Concave.hpp | 14 +-- ege/physics/shape/ConvexHull.cpp | 4 +- ege/physics/shape/ConvexHull.hpp | 4 +- ege/physics/shape/Shape.cpp | 4 +- ege/physics/shape/Shape.hpp | 2 +- ege/position/Component.cpp | 4 +- ege/position/Component.hpp | 2 +- ege/render/Component.cpp | 8 +- ege/render/Component.hpp | 6 +- ege/render/Engine.cpp | 12 +-- ege/render/Engine.hpp | 10 +- ege/resource/Mesh.cpp | 100 ++++++++--------- ege/resource/Mesh.hpp | 78 +++++++------- ege/resource/MeshCapsule.cpp | 2 +- ege/resource/MeshCone.cpp | 2 +- ege/resource/MeshCube.cpp | 4 +- ege/resource/MeshCylinder.cpp | 2 +- ege/resource/MeshEmf.cpp | 16 +-- ege/resource/MeshGird.cpp | 14 +-- ege/resource/MeshObj.cpp | 12 +-- ege/resource/MeshSphere.cpp | 2 +- ege/resource/ParticuleMesh.cpp | 20 ++-- ege/resource/ParticuleMesh.hpp | 2 +- ege/resource/tools/FaceIndexing.hpp | 4 +- ege/resource/tools/icoSphere.cpp | 102 +++++++++--------- ege/resource/tools/icoSphere.hpp | 4 +- ege/resource/tools/isoSphere.cpp | 14 +-- ege/resource/tools/isoSphere.hpp | 4 +- ege/resource/tools/viewBox.cpp | 68 ++++++------ ege/resource/tools/viewBox.hpp | 4 +- ege/widget/Mesh.cpp | 2 +- ege/widget/Mesh.hpp | 4 +- ege/widget/Scene.cpp | 4 +- ege/widget/Scene.hpp | 10 +- sample/CameraPosition/appl/main.cpp | 2 +- .../lutin_ege-sample-camera-position.py | 2 +- sample/Collision/appl/main.cpp | 2 +- .../Collision/lutin_ege-sample-collision.py | 2 +- sample/DoubleView/appl/main.cpp | 2 +- .../lutin_ege-sample-double-view.py | 2 +- sample/LowPoly/appl/main.cpp | 2 +- sample/LowPoly/lutin_ege-sample-low-poly.py | 2 +- sample/MeshCreator/appl/Windows.cpp | 2 +- sample/MeshCreator/appl/Windows.hpp | 2 +- sample/MeshCreator/appl/main.cpp | 4 +- .../lutin_ege-sample-mesh-creator.py | 2 +- sample/RayTest/appl/Windows.cpp | 20 ++-- sample/RayTest/appl/Windows.hpp | 4 +- sample/RayTest/appl/main.cpp | 2 +- sample/RayTest/lutin_ege-sample-raytracing.py | 2 +- sample/TorqueApply/appl/main.cpp | 2 +- .../lutin_ege-sample-torque-apply.py | 2 +- 83 files changed, 462 insertions(+), 462 deletions(-) diff --git a/ege/Component.cpp b/ege/Component.cpp index 14f7fe6..bb50261 100644 --- a/ege/Component.cpp +++ b/ege/Component.cpp @@ -5,8 +5,8 @@ */ #include -const std::string& ege::Component::getType() const { - static std::string tmp("component"); +const etk::String& ege::Component::getType() const { + static etk::String tmp("component"); return tmp; } diff --git a/ege/Component.hpp b/ege/Component.hpp index 2870ade..d7dfc75 100644 --- a/ege/Component.hpp +++ b/ege/Component.hpp @@ -15,7 +15,7 @@ namespace ege { protected: public: - virtual const std::string& getType() const; + virtual const etk::String& getType() const; /** * @brief Evironement notify that a new component is added on the same Element diff --git a/ege/Engine.cpp b/ege/Engine.cpp index d6ea125..59fdff1 100644 --- a/ege/Engine.cpp +++ b/ege/Engine.cpp @@ -11,8 +11,8 @@ ege::Engine::Engine(ege::Environement* _env) : } -const std::string& ege::Engine::getType() const { - static std::string tmp("engine"); +const etk::String& ege::Engine::getType() const { + static etk::String tmp("engine"); return tmp; } diff --git a/ege/Engine.hpp b/ege/Engine.hpp index b643c0f..debff19 100644 --- a/ege/Engine.hpp +++ b/ege/Engine.hpp @@ -29,7 +29,7 @@ namespace ege { * @brief get the type of the engine * @return the type in string */ - virtual const std::string& getType() const; + virtual const etk::String& getType() const; /** * @brief An ege::Entity component has been removed ==> need remove it in local if needed * @param[in] _ref Referrence on the component diff --git a/ege/Entity.cpp b/ege/Entity.cpp index ecdf489..aff5133 100644 --- a/ege/Entity.cpp +++ b/ege/Entity.cpp @@ -10,8 +10,8 @@ #include -const std::string& ege::Entity::getType() const { - static const std::string nameType("----"); +const etk::String& ege::Entity::getType() const { + static const etk::String nameType("----"); return nameType; } @@ -67,7 +67,7 @@ void ege::Entity::addComponent(const ememory::SharedPtr& _ref) { // add it at the end ... if (findId == -1) { findId = m_component.size(); - m_component.push_back(_ref); + m_component.pushBack(_ref); } for (size_t iii=0; iii& _ref) { } } -void ege::Entity::rmComponent(const std::string& _type) { +void ege::Entity::rmComponent(const etk::String& _type) { int32_t findId = -1; ememory::SharedPtr componentRemoved; // check if not exist @@ -159,7 +159,7 @@ bool ege::Entity::init() { EGE_WARNING("init() not implemented: uId=" << m_uID); return false; } -bool ege::Entity::initString(const std::string& _description) { +bool ege::Entity::initString(const etk::String& _description) { EGE_WARNING("String Init not implemented: uId=" << m_uID); return false; } @@ -191,7 +191,7 @@ float ege::Entity::getLifeRatio() { void ege::Entity::setFireOn(int32_t _groupIdSource, int32_t _type, float _power, const vec3& _center) { float previousLife = m_life; m_life += _power; - m_life = std::avg(0.0f, m_life, m_lifeMax); + m_life = etk::avg(0.0f, m_life, m_lifeMax); if (m_life <= 0) { EGE_DEBUG("[" << getUID() << "] Entity is killed ..." << getType()); } @@ -218,23 +218,23 @@ void ege::Entity::drawLife(ememory::SharedPtr _ mat4 transformationMatrix = etk::matTranslate(getPosition()) * etk::matRotate(vec3(0,0,1),_camera.getAngleZ()) * etk::matRotate(vec3(1,0,0),(M_PI/2.0f-_camera.getAngleTeta())); - std::vector localVertices; - localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0)); - localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); - localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); - localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0)); - localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); - localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos -lifeBorder,0)); + etk::Vector localVertices; + localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0)); + localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); + localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); + localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0)); + localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); + localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos -lifeBorder,0)); etk::Color myColor(0x0000FF99); _draw->draw(localVertices, myColor, transformationMatrix, false, false); localVertices.clear(); /** Bounding box == > model shape **/ - localVertices.push_back(vec3(-lifeWidth/2.0 ,lifeYPos,0)); - localVertices.push_back(vec3(-lifeWidth/2.0 ,lifeYPos + lifeHeight,0)); - localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0)); - localVertices.push_back(vec3(-lifeWidth/2.0 ,lifeYPos,0)); - localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0)); - localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos,0)); + localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos,0)); + localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos + lifeHeight,0)); + localVertices.pushBack(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0)); + localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos,0)); + localVertices.pushBack(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0)); + localVertices.pushBack(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos,0)); myColor =0x00FF00FF; if (ratio < 0.2f) { myColor = 0xFF0000FF; @@ -253,9 +253,9 @@ void ege::Entity::drawDebug(ememory::SharedPtr m_debugText.setPos(vec3(-20,32,0)); m_debugText.print(getType()); m_debugText.setPos(vec3(-20,20,0)); - m_debugText.print("life=("+etk::to_string(getLifeRatio())); + m_debugText.print("life=("+etk::toString(getLifeRatio())); */ - //m_debugText.print(std::string("Axe=(")+std::string(m_tmpAxe.x())+std::string(",")+etk::UString(m_tmpAxe.y())+etk::UString(",")+etk::UString(m_tmpAxe.z())+etk::UString(")")); + //m_debugText.print(etk::String("Axe=(")+etk::String(m_tmpAxe.x())+etk::String(",")+etk::UString(m_tmpAxe.y())+etk::UString(",")+etk::UString(m_tmpAxe.z())+etk::UString(")")); /* // TODO : Keep this it can be usefull to print something in direction of the camera ... m_debugText.draw( etk::matTranslate(getPosition()) diff --git a/ege/Entity.hpp b/ege/Entity.hpp index 10bee20..ae13b9e 100644 --- a/ege/Entity.hpp +++ b/ege/Entity.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -41,17 +41,17 @@ namespace ege { */ virtual ~Entity(); protected: - std::vector> m_component; + etk::Vector> m_component; public: void addComponent(const ememory::SharedPtr& _ref); void rmComponent(const ememory::SharedPtr& _ref); - void rmComponent(const std::string& _type); + void rmComponent(const etk::String& _type); /** * @brief get the Entity Type description string. * @return A reference on the descriptive string. */ - virtual const std::string& getType() const; + virtual const etk::String& getType() const; /** * @brief init the Entity with the defined properties * @param[in] _property Type of the next Entity @@ -59,7 +59,7 @@ namespace ege { * @return true, the Entity is corectly initialized. */ virtual bool init(); - virtual bool initString(const std::string& _description); + virtual bool initString(const etk::String& _description); virtual bool initXML(const exml::Node& _node); virtual bool initJSON(const ejson::Value& _value); virtual bool initVoid(void* _value); diff --git a/ege/Environement.cpp b/ege/Environement.cpp index ab9f75b..a9871e2 100644 --- a/ege/Environement.cpp +++ b/ege/Environement.cpp @@ -42,7 +42,7 @@ void ege::Environement::addEngine(const ememory::SharedPtr& _ref) { return; } // add it at the end ... - m_engine.push_back(_ref); + m_engine.pushBack(_ref); } void ege::Environement::rmEngine(const ememory::SharedPtr& _ref) { @@ -63,7 +63,7 @@ void ege::Environement::rmEngine(const ememory::SharedPtr& _ref) { EGE_ERROR("try to remove an unexisting engine"); } -void ege::Environement::rmEngine(const std::string& _type) { +void ege::Environement::rmEngine(const etk::String& _type) { // check if not exist for (auto &it: m_engine) { if (it == nullptr) { @@ -78,7 +78,7 @@ void ege::Environement::rmEngine(const std::string& _type) { return; } -ememory::SharedPtr ege::Environement::getEngine(const std::string& _type) { +ememory::SharedPtr ege::Environement::getEngine(const etk::String& _type) { // check if not exist for (auto &it: m_engine) { if (it == nullptr) { @@ -149,7 +149,7 @@ ememory::SharedPtr ege::Environement::getEntityNearest(ememory::Sha void ege::Environement::getEntityNearest(const vec3& _sourcePosition, float _distanceMax, - std::vector& _resultList) { + etk::Vector& _resultList) { _resultList.clear(); ege::Environement::ResultNearestEntity result; result.dist = 99999999999.0f; @@ -168,14 +168,14 @@ void ege::Environement::getEntityNearest(const vec3& _sourcePosition, result.dist = (_sourcePosition - destPosition).length(); //EGE_DEBUG("Distance : " << _distance << " >? " << distance << " id=" << iii); if (_distanceMax>result.dist) { - _resultList.push_back(result); + _resultList.pushBack(result); } } } void ege::Environement::getEntityNearestFixed(const vec3& _sourcePosition, float _distanceMax, - std::vector& _resultList) { + etk::Vector& _resultList) { _resultList.clear(); ege::Environement::ResultNearestEntity result; result.dist = 99999999999.0f; @@ -206,7 +206,7 @@ void ege::Environement::getEntityNearestFixed(const vec3& _sourcePosition, } // add entity at the end : if (jjj >= _resultList.size()) { - _resultList.push_back(result); + _resultList.pushBack(result); } } } @@ -217,7 +217,7 @@ static etk::Hash& getHachTableCreating() { return s_table; } -void ege::Environement::addCreator(const std::string& _type, ege::createEntity_tf _creator) { +void ege::Environement::addCreator(const etk::String& _type, ege::createEntity_tf _creator) { if (_creator == nullptr) { EGE_ERROR("Try to add an empty CREATOR ..."); return; @@ -228,7 +228,7 @@ void ege::Environement::addCreator(const std::string& _type, ege::createEntity_t } -ememory::SharedPtr ege::Environement::createEntity(const std::string& _type, const std::string& _description, bool _autoAddEntity) { +ememory::SharedPtr ege::Environement::createEntity(const etk::String& _type, const etk::String& _description, bool _autoAddEntity) { if (getHachTableCreating().exist(_type) == false) { EGE_ERROR("Request creating of an type that is not known '" << _type << "'"); return nullptr; @@ -253,7 +253,7 @@ ememory::SharedPtr ege::Environement::createEntity(const std::strin return tmpEntity; } -ememory::SharedPtr ege::Environement::createEntity(const std::string& _type, const ejson::Value& _value, bool _autoAddEntity) { +ememory::SharedPtr ege::Environement::createEntity(const etk::String& _type, const ejson::Value& _value, bool _autoAddEntity) { if (getHachTableCreating().exist(_type) == false) { EGE_ERROR("Request creating of an type that is not known '" << _type << "'"); return nullptr; @@ -278,7 +278,7 @@ ememory::SharedPtr ege::Environement::createEntity(const std::strin return tmpEntity; } -ememory::SharedPtr ege::Environement::createEntity(const std::string& _type, const exml::Node& _node, bool _autoAddEntity) { +ememory::SharedPtr ege::Environement::createEntity(const etk::String& _type, const exml::Node& _node, bool _autoAddEntity) { if (getHachTableCreating().exist(_type) == false) { EGE_ERROR("Request creating of an type that is not known '" << _type << "'"); return nullptr; @@ -303,7 +303,7 @@ ememory::SharedPtr ege::Environement::createEntity(const std::strin return tmpEntity; } -ememory::SharedPtr ege::Environement::createEntity(const std::string& _type, void* _data, bool _autoAddEntity) { +ememory::SharedPtr ege::Environement::createEntity(const etk::String& _type, void* _data, bool _autoAddEntity) { if (getHachTableCreating().exist(_type) == false) { EGE_ERROR("Request creating of an type that is not known '" << _type << "'"); return nullptr; @@ -328,7 +328,7 @@ ememory::SharedPtr ege::Environement::createEntity(const std::strin return tmpEntity; } -ememory::SharedPtr ege::Environement::createEntity(const std::string& _type, bool _autoAddEntity) { +ememory::SharedPtr ege::Environement::createEntity(const etk::String& _type, bool _autoAddEntity) { if (getHachTableCreating().exist(_type) == false) { EGE_ERROR("Request creating of an type that is not known '" << _type << "'"); return nullptr; @@ -365,7 +365,7 @@ void ege::Environement::addEntity(ememory::SharedPtr _newEntity) { return; } } - m_listEntity.push_back(_newEntity); + m_listEntity.pushBack(_newEntity); _newEntity->dynamicEnable(); } @@ -435,7 +435,7 @@ void ege::Environement::clear() { } -void ege::Environement::render(const echrono::Duration& _delta, const std::string& _camera) { +void ege::Environement::render(const echrono::Duration& _delta, const etk::String& _camera) { // get the correct camera: ememory::SharedPtr camera = getCamera(_camera); if (camera == nullptr) { @@ -531,11 +531,11 @@ void ege::Environement::onCallbackPeriodicCall(const ewol::event::Time& _event) } -void ege::Environement::addCamera(const std::string& _name, const ememory::SharedPtr& _camera) { - m_listCamera.insert(std::make_pair(_name, _camera)); +void ege::Environement::addCamera(const etk::String& _name, const ememory::SharedPtr& _camera) { + m_listCamera.insert(etk::makePair(_name, _camera)); } -ememory::SharedPtr ege::Environement::getCamera(const std::string& _name) { +ememory::SharedPtr ege::Environement::getCamera(const etk::String& _name) { auto cameraIt = m_listCamera.find(_name); if (cameraIt != m_listCamera.end()) { return cameraIt->second; diff --git a/ege/Environement.hpp b/ege/Environement.hpp index aaa4905..235b739 100644 --- a/ege/Environement.hpp +++ b/ege/Environement.hpp @@ -15,7 +15,7 @@ namespace ege { #include -#include +#include #include #include #include @@ -50,13 +50,13 @@ namespace ege { return m_groupSource; }; protected: - std::vector m_groupDestination; + etk::Vector m_groupDestination; public: - const std::vector& getDestinationGroup() { + const etk::Vector& getDestinationGroup() { return m_groupDestination; }; void addGroupDestination(int32_t _id) { - m_groupDestination.push_back(_id); + m_groupDestination.pushBack(_id); }; protected: vec3 m_positionSource; @@ -83,44 +83,44 @@ namespace ege { eproperty::List propertyStatus; //!< the display is running (not in pause) eproperty::Value propertyRatio; //!< Speed ratio protected: - std::vector> m_engine; //!< EGE sub engine interface (like physique, rendering, audio, ...). + etk::Vector> m_engine; //!< EGE sub engine interface (like physique, rendering, audio, ...). public: void addEngine(const ememory::SharedPtr& _ref); void rmEngine(const ememory::SharedPtr& _ref); - void rmEngine(const std::string& _type); - ememory::SharedPtr getEngine(const std::string& _type); + void rmEngine(const etk::String& _type); + ememory::SharedPtr getEngine(const etk::String& _type); void engineComponentRemove(const ememory::SharedPtr& _ref); void engineComponentAdd(const ememory::SharedPtr& _ref); private: - std::vector> m_listEntity; //!< List of all entity added in the Game + etk::Vector> m_listEntity; //!< List of all entity added in the Game protected: Environement(); public: DECLARE_FACTORY(Environement); virtual ~Environement() { }; public: - void render(const echrono::Duration& _delta, const std::string& _camera); + void render(const echrono::Duration& _delta, const etk::String& _camera); protected: - std::map> m_listCamera; //!< list of all camera in the world + etk::Map> m_listCamera; //!< list of all camera in the world public: /** * @brief Add a camera in the camera pool. * @param[in] _name Name of the camera. * @param[in] _camera Pointer on the camera to add. */ - void addCamera(const std::string& _name, const ememory::SharedPtr& _camera); + void addCamera(const etk::String& _name, const ememory::SharedPtr& _camera); /** * @brief Get a specific camera. * @param[in] _name Name of the camera. * @return A pointer on the camera requested. */ - ememory::SharedPtr getCamera(const std::string& _name); + ememory::SharedPtr getCamera(const etk::String& _name); /** * @brief Get List of all camera. * @return All the camera registerred. */ - std::map> getCameraList() const { + etk::Map> getCameraList() const { return m_listCamera; } public: @@ -133,7 +133,7 @@ namespace ege { * @param[in] _type Type of the entity. * @param[in] _creator Function pointer that reference the entity creating. */ - static void addCreator(const std::string& _type, ege::createEntity_tf _creator); + static void addCreator(const etk::String& _type, ege::createEntity_tf _creator); /** * @brief Create an entity on the curent scene. * @param[in] _type Type of the entity that might be created. @@ -142,11 +142,11 @@ namespace ege { * @return nullptr if an error occured OR the pointer on the entity and it is already added on the system. * @note Pointer is return in case of setting properties on it... */ - ememory::SharedPtr createEntity(const std::string& _type, const std::string& _description, bool _autoAddEntity=true); - ememory::SharedPtr createEntity(const std::string& _type, const ejson::Value& _value, bool _autoAddEntity=true); - ememory::SharedPtr createEntity(const std::string& _type, const exml::Node& _node, bool _autoAddEntity=true); - ememory::SharedPtr createEntity(const std::string& _type, void* _data, bool _autoAddEntity=true); - ememory::SharedPtr createEntity(const std::string& _type, bool _autoAddEntity=true); + ememory::SharedPtr createEntity(const etk::String& _type, const etk::String& _description, bool _autoAddEntity=true); + ememory::SharedPtr createEntity(const etk::String& _type, const ejson::Value& _value, bool _autoAddEntity=true); + ememory::SharedPtr createEntity(const etk::String& _type, const exml::Node& _node, bool _autoAddEntity=true); + ememory::SharedPtr createEntity(const etk::String& _type, void* _data, bool _autoAddEntity=true); + ememory::SharedPtr createEntity(const etk::String& _type, bool _autoAddEntity=true); public: class ResultNearestEntity { public: @@ -173,7 +173,7 @@ namespace ege { * @breif get a reference on the curent list of entity games * @return all entity list */ - std::vector>& getEntity() { + etk::Vector>& getEntity() { return m_listEntity; }; /** @@ -187,10 +187,10 @@ namespace ege { void getEntityNearest(const vec3& _sourcePosition, float _distanceMax, - std::vector& _resultList); + etk::Vector& _resultList); void getEntityNearestFixed(const vec3& _sourcePosition, float _distanceMax, - std::vector& _resultList); + etk::Vector& _resultList); */ /** * @brief add an entity on the list availlable. @@ -214,12 +214,12 @@ namespace ege { private: void onCallbackPeriodicCall(const ewol::event::Time& _event); protected: - std::vector> m_listMeshToDrawFirst; + etk::Vector> m_listMeshToDrawFirst; public: void addStaticMeshToDraw(const ememory::SharedPtr& _mesh) { - m_listMeshToDrawFirst.push_back(_mesh); + m_listMeshToDrawFirst.pushBack(_mesh); } - std::vector>& getStaticMeshToDraw() { + etk::Vector>& getStaticMeshToDraw() { return m_listMeshToDrawFirst; } virtual void onChangePropertyStatus(); diff --git a/ege/Light.cpp b/ege/Light.cpp index 98dee43..dd0d744 100644 --- a/ege/Light.cpp +++ b/ege/Light.cpp @@ -25,7 +25,7 @@ ege::Light::~Light() { } -void ege::Light::link(ememory::SharedPtr _prog, const std::string& _baseName) { +void ege::Light::link(ememory::SharedPtr _prog, const etk::String& _baseName) { if (_prog == nullptr) { return; } @@ -44,7 +44,7 @@ void ege::Light::draw(ememory::SharedPtr _prog) { _prog->uniform4(m_GL_specularColor, m_specularColor); } -std::ostream& ege::operator <<(std::ostream& _os, const ege::Light& _obj) { +etk::Stream& ege::operator <<(etk::Stream& _os, const ege::Light& _obj) { _os << "light:{"; _os << "dir=" << _obj.m_direction; _os << " halfplan=" << _obj.m_halfplane; diff --git a/ege/Light.hpp b/ege/Light.hpp index f1738d7..34be9b8 100644 --- a/ege/Light.hpp +++ b/ege/Light.hpp @@ -29,7 +29,7 @@ namespace ege { public: Light(); ~Light(); - void link(ememory::SharedPtr _prog, const std::string& _baseName); + void link(ememory::SharedPtr _prog, const etk::String& _baseName); void draw(ememory::SharedPtr _prog); void setDirection(const vec3& val) { m_direction = val; @@ -47,8 +47,8 @@ namespace ege { m_specularColor = val; } - friend std::ostream& operator <<(std::ostream& _os, const ege::Light& _obj); + friend etk::Stream& operator <<(etk::Stream& _os, const ege::Light& _obj); }; - std::ostream& operator <<(std::ostream& _os, const ege::Light& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ege::Light& _obj); } diff --git a/ege/Material.cpp b/ege/Material.cpp index aaf07a6..dc2313c 100644 --- a/ege/Material.cpp +++ b/ege/Material.cpp @@ -17,7 +17,7 @@ ege::MaterialGlId::MaterialGlId() : // nothing to do else ... } -void ege::MaterialGlId::link(ememory::SharedPtr _prog, const std::string& _baseName) { +void ege::MaterialGlId::link(ememory::SharedPtr _prog, const etk::String& _baseName) { if (_prog == nullptr) { return; } @@ -66,7 +66,7 @@ void ege::Material::draw(ememory::SharedPtr _prog, cons EGE_VERBOSE("draw Material: ( end )"); } -void ege::Material::setTexture0(const std::string& _filename) { +void ege::Material::setTexture0(const etk::String& _filename) { ivec2 tmpSize(256, 256); if (_filename != "") { // prevent overloard error : diff --git a/ege/Material.hpp b/ege/Material.hpp index 0e96f39..7f148c3 100644 --- a/ege/Material.hpp +++ b/ege/Material.hpp @@ -24,7 +24,7 @@ namespace ege { int32_t m_GL_shininess; int32_t m_GL_texture0; MaterialGlId(); - void link(ememory::SharedPtr _prog, const std::string& _baseName); + void link(ememory::SharedPtr _prog, const etk::String& _baseName); }; @@ -38,7 +38,7 @@ namespace ege { enum gale::openGL::renderMode m_renderMode; // Select Render mode (triangle/Line/point ...) ememory::SharedPtr m_texture0; public: - std::vector m_listIndexFaces; + etk::Vector m_listIndexFaces; public: Material(); ~Material(); @@ -60,7 +60,7 @@ namespace ege { enum gale::openGL::renderMode getRenderMode() { return m_renderMode; } - void setTexture0(const std::string& _filename); + void setTexture0(const etk::String& _filename); void setTexture0Magic(const ivec2& _size); void setImageSize(const ivec2& _newSize) { diff --git a/ege/Ray.cpp b/ege/Ray.cpp index ec30bf7..7ea2b25 100644 --- a/ege/Ray.cpp +++ b/ege/Ray.cpp @@ -27,7 +27,7 @@ void ege::Ray::setDirection(const vec3& _direction) { -std::ostream& ege::operator <<(std::ostream& _os, const ege::Ray& _obj) { +etk::Stream& ege::operator <<(etk::Stream& _os, const ege::Ray& _obj) { _os << "{ori="; _os << _obj.getOrigin(); _os << " dir="; diff --git a/ege/Ray.hpp b/ege/Ray.hpp index be880c1..e4437d8 100644 --- a/ege/Ray.hpp +++ b/ege/Ray.hpp @@ -66,6 +66,6 @@ namespace ege { public: vec3 testRayZeroPlane(); }; - std::ostream& operator <<(std::ostream& _os, const ege::Ray& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ege::Ray& _obj); } diff --git a/ege/camera/View.cpp b/ege/camera/View.cpp index c5e3160..c224ff9 100644 --- a/ege/camera/View.cpp +++ b/ege/camera/View.cpp @@ -108,22 +108,22 @@ ege::Ray ege::camera::View::getRayFromScreen(const vec2& _offset) { mat.rotate(vec3(0,0,1), m_angle); //mat.translate(vec3(m_eye.x(), m_eye.y(), m_eye.z())); _draw->drawSquare(vec3(2,2,2), mat, etk::Color(0.0f, 0.0f, 1.0f, 1.0f)); - std::vector EwolVertices; - EwolVertices.push_back(vec3(0,0,0)); - EwolVertices.push_back(vec3(-5,-5,-5)); - EwolVertices.push_back(vec3(5,-5,-5)); + etk::Vector EwolVertices; + EwolVertices.pushBack(vec3(0,0,0)); + EwolVertices.pushBack(vec3(-5,-5,-5)); + EwolVertices.pushBack(vec3(5,-5,-5)); - EwolVertices.push_back(vec3(0,0,0)); - EwolVertices.push_back(vec3(5,-5,-5)); - EwolVertices.push_back(vec3(5,5,-5)); + EwolVertices.pushBack(vec3(0,0,0)); + EwolVertices.pushBack(vec3(5,-5,-5)); + EwolVertices.pushBack(vec3(5,5,-5)); - EwolVertices.push_back(vec3(0,0,0)); - EwolVertices.push_back(vec3(5,5,-5)); - EwolVertices.push_back(vec3(-5,5,-5)); + EwolVertices.pushBack(vec3(0,0,0)); + EwolVertices.pushBack(vec3(5,5,-5)); + EwolVertices.pushBack(vec3(-5,5,-5)); - EwolVertices.push_back(vec3(0,0,0)); - EwolVertices.push_back(vec3(-5,5,-5)); - EwolVertices.push_back(vec3(-5,-5,-5)); + EwolVertices.pushBack(vec3(0,0,0)); + EwolVertices.pushBack(vec3(-5,5,-5)); + EwolVertices.pushBack(vec3(-5,-5,-5)); _draw->draw(EwolVertices, etk::Color(0.0f, 0.0f, 1.0f, 0.5f), mat); } mat.identity(); diff --git a/ege/elements/ElementBase.cpp b/ege/elements/ElementBase.cpp index 53e4c2c..e6024c4 100644 --- a/ege/elements/ElementBase.cpp +++ b/ege/elements/ElementBase.cpp @@ -21,7 +21,7 @@ ege::ElementBase::~ElementBase() { EGE_WARNING("Remove ... "); } -const std::string& ege::ElementBase::getType() const { +const etk::String& ege::ElementBase::getType() const { return ege::Element::getType(); } diff --git a/ege/elements/ElementBase.hpp b/ege/elements/ElementBase.hpp index 1223900..8c5b91c 100644 --- a/ege/elements/ElementBase.hpp +++ b/ege/elements/ElementBase.hpp @@ -32,7 +32,7 @@ namespace ege { * @brief get the element Type description string. * @return A reference on the descriptive string. */ - virtual const std::string& getType() const; + virtual const etk::String& getType() const; virtual void draw(int32_t _pass=0); private: vec3 m_position; diff --git a/ege/elements/ElementPhysic.cpp b/ege/elements/ElementPhysic.cpp index 7b067bc..7c40d78 100644 --- a/ege/elements/ElementPhysic.cpp +++ b/ege/elements/ElementPhysic.cpp @@ -18,8 +18,8 @@ #include -const std::string& ege::ElementPhysic::getType() const { - static const std::string nameType("----"); +const etk::String& ege::ElementPhysic::getType() const { + static const etk::String nameType("----"); return nameType; } @@ -180,7 +180,7 @@ const float ege::ElementPhysic::getInvMass() { void ege::ElementPhysic::drawShape(/*const btCollisionShape* _shape,*/ ememory::SharedPtr _draw, mat4 _transformationMatrix, - std::vector _tmpVertices) { + etk::Vector _tmpVertices) { #if 0 if( _draw == nullptr || _shape == nullptr) { diff --git a/ege/elements/ElementPhysic.hpp b/ege/elements/ElementPhysic.hpp index 81f2322..868c793 100644 --- a/ege/elements/ElementPhysic.hpp +++ b/ege/elements/ElementPhysic.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -59,7 +59,7 @@ namespace ege { * @brief get the element Type description string. * @return A reference on the descriptive string. */ - virtual const std::string& getType() const; + virtual const etk::String& getType() const; protected: //btCollisionShape* m_shape; //!< shape of the element (set a copy here to have the debug display of it) public: @@ -192,7 +192,7 @@ namespace ege { void drawShape(/*const btCollisionShape* _shape,*/ ememory::SharedPtr _draw, mat4 _transformationMatrix, - std::vector _tmpVertices); + etk::Vector _tmpVertices); protected: bool m_detectCollisionEnable; //!< physic collision detect enable. public: diff --git a/ege/ia/Component.cpp b/ege/ia/Component.cpp index 2ad2273..5d16334 100644 --- a/ege/ia/Component.cpp +++ b/ege/ia/Component.cpp @@ -5,8 +5,8 @@ */ #include -const std::string& ege::ia::Component::getType() const { - static std::string tmp("ia"); +const etk::String& ege::ia::Component::getType() const { + static etk::String tmp("ia"); return tmp; } diff --git a/ege/ia/Component.hpp b/ege/ia/Component.hpp index 4e1f284..c34dc8e 100644 --- a/ege/ia/Component.hpp +++ b/ege/ia/Component.hpp @@ -15,7 +15,7 @@ namespace ege { protected: public: - virtual const std::string& getType() const override; + virtual const etk::String& getType() const override; }; } } \ No newline at end of file diff --git a/ege/ia/Engine.cpp b/ege/ia/Engine.cpp index 64de8f5..6d518eb 100644 --- a/ege/ia/Engine.cpp +++ b/ege/ia/Engine.cpp @@ -10,8 +10,8 @@ ege::ia::Engine::Engine(ege::Environement* _env) : } -const std::string& ege::ia::Engine::getType() const { - static std::string tmp("ia"); +const etk::String& ege::ia::Engine::getType() const { + static etk::String tmp("ia"); return tmp; } diff --git a/ege/ia/Engine.hpp b/ege/ia/Engine.hpp index cd3acb7..f8afcd9 100644 --- a/ege/ia/Engine.hpp +++ b/ege/ia/Engine.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include @@ -22,7 +22,7 @@ namespace ege { // update cycle void update(float _delta) {} public: - const std::string& getType() const override; + const etk::String& getType() const override; void componentRemove(const ememory::SharedPtr& _ref) override; void componentAdd(const ememory::SharedPtr& _ref) override; }; diff --git a/ege/particule/Component.cpp b/ege/particule/Component.cpp index e99b1e1..f0ad0fe 100644 --- a/ege/particule/Component.cpp +++ b/ege/particule/Component.cpp @@ -7,8 +7,8 @@ #include #include -const std::string& ege::particule::Component::getType() const { - static std::string tmp("particule"); +const etk::String& ege::particule::Component::getType() const { + static etk::String tmp("particule"); return tmp; } diff --git a/ege/particule/Component.hpp b/ege/particule/Component.hpp index c087284..1bcad56 100644 --- a/ege/particule/Component.hpp +++ b/ege/particule/Component.hpp @@ -16,7 +16,7 @@ namespace ege { class Engine; class Component : public ege::Component { public: - virtual const std::string& getType() const override; + virtual const etk::String& getType() const override; protected: ege::particule::Engine* m_particuleEngine; const char* m_particuleType; diff --git a/ege/particule/Engine.cpp b/ege/particule/Engine.cpp index 744cba1..fbded4c 100644 --- a/ege/particule/Engine.cpp +++ b/ege/particule/Engine.cpp @@ -18,8 +18,8 @@ ege::particule::Engine::~Engine() { clear(); } -const std::string& ege::particule::Engine::getType() const { - static std::string tmp("particule"); +const etk::String& ege::particule::Engine::getType() const { + static etk::String tmp("particule"); return tmp; } @@ -46,7 +46,7 @@ void ege::particule::Engine::add(const ememory::SharedPtr& _particule) { @@ -61,7 +61,7 @@ void ege::particule::Engine::addRemoved(const ememory::SharedPtr ege::particule::Engine::respown(const char* _particuleType) { diff --git a/ege/particule/Engine.hpp b/ege/particule/Engine.hpp index b0b2ff6..11813c0 100644 --- a/ege/particule/Engine.hpp +++ b/ege/particule/Engine.hpp @@ -6,7 +6,7 @@ #pragma once #include #include -#include +#include #include namespace ege { @@ -18,8 +18,8 @@ namespace ege { Engine(ege::Environement* _env); // note : need the engine to register has an dynamic element ... (the first ...) ~Engine(); private: - std::vector> m_particuleList; //!< all particule created and active - std::vector> m_particuleRemoved; //!< removed particule + etk::Vector> m_particuleList; //!< all particule created and active + etk::Vector> m_particuleRemoved; //!< removed particule public: /** * @brief clear the particule engine @@ -47,7 +47,7 @@ namespace ege { ememory::SharedPtr respown(const char* _particuleType); public: - const std::string& getType() const override; + const etk::String& getType() const override; void componentRemove(const ememory::SharedPtr& _ref) override; void componentAdd(const ememory::SharedPtr& _ref) override; void update(const echrono::Duration& _delta) override; diff --git a/ege/physics/Component.cpp b/ege/physics/Component.cpp index 3a91d58..9592cf7 100644 --- a/ege/physics/Component.cpp +++ b/ege/physics/Component.cpp @@ -17,8 +17,8 @@ #include #include -const std::string& ege::physics::Component::getType() const { - static std::string tmp("physics"); +const etk::String& ege::physics::Component::getType() const { + static etk::String tmp("physics"); return tmp; } @@ -116,13 +116,13 @@ void ege::physics::Component::generate() { tmpElement->getSize().z()); // Create the box shape ephysics::BoxShape* shape = new ephysics::BoxShape(halfExtents, 0.0001); - m_listShape.push_back(shape); + m_listShape.pushBack(shape); // The ephysic use Y as UP ==> ege use Z as UP //orientation = orientation * ephysics::Quaternion(-0.707107, 0, 0, 0.707107); etk::Transform3D transform(it->getOrigin(), it->getOrientation()); ephysics::ProxyShape* proxyShape = m_rigidBody->addCollisionShape(shape, transform, it->getMass()); proxyShape->setUserData(this); - m_listProxyShape.push_back(proxyShape); + m_listProxyShape.pushBack(proxyShape); break; } case ege::physics::Shape::type::cylinder: { @@ -139,7 +139,7 @@ void ege::physics::Component::generate() { etk::Transform3D transform(it->getOrigin(), orientation); ephysics::ProxyShape* proxyShape = m_rigidBody->addCollisionShape(shape, transform, it->getMass()); proxyShape->setUserData(this); - m_listProxyShape.push_back(proxyShape); + m_listProxyShape.pushBack(proxyShape); break; } case ege::physics::Shape::type::capsule: { @@ -156,7 +156,7 @@ void ege::physics::Component::generate() { etk::Transform3D transform(it->getOrigin(), orientation); ephysics::ProxyShape* proxyShape = m_rigidBody->addCollisionShape(shape, transform, it->getMass()); proxyShape->setUserData(this); - m_listProxyShape.push_back(proxyShape); + m_listProxyShape.pushBack(proxyShape); break; } case ege::physics::Shape::type::cone: { @@ -173,7 +173,7 @@ void ege::physics::Component::generate() { etk::Transform3D transform(it->getOrigin(), orientation); ephysics::ProxyShape* proxyShape = m_rigidBody->addCollisionShape(shape, transform, it->getMass()); proxyShape->setUserData(this); - m_listProxyShape.push_back(proxyShape); + m_listProxyShape.pushBack(proxyShape); break; } case ege::physics::Shape::type::sphere: { @@ -190,7 +190,7 @@ void ege::physics::Component::generate() { etk::Transform3D transform(it->getOrigin(), orientation); ephysics::ProxyShape* proxyShape = m_rigidBody->addCollisionShape(shape, transform, it->getMass()); proxyShape->setUserData(this); - m_listProxyShape.push_back(proxyShape); + m_listProxyShape.pushBack(proxyShape); break; } case ege::physics::Shape::type::concave: { @@ -201,8 +201,8 @@ void ege::physics::Component::generate() { continue; } #if 0 - static const std::vector vertices = {vec3(-100.0f,-100.0f,-50.0f),vec3(100.0f,-100.0f,-50.0f),vec3(100.0f,100.0f,-50.0f)}; - static const std::vector indices = {0,1,2}; + static const etk::Vector vertices = {vec3(-100.0f,-100.0f,-50.0f),vec3(100.0f,-100.0f,-50.0f),vec3(100.0f,100.0f,-50.0f)}; + static const etk::Vector indices = {0,1,2}; ephysics::TriangleVertexArray* triangleArray = new ephysics::TriangleVertexArray(vertices, indices); #else @@ -221,7 +221,7 @@ void ege::physics::Component::generate() { etk::Transform3D transform(it->getOrigin(), it->getOrientation()); ephysics::ProxyShape* proxyShape = m_rigidBody->addCollisionShape(shape, transform, it->getMass()); proxyShape->setUserData(this); - m_listProxyShape.push_back(proxyShape); + m_listProxyShape.pushBack(proxyShape); break; } default : @@ -385,16 +385,16 @@ void ege::physics::Component::applyRelativeTorque(const vec3& _torque, bool _sta } } -const std::vector>& ege::physics::Component::getShape() const { +const etk::Vector>& ege::physics::Component::getShape() const { return m_shape; } -void ege::physics::Component::setShape(const std::vector>& _prop) { +void ege::physics::Component::setShape(const etk::Vector>& _prop) { m_shape = _prop; } void ege::physics::Component::addShape(const ememory::SharedPtr& _shape) { - m_shape.push_back(_shape); + m_shape.pushBack(_shape); } diff --git a/ege/physics/Component.hpp b/ege/physics/Component.hpp index 186b8ce..d2f949e 100644 --- a/ege/physics/Component.hpp +++ b/ege/physics/Component.hpp @@ -28,8 +28,8 @@ namespace ege { protected: ememory::SharedPtr m_engine; ephysics::RigidBody* m_rigidBody; - std::vector m_listShape; - std::vector m_listProxyShape; + etk::Vector m_listShape; + etk::Vector m_listProxyShape; public: /** * @brief Create a basic position component (no orientation and position (0,0,0)) @@ -42,7 +42,7 @@ namespace ege { Component(ememory::SharedPtr _env, const etk::Transform3D& _transform); ~Component(); public: - virtual const std::string& getType() const override; + virtual const etk::String& getType() const override; enum class type { bodyDynamic, @@ -150,10 +150,10 @@ namespace ege { void applyRelativeTorque(const vec3& _torque, bool _static=false); protected: - std::vector> m_shape; //!< collision shape module ... (independent of bullet lib) + etk::Vector> m_shape; //!< collision shape module ... (independent of bullet lib) public: - const std::vector>& getShape() const; - void setShape(const std::vector>& _prop); + const etk::Vector>& getShape() const; + void setShape(const etk::Vector>& _prop); void addShape(const ememory::SharedPtr& _shape); void generate(); void drawShape(ememory::SharedPtr _draw, ememory::SharedPtr _camera); diff --git a/ege/physics/Engine.cpp b/ege/physics/Engine.cpp index 15510dd..de564cc 100644 --- a/ege/physics/Engine.cpp +++ b/ege/physics/Engine.cpp @@ -12,8 +12,8 @@ #include #include -const std::string& ege::physics::Engine::getType() const { - static std::string tmp("physics"); +const etk::String& ege::physics::Engine::getType() const { + static etk::String tmp("physics"); return tmp; } @@ -81,7 +81,7 @@ void ege::physics::Engine::componentAdd(const ememory::SharedPtr return; } } - m_component.push_back(ref); + m_component.pushBack(ref); } ege::physics::Engine::Engine(ege::Environement* _env) : @@ -196,7 +196,7 @@ class MyCallbackClass : public ephysics::RaycastCallback { } }; -std::pair ege::physics::Engine::testRay(const ege::Ray& _ray) { +etk::Pair ege::physics::Engine::testRay(const ege::Ray& _ray) { vec3 start = _ray.getOrigin(); vec3 stop = _ray.getOrigin()+_ray.getDirection()*1000.0f; // Start and End are vectors @@ -207,13 +207,13 @@ std::pair ege::physics::Engine::testRay(const ege::Ray& _ray) { // Raycast test m_dynamicsWorld->raycast(ray, &callbackObject); if (callbackObject.m_haveImpact == true) { - return std::pair(callbackObject.m_position, callbackObject.m_normal); + return etk::Pair(callbackObject.m_position, callbackObject.m_normal); } EGE_VERBOSE(" No Hit"); - return std::pair(vec3(0,0,0),vec3(0,0,0)); + return etk::Pair(vec3(0,0,0),vec3(0,0,0)); } -std::pair, std::pair> ege::physics::Engine::testRayObject(const ege::Ray& _ray) { +etk::Pair, etk::Pair> ege::physics::Engine::testRayObject(const ege::Ray& _ray) { vec3 start = _ray.getOrigin(); vec3 stop = _ray.getOrigin()+_ray.getDirection()*1000.0f; // Start and End are vectors @@ -226,13 +226,13 @@ std::pair, std::pair> ege::physics if (callbackObject.m_haveImpact == true) { if ( callbackObject.m_body == nullptr || callbackObject.m_body->getUserData() == nullptr) { - std::pair, std::pair>(nullptr, std::pair(callbackObject.m_position, callbackObject.m_normal)); + etk::Pair, etk::Pair>(nullptr, std::pair(callbackObject.m_position, callbackObject.m_normal)); } // TODO: je n'ai pas une entity, main un component ... ege::physics::Component* elem = static_cast(callbackObject.m_body->getUserData()); - return std::pair, std::pair>(elem->sharedFromThis(), std::pair(callbackObject.m_position, callbackObject.m_normal)); + return etk::Pair, etk::Pair>(elem->sharedFromThis(), std::pair(callbackObject.m_position, callbackObject.m_normal)); } EGE_VERBOSE(" No Hit"); - return std::pair, std::pair>(nullptr, std::pair(vec3(0,0,0),vec3(0,0,0))); + return etk::Pair, etk::Pair>(nullptr, std::pair(vec3(0,0,0),vec3(0,0,0))); } \ No newline at end of file diff --git a/ege/physics/Engine.hpp b/ege/physics/Engine.hpp index 8c0e8f0..9fc4e68 100644 --- a/ege/physics/Engine.hpp +++ b/ege/physics/Engine.hpp @@ -15,7 +15,7 @@ namespace ege { #include #include #include -#include +#include #include #include #include @@ -53,11 +53,11 @@ namespace ege { return m_dynamicsWorld; } protected: - std::vector> m_component; + etk::Vector> m_component; //TODO : set it not in ewol ... ememory::SharedPtr m_debugDrawProperty; public: - const std::string& getType() const override; + const etk::String& getType() const override; void componentRemove(const ememory::SharedPtr& _ref) override; void componentAdd(const ememory::SharedPtr& _ref) override; void update(const echrono::Duration& _delta) override; @@ -72,13 +72,13 @@ namespace ege { * @param[in] _ray Ray top test * @return Impact position and normal of the impact (if normal == vec3(0,0,0) then no object impact... */ - std::pair testRay(const ege::Ray& _ray); + etk::Pair testRay(const ege::Ray& _ray); /** * @brief Test a rayCasting on the physic engine * @param[in] _ray Ray top test * @return Impact Component, position and normal of the impact (if normal == vec3(0,0,0) then no object impact... */ - std::pair, std::pair> testRayObject(const ege::Ray& _ray); + etk::Pair, etk::Pair> testRayObject(const ege::Ray& _ray); }; } } diff --git a/ege/physics/shape/Concave.hpp b/ege/physics/shape/Concave.hpp index 87217b8..d3a13bc 100644 --- a/ege/physics/shape/Concave.hpp +++ b/ege/physics/shape/Concave.hpp @@ -32,17 +32,17 @@ namespace ege { return this; } private: - std::vector m_listVertex; - std::vector m_indices; + etk::Vector m_listVertex; + etk::Vector m_indices; public: void clear() { m_listVertex.clear(); m_indices.clear(); } - void setListOfVertex(const std::vector& _listVertex) { + void setListOfVertex(const etk::Vector& _listVertex) { m_listVertex = _listVertex; } - void addTriangle(const std::vector& _index) { + void addTriangle(const etk::Vector& _index) { /* if (m_indices.size() == 0) { m_indices = _index; @@ -54,13 +54,13 @@ namespace ege { return; } for (auto &it: _index) { - m_indices.push_back(it); + m_indices.pushBack(it); } } - const std::vector& getVertex() const { + const etk::Vector& getVertex() const { return m_listVertex; } - const std::vector& getIndices() const { + const etk::Vector& getIndices() const { return m_indices; } }; diff --git a/ege/physics/shape/ConvexHull.cpp b/ege/physics/shape/ConvexHull.cpp index 347be02..922fec4 100644 --- a/ege/physics/shape/ConvexHull.cpp +++ b/ege/physics/shape/ConvexHull.cpp @@ -20,12 +20,12 @@ bool ege::physics::shape::ConvexHull::parse(const char* _line) { while (tmp != nullptr) { *tmp = '\0'; sscanf(base, "%f %f %f", &pos.m_floats[0], &pos.m_floats[1], &pos.m_floats[2] ); - m_points.push_back(pos); + m_points.pushBack(pos); base = tmp+1; tmp= strchr(base, '|'); } sscanf(base, "%f %f %f", &pos.m_floats[0], &pos.m_floats[1], &pos.m_floats[2] ); - m_points.push_back(pos); + m_points.pushBack(pos); /* for (int32_t iii=0; iii m_points; + etk::Vector m_points; public: - const std::vector& getPointList() const { + const etk::Vector& getPointList() const { return m_points; }; public: diff --git a/ege/physics/shape/Shape.cpp b/ege/physics/shape/Shape.cpp index 9d55511..28f4fe4 100644 --- a/ege/physics/shape/Shape.cpp +++ b/ege/physics/shape/Shape.cpp @@ -14,9 +14,9 @@ #include -ememory::SharedPtr ege::physics::Shape::create(const std::string& _name) { +ememory::SharedPtr ege::physics::Shape::create(const etk::String& _name) { ememory::SharedPtr tmpp = nullptr; - std::string name = etk::tolower(_name); + etk::String name = etk::tolower(_name); if (name == "box") { tmpp = ememory::makeShared(); } else if (name == "sphere") { diff --git a/ege/physics/shape/Shape.hpp b/ege/physics/shape/Shape.hpp index 4e6f8dd..47fed3f 100644 --- a/ege/physics/shape/Shape.hpp +++ b/ege/physics/shape/Shape.hpp @@ -26,7 +26,7 @@ namespace ege { class Shape { public: - static ememory::SharedPtr create(const std::string& _name); + static ememory::SharedPtr create(const etk::String& _name); public: enum class type { unknow, diff --git a/ege/position/Component.cpp b/ege/position/Component.cpp index f7d2e12..5542ea5 100644 --- a/ege/position/Component.cpp +++ b/ege/position/Component.cpp @@ -5,8 +5,8 @@ */ #include -const std::string& ege::position::Component::getType() const { - static std::string tmp("position"); +const etk::String& ege::position::Component::getType() const { + static etk::String tmp("position"); return tmp; } diff --git a/ege/position/Component.hpp b/ege/position/Component.hpp index 123828f..a5cb3a8 100644 --- a/ege/position/Component.hpp +++ b/ege/position/Component.hpp @@ -39,7 +39,7 @@ namespace ege { */ const etk::Transform3D& getTransform() const; public: - const std::string& getType() const override; + const etk::String& getType() const override; void addFriendComponent(const ememory::SharedPtr& _component) override; }; } diff --git a/ege/render/Component.cpp b/ege/render/Component.cpp index bad79e1..fe1b5b2 100644 --- a/ege/render/Component.cpp +++ b/ege/render/Component.cpp @@ -7,8 +7,8 @@ #include #include -const std::string& ege::render::Component::getType() const { - static std::string tmp("render"); +const etk::String& ege::render::Component::getType() const { + static etk::String tmp("render"); return tmp; } @@ -16,7 +16,7 @@ ege::render::Component::Component() { } -ege::render::Component::Component(const std::string& _fileName) { +ege::render::Component::Component(const etk::String& _fileName) { loadMesh(_fileName); } @@ -47,7 +47,7 @@ void ege::render::Component::onSignalPositionChange(const etk::Transform3D& _tra m_transform = _transform; } -bool ege::render::Component::loadMesh(const std::string& _meshFileName) { +bool ege::render::Component::loadMesh(const etk::String& _meshFileName) { ememory::SharedPtr tmpMesh = ege::resource::Mesh::create(_meshFileName); if(tmpMesh == nullptr) { EGE_ERROR("can not load the resources : " << _meshFileName); diff --git a/ege/render/Component.hpp b/ege/render/Component.hpp index 9ae6f6c..1369080 100644 --- a/ege/render/Component.hpp +++ b/ege/render/Component.hpp @@ -25,7 +25,7 @@ namespace ege { * @brief contruct with a mesh filename * @param[in] _fileName filename of the Mesh. */ - Component(const std::string& _fileName); + Component(const etk::String& _fileName); /** * @brief contruct with a prebuild mesh * @param[in] _mesh The mesh pointer. @@ -40,7 +40,7 @@ namespace ege { * @note Automaticly load the shape if it is specify in the mesh file * @return true if no error occured */ - virtual bool loadMesh(const std::string& _fileName); + virtual bool loadMesh(const etk::String& _fileName); /** * @brief set the the Mesh properties. * @param[in] _mesh The mesh pointer. (nullptr to force the mesh remove ...) @@ -70,7 +70,7 @@ namespace ege { */ void drawNormalDebug(ememory::SharedPtr _draw); public: - const std::string& getType() const override; + const etk::String& getType() const override; void addFriendComponent(const ememory::SharedPtr& _component) override; private: void onSignalPositionChange(const etk::Transform3D& _transform); diff --git a/ege/render/Engine.cpp b/ege/render/Engine.cpp index 016f392..d64785f 100644 --- a/ege/render/Engine.cpp +++ b/ege/render/Engine.cpp @@ -11,8 +11,8 @@ ege::render::Engine::Engine(ege::Environement* _env) : m_debugDrawProperty = ewol::resource::Colored3DObject::create(); } -const std::string& ege::render::Engine::getType() const { - static std::string tmp("render"); +const etk::String& ege::render::Engine::getType() const { + static etk::String tmp("render"); return tmp; } @@ -38,11 +38,11 @@ void ege::render::Engine::componentAdd(const ememory::SharedPtr& return; } } - m_component.push_back(ref); + m_component.pushBack(ref); } -void ege::render::Engine::getOrderedElementForDisplay(std::vector& _resultList, +void ege::render::Engine::getOrderedElementForDisplay(etk::Vector& _resultList, const vec3& _position, const vec3& _direction) { // TODO : Set it back ... corrected... @@ -89,7 +89,7 @@ void ege::render::Engine::getOrderedElementForDisplay(std::vector= _resultList.size()) { - _resultList.push_back(result); + _resultList.pushBack(result); } } } @@ -135,7 +135,7 @@ void ege::render::Engine::renderDebug(const echrono::Duration& _delta, const eme } // Draw debug ... (Camera) /* - std::map> listCamera = m_env->getCameraList(); + etk::Map> listCamera = m_env->getCameraList(); for (auto &itCam : listCamera) { if (itCam.second != nullptr) { itCam.second->drawDebug(m_debugDrawProperty, camera); diff --git a/ege/render/Engine.hpp b/ege/render/Engine.hpp index e55cab3..c0afa46 100644 --- a/ege/render/Engine.hpp +++ b/ege/render/Engine.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -24,22 +24,22 @@ namespace ege { ~Engine() {} eproperty::Value propertyDebugNormal; protected: - std::vector> m_component; + etk::Vector> m_component; class ResultNearestElement { public: ememory::SharedPtr element; float dist; }; - std::vector m_displayElementOrdered; + etk::Vector m_displayElementOrdered; //TODO : set it not in ewol ... ememory::SharedPtr m_debugDrawProperty; public: - const std::string& getType() const override; + const etk::String& getType() const override; void componentRemove(const ememory::SharedPtr& _ref) override; void componentAdd(const ememory::SharedPtr& _ref) override; void render(const echrono::Duration& _delta, const ememory::SharedPtr& _camera) override; void renderDebug(const echrono::Duration& _delta, const ememory::SharedPtr& _camera) override; - void getOrderedElementForDisplay(std::vector& _resultList, + void getOrderedElementForDisplay(etk::Vector& _resultList, const vec3& _position, const vec3& _direction); }; diff --git a/ege/resource/Mesh.cpp b/ege/resource/Mesh.cpp index 2721e5b..f594db8 100644 --- a/ege/resource/Mesh.cpp +++ b/ege/resource/Mesh.cpp @@ -29,7 +29,7 @@ ege::resource::Mesh::Mesh() : addResourceType("ege::resource::Mesh"); } -void ege::resource::Mesh::init(const std::string& _fileName, const std::string& _shaderName) { +void ege::resource::Mesh::init(const etk::String& _fileName, const etk::String& _shaderName) { gale::Resource::init(_fileName); EGE_VERBOSE("Load a new mesh : '" << _fileName << "'"); // get the shader resource : @@ -63,7 +63,7 @@ void ege::resource::Mesh::init(const std::string& _fileName, const std::string& // TO facilitate some debugs we add a name of the VBO: m_verticesVBO->setName("[VBO] of " + _fileName); // load the curent file : - std::string tmpName = etk::tolower(_fileName); + etk::String tmpName = etk::tolower(_fileName); // select the corect loader : if (etk::end_with(tmpName, ".obj") == true) { if (loadOBJ(_fileName) == false) { @@ -180,16 +180,16 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, vec3 cameraNormal = vec3(0,0,-1); cameraNormal.normalized(); // remove face that is notin the view ... - std::vector tmpIndexResult; - std::vector& tmppFaces = m_listFaces.getValue(kkk).m_faces; - //std::vector& tmppIndex = m_listFaces.getValue(kkk).m_index; + etk::Vector tmpIndexResult; + etk::Vector& tmppFaces = m_listFaces.getValue(kkk).m_faces; + //etk::Vector& tmppIndex = m_listFaces.getValue(kkk).m_index; switch(m_normalMode) { case ege::resource::Mesh::normalMode::face: for(size_t iii=0; iii= 0.0f) { - tmpIndexResult.push_back(iii*3); - tmpIndexResult.push_back(iii*3+1); - tmpIndexResult.push_back(iii*3+2); + tmpIndexResult.pushBack(iii*3); + tmpIndexResult.pushBack(iii*3+1); + tmpIndexResult.pushBack(iii*3+2); } } break; @@ -198,17 +198,17 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, if( ((mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[0]]).dot(cameraNormal) >= -0.2f) || ((mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[1]]).dot(cameraNormal) >= -0.2f) || ((mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[2]]).dot(cameraNormal) >= -0.2f) ) { - tmpIndexResult.push_back(iii*3); - tmpIndexResult.push_back(iii*3+1); - tmpIndexResult.push_back(iii*3+2); + tmpIndexResult.pushBack(iii*3); + tmpIndexResult.pushBack(iii*3+1); + tmpIndexResult.pushBack(iii*3+2); } } break; default: for(size_t iii=0; iii _draw) { etk::Color tmpColor(0.0, 1.0, 0.0, 1.0); - std::vector vertices; + etk::Vector vertices; // generate element in 2 pass : // - create new index dependeng a vertex is a unique componenet of position, texture, normal // - the index list generation (can be dynamic ... (TODO later) @@ -284,8 +284,8 @@ void ege::resource::Mesh::drawNormal(mat4& _positionMatrix, for(size_t indice=0 ; indice& tmpFaceList = m_listFaces[_materialName].m_faces; + etk::Vector& tmpFaceList = m_listFaces[_materialName].m_faces; vec3 normal(0,0,0); // add the vertex from all the element in the list for face when the element in the face ... for(size_t jjj=0 ; jjj& _color) { @@ -566,19 +566,19 @@ int32_t ege::resource::Mesh::findColorInList(const etk::Color& _color) { return iii; } } - m_listColor.push_back(_color); + m_listColor.pushBack(_color); return m_listColor.size()-1; } -void ege::resource::Mesh::addFaceIndexing(const std::string& _layerName) { +void ege::resource::Mesh::addFaceIndexing(const etk::String& _layerName) { if (m_listFaces.exist(_layerName) == false) { FaceIndexing empty; m_listFaces.add(_layerName, empty); } } -void ege::resource::Mesh::addPoint(const std::string& _layerName, const vec3& _pos, const etk::Color& _color) { +void ege::resource::Mesh::addPoint(const etk::String& _layerName, const vec3& _pos, const etk::Color& _color) { if ( m_listFaces.exist(_layerName) == false || m_materials.exist(_layerName) == false) { EGE_ERROR("Mesh layer : " << _layerName << " does not exist in list faces=" << m_listFaces.exist(_layerName) << " materials=" << m_listFaces.exist(_layerName) << " ..."); @@ -596,10 +596,10 @@ void ege::resource::Mesh::addPoint(const std::string& _layerName, const vec3& _p Face tmpFace; tmpFace.setVertex(pos); tmpFace.setColor(color, color, color); - m_listFaces[_layerName].m_faces.push_back(tmpFace); + m_listFaces[_layerName].m_faces.pushBack(tmpFace); } -void ege::resource::Mesh::addLine(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const etk::Color& _color1, const etk::Color& _color2) { +void ege::resource::Mesh::addLine(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const etk::Color& _color1, const etk::Color& _color2) { if ( m_listFaces.exist(_layerName) == false || m_materials.exist(_layerName) == false) { EGE_ERROR("Mesh layer : " << _layerName << " does not exist in list faces=" << m_listFaces.exist(_layerName) << " materials=" << m_listFaces.exist(_layerName) << " ..."); @@ -621,16 +621,16 @@ void ege::resource::Mesh::addLine(const std::string& _layerName, const vec3& _po Face tmpFace; tmpFace.setVertex(pos1, pos2); tmpFace.setColor(color1, color2, color2); - m_listFaces[_layerName].m_faces.push_back(tmpFace); + m_listFaces[_layerName].m_faces.pushBack(tmpFace); } -void ege::resource::Mesh::addLines(const std::string& _layerName, const std::vector& _list, const etk::Color& _color) { +void ege::resource::Mesh::addLines(const etk::String& _layerName, const etk::Vector& _list, const etk::Color& _color) { for (size_t iii=1; iii<_list.size(); ++iii) { addLine(_layerName, _list[iii-1], _list[iii], _color); } } -void ege::resource::Mesh::addLines(const std::string& _layerName, const std::vector& _list, const std::vector>& _color) { +void ege::resource::Mesh::addLines(const etk::String& _layerName, const etk::Vector& _list, const etk::Vector>& _color) { if (_color.size() != _list.size()) { EGE_ERROR("Can not add line with changing color without same number of color"); return; @@ -641,7 +641,7 @@ void ege::resource::Mesh::addLines(const std::string& _layerName, const std::vec } -void ege::resource::Mesh::addTriangle(const std::string& _layerName, +void ege::resource::Mesh::addTriangle(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec2& _uv1, const vec2& _uv2, const vec2& _uv3, const etk::Color& _color1, const etk::Color& _color2, const etk::Color& _color3) { @@ -674,11 +674,11 @@ void ege::resource::Mesh::addTriangle(const std::string& _layerName, pos2, uv2, pos3, uv3); tmpFace.setColor(color1, color2, color3); - m_listFaces[_layerName].m_faces.push_back(tmpFace); + m_listFaces[_layerName].m_faces.pushBack(tmpFace); EGE_INFO(" nbFace: " << m_listFaces[_layerName].m_faces.size()); } -void ege::resource::Mesh::addTriangle(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, +void ege::resource::Mesh::addTriangle(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const etk::Color& _color1, const etk::Color& _color2, const etk::Color& _color3) { if ( m_listFaces.exist(_layerName) == false || m_materials.exist(_layerName) == false) { @@ -705,7 +705,7 @@ void ege::resource::Mesh::addTriangle(const std::string& _layerName, const vec3& pos2, -1, pos3, -1); tmpFace.setColor(color1, color2, color3); - m_listFaces[_layerName].m_faces.push_back(tmpFace); + m_listFaces[_layerName].m_faces.pushBack(tmpFace); } else { EGE_ERROR("try to add Quad in a mesh material section that not support Quad"); return; @@ -713,7 +713,7 @@ void ege::resource::Mesh::addTriangle(const std::string& _layerName, const vec3& } #include -const std::vector>& ege::resource::Mesh::getPhysicalProperties() { +const etk::Vector>& ege::resource::Mesh::getPhysicalProperties() { for (auto &it: m_physics) { if (it->getType() == ege::physics::Shape::type::concave) { // need to generate the internal list of point and triangle needed: @@ -726,11 +726,11 @@ const std::vector>& ege::resource::Mesh: //EGE_INFO(" add vertices : " << m_listVertex); tmpElement->setListOfVertex(m_listVertex); for (size_t kkk=0; kkk index; + etk::Vector index; for (auto &it : m_listFaces.getValue(kkk).m_faces) { - index.push_back(it.m_vertex[0]); - index.push_back(it.m_vertex[1]); - index.push_back(it.m_vertex[2]); + index.pushBack(it.m_vertex[0]); + index.pushBack(it.m_vertex[1]); + index.pushBack(it.m_vertex[2]); } //EGE_INFO(" add triangle : " << m_listFaces.getValue(kkk).m_index); diff --git a/ege/resource/Mesh.hpp b/ege/resource/Mesh.hpp index dab3631..247f554 100644 --- a/ege/resource/Mesh.hpp +++ b/ege/resource/Mesh.hpp @@ -47,33 +47,33 @@ namespace ege { static ememory::SharedPtr createGrid(int32_t _lineCount, const vec3& _position=vec3(0,0,0), float _size=1.0f, - const std::string& _materialName="basics"); + const etk::String& _materialName="basics"); static ememory::SharedPtr createCube(float _size=1.0f, - const std::string& _materialName="basics", + const etk::String& _materialName="basics", const etk::Color& _color=etk::color::green); static ememory::SharedPtr createCube(const vec3& _size=vec3(1.0f, 1.0f, 1.0f), - const std::string& _materialName="basics", + const etk::String& _materialName="basics", const etk::Color& _color=etk::color::green); static ememory::SharedPtr createSphere(float _size=1.0f, - const std::string& _materialName="basics", + const etk::String& _materialName="basics", const etk::Color& _color=etk::color::green, int32_t _lats = 10, int32_t _longs = 10); static ememory::SharedPtr createCylinder(float _radius = 1.0f, float _size = 1.0f, - const std::string& _materialName="basics", + const etk::String& _materialName="basics", const etk::Color& _color=etk::color::green, int32_t _lats = 10, int32_t _longs = 10); static ememory::SharedPtr createCapsule(float _radius = 1.0f, float _size = 1.0f, - const std::string& _materialName="basics", + const etk::String& _materialName="basics", const etk::Color& _color=etk::color::green, int32_t _lats = 10, int32_t _longs = 10); static ememory::SharedPtr createCone(float _radius = 1.0f, float _size = 1.0f, - const std::string& _materialName="basics", + const etk::String& _materialName="basics", const etk::Color& _color=etk::color::green, int32_t _lats = 10, int32_t _longs = 10); @@ -105,22 +105,22 @@ namespace ege { MaterialGlId m_GLMaterial; ege::Light m_light; protected: - std::vector m_listVertex; //!< List of all vertex in the element - std::vector m_listUV; //!< List of all UV point in the mesh (for the specify texture) - std::vector> m_listColor; //!< List of all Color point in the mesh - std::vector m_listFacesNormal; //!< List of all Face normal, when calculated - std::vector m_listVertexNormal; //!< List of all Face normal, when calculated + etk::Vector m_listVertex; //!< List of all vertex in the element + etk::Vector m_listUV; //!< List of all UV point in the mesh (for the specify texture) + etk::Vector> m_listColor; //!< List of all Color point in the mesh + etk::Vector m_listFacesNormal; //!< List of all Face normal, when calculated + etk::Vector m_listVertexNormal; //!< List of all Face normal, when calculated etk::Hash m_listFaces; //!< List of all Face for the mesh etk::Hash> m_materials; - std::vector> m_physics; //!< collision shape module ... (independent of bullet lib) + etk::Vector> m_physics; //!< collision shape module ... (independent of bullet lib) void clean(); protected: ememory::SharedPtr m_verticesVBO; protected: Mesh(); - void init(const std::string& _fileName="---", - //const std::string& _shaderName="DATA:textured3D2.prog" - const std::string& _shaderName="DATA:material3D.prog" + void init(const etk::String& _fileName="---", + //const etk::String& _shaderName="DATA:textured3D2.prog" + const etk::String& _shaderName="DATA:material3D.prog" ); public: virtual ~Mesh(); @@ -138,16 +138,16 @@ namespace ege { ememory::SharedPtr _draw); void generateVBO(); private: - void calculateNormaleFace(const std::string& _materialName); - void calculateNormaleEdge(const std::string& _materialName); + void calculateNormaleFace(const etk::String& _materialName); + void calculateNormaleEdge(const etk::String& _materialName); public : - void createViewBox(const std::string& _materialName,float _size=1.0); - void createIcoSphere(const std::string& _materialName,float _size=1.0, int32_t _subdivision=3); + void createViewBox(const etk::String& _materialName,float _size=1.0); + void createIcoSphere(const etk::String& _materialName,float _size=1.0, int32_t _subdivision=3); private: - bool loadOBJ(const std::string& _fileName); - bool loadEMF(const std::string& _fileName); + bool loadOBJ(const etk::String& _fileName); + bool loadEMF(const etk::String& _fileName); public: - void addMaterial(const std::string& _name, ememory::SharedPtr _data); + void addMaterial(const etk::String& _name, ememory::SharedPtr _data); public: /** * @brief set the check of normal position befor sending it to the openGl card @@ -163,9 +163,9 @@ namespace ege { bool getCheckNormal() { return m_checkNormal; }; - const std::vector>& getPhysicalProperties(); + const etk::Vector>& getPhysicalProperties(); void addPhysicElement(const ememory::SharedPtr& _shape) { - m_physics.push_back(_shape); + m_physics.pushBack(_shape); } private: void* m_pointerShape; //!< all mesh have a basic shape (bullet or other) the void pointer mermit to not depent on the bullet lib @@ -192,17 +192,17 @@ namespace ege { * @brief Add in the faces list the layer requested * @param[in] _layerName face index to add */ - void addFaceIndexing(const std::string& _layerName); + void addFaceIndexing(const etk::String& _layerName); public: - void addPoint(const std::string& _layerName, const vec3& _pos, const etk::Color& _color); + void addPoint(const etk::String& _layerName, const vec3& _pos, const etk::Color& _color); - void addLine(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const etk::Color& _color) { + void addLine(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const etk::Color& _color) { addLine( _layerName, _pos1, _pos2, _color, _color); } - void addLine(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const etk::Color& _color1, const etk::Color& _color2); - void addLines(const std::string& _layerName, const std::vector& _list, const etk::Color& _color); - void addLines(const std::string& _layerName, const std::vector& _list, const std::vector>& _color); + void addLine(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const etk::Color& _color1, const etk::Color& _color2); + void addLines(const etk::String& _layerName, const etk::Vector& _list, const etk::Color& _color); + void addLines(const etk::String& _layerName, const etk::Vector& _list, const etk::Vector>& _color); /** * @not_in_doc @@ -215,7 +215,7 @@ namespace ege { * @param[in] _color2 color of the _pos2 element * @param[in] _color3 color of the _pos3 element */ - void addTriangle(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const etk::Color& _color) { + void addTriangle(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const etk::Color& _color) { addTriangle(_layerName, _pos1, _pos2, _pos3, _color, _color, _color); } /** @@ -229,7 +229,7 @@ namespace ege { * @param[in] _color2 color of the _pos2 element * @param[in] _color3 color of the _pos3 element */ - void addTriangle(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, + void addTriangle(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const etk::Color& _color1, const etk::Color& _color2, const etk::Color& _color3); /** * @not_in_doc @@ -241,7 +241,7 @@ namespace ege { * @param[in] _pos4 faurth point position * @param[in] _color color of all elements */ - void addQuad(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec3& _pos4, const etk::Color& _color) { + void addQuad(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec3& _pos4, const etk::Color& _color) { addQuad(_layerName, _pos1, _pos2, _pos3, _pos4, _color, _color, _color, _color); } /** @@ -257,7 +257,7 @@ namespace ege { * @param[in] _color3 color of the _pos3 element * @param[in] _color4 color of the _pos4 element */ - void addQuad(const std::string& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec3& _pos4, + void addQuad(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec3& _pos4, const etk::Color& _color1, const etk::Color& _color2, const etk::Color& _color3, const etk::Color& _color4) { addTriangle(_layerName, _pos1, _pos2, _pos3, _color1, _color2, _color3); addTriangle(_layerName, _pos1, _pos3, _pos4, _color1, _color3, _color4); @@ -274,7 +274,7 @@ namespace ege { * @param[in] _uv2 texture position of the _pos2 element * @param[in] _uv3 texture position of the _pos3 element */ - void addTriangle(const std::string& _layerName, + void addTriangle(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec2& _uv1, const vec2& _uv2, const vec2& _uv3, const etk::Color& _color) { @@ -294,7 +294,7 @@ namespace ege { * @param[in] _uv2 texture position of the _pos2 element * @param[in] _uv3 texture position of the _pos3 element */ - void addTriangle(const std::string& _layerName, + void addTriangle(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec2& _uv1, const vec2& _uv2, const vec2& _uv3, const etk::Color& _color1=etk::color::white, const etk::Color& _color2=etk::color::white, const etk::Color& _color3=etk::color::white); @@ -312,7 +312,7 @@ namespace ege { * @param[in] _uv3 texture position of the _pos3 element * @param[in] _uv4 texture position of the _pos4 element */ - void addQuad(const std::string& _layerName, + void addQuad(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec3& _pos4, const vec2& _uv1, const vec2& _uv2, const vec2& _uv3, const vec2& _uv4, const etk::Color& _color) { @@ -335,7 +335,7 @@ namespace ege { * @param[in] _color3 color of the _pos3 element * @param[in] _color4 color of the _pos4 element */ - void addQuad(const std::string& _layerName, + void addQuad(const etk::String& _layerName, const vec3& _pos1, const vec3& _pos2, const vec3& _pos3, const vec3& _pos4, const vec2& _uv1, const vec2& _uv2, const vec2& _uv3, const vec2& _uv4, const etk::Color& _color1=etk::color::white, const etk::Color& _color2=etk::color::white, const etk::Color& _color3=etk::color::white, const etk::Color& _color4=etk::color::white) { diff --git a/ege/resource/MeshCapsule.cpp b/ege/resource/MeshCapsule.cpp index fdbbc7d..bc1f25b 100644 --- a/ege/resource/MeshCapsule.cpp +++ b/ege/resource/MeshCapsule.cpp @@ -7,7 +7,7 @@ #include #include -ememory::SharedPtr ege::resource::Mesh::createCapsule(float _radius, float _size, const std::string& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { +ememory::SharedPtr ege::resource::Mesh::createCapsule(float _radius, float _size, const etk::String& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { EGE_VERBOSE(" create a capsule _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); if (out != nullptr) { diff --git a/ege/resource/MeshCone.cpp b/ege/resource/MeshCone.cpp index 23a5d5c..f8f4ec3 100644 --- a/ege/resource/MeshCone.cpp +++ b/ege/resource/MeshCone.cpp @@ -7,7 +7,7 @@ #include #include -ememory::SharedPtr ege::resource::Mesh::createCone(float _radius, float _size, const std::string& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { +ememory::SharedPtr ege::resource::Mesh::createCone(float _radius, float _size, const etk::String& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { EGE_VERBOSE(" create a cylinder _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); if (out != nullptr) { diff --git a/ege/resource/MeshCube.cpp b/ege/resource/MeshCube.cpp index 01acd09..9e5c7a3 100644 --- a/ege/resource/MeshCube.cpp +++ b/ege/resource/MeshCube.cpp @@ -7,11 +7,11 @@ #include #include -ememory::SharedPtr ege::resource::Mesh::createCube(float _size, const std::string& _materialName, const etk::Color& _color) { +ememory::SharedPtr ege::resource::Mesh::createCube(float _size, const etk::String& _materialName, const etk::Color& _color) { return createCube(vec3(_size, _size, _size), _materialName, _color); } -ememory::SharedPtr ege::resource::Mesh::createCube(const vec3& _size, const std::string& _materialName, const etk::Color& _color) { +ememory::SharedPtr ege::resource::Mesh::createCube(const vec3& _size, const etk::String& _materialName, const etk::Color& _color) { EGE_VERBOSE(" create a cube _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); if (out != nullptr) { diff --git a/ege/resource/MeshCylinder.cpp b/ege/resource/MeshCylinder.cpp index 617b2e1..8a26819 100644 --- a/ege/resource/MeshCylinder.cpp +++ b/ege/resource/MeshCylinder.cpp @@ -7,7 +7,7 @@ #include #include -ememory::SharedPtr ege::resource::Mesh::createCylinder(float _radius, float _size, const std::string& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { +ememory::SharedPtr ege::resource::Mesh::createCylinder(float _radius, float _size, const etk::String& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { EGE_VERBOSE(" create a cylinder _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); if (out != nullptr) { diff --git a/ege/resource/MeshEmf.cpp b/ege/resource/MeshEmf.cpp index 0079948..4fcc508 100644 --- a/ege/resource/MeshEmf.cpp +++ b/ege/resource/MeshEmf.cpp @@ -139,7 +139,7 @@ enum emfModuleMode { }; // TODO : rework with string line extractor -bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { +bool ege::resource::Mesh::loadEMF(const etk::String& _fileName) { m_checkNormal = true; m_normalMode = ege::resource::Mesh::normalMode::none; etk::FSNode fileName(_fileName); @@ -168,10 +168,10 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { enum emfModuleMode currentMode = EMFModuleNone; EGE_VERBOSE("Start parsing Mesh file : " << fileName); // mesh global param : - std::string currentMeshName = ""; + etk::String currentMeshName = ""; int32_t meshFaceMaterialID = -1; // material global param : - std::string materialName = ""; + etk::String materialName = ""; ememory::SharedPtr material; // physical shape: ememory::SharedPtr physics; @@ -266,7 +266,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { break; } sscanf(inputDataLine, "%f %f %f", &vertex.m_floats[0], &vertex.m_floats[1], &vertex.m_floats[2] ); - m_listVertex.push_back(vertex); + m_listVertex.pushBack(vertex); int32_t len = strlen(inputDataLine)-1; if( inputDataLine[len] == '\n' || inputDataLine[len] == '\r') { @@ -283,7 +283,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { break; } sscanf(inputDataLine, "%f %f", &uvMap.m_floats[0], &uvMap.m_floats[1]); - m_listUV.push_back(uvMap); + m_listUV.pushBack(uvMap); int32_t len = strlen(inputDataLine)-1; if( inputDataLine[len] == '\n' || inputDataLine[len] == '\r') { @@ -302,7 +302,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { break; } sscanf(inputDataLine, "%f %f %f", &normal.m_floats[0], &normal.m_floats[1], &normal.m_floats[2] ); - m_listVertexNormal.push_back(normal); + m_listVertexNormal.pushBack(normal); int32_t len = strlen(inputDataLine)-1; if( inputDataLine[len] == '\n' || inputDataLine[len] == '\r') { @@ -322,7 +322,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { break; } sscanf(inputDataLine, "%f %f %f", &normal.m_floats[0], &normal.m_floats[1], &normal.m_floats[2] ); - m_listFacesNormal.push_back(normal); + m_listFacesNormal.pushBack(normal); int32_t len = strlen(inputDataLine)-1; if( inputDataLine[len] == '\n' || inputDataLine[len] == '\r') { @@ -406,7 +406,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { normalIndex[2] += offsetVertexNormal; } } - m_listFaces.getValue(meshFaceMaterialID).m_faces.push_back(Face(vertexIndex[0], uvIndex[0], normalIndex[0], + m_listFaces.getValue(meshFaceMaterialID).m_faces.pushBack(Face(vertexIndex[0], uvIndex[0], normalIndex[0], vertexIndex[1], uvIndex[1], normalIndex[1], vertexIndex[2], uvIndex[2], normalIndex[2])); /* diff --git a/ege/resource/MeshGird.cpp b/ege/resource/MeshGird.cpp index 9776af2..721c69d 100644 --- a/ege/resource/MeshGird.cpp +++ b/ege/resource/MeshGird.cpp @@ -7,7 +7,7 @@ #include #include -ememory::SharedPtr ege::resource::Mesh::createGrid(int32_t _lineCount, const vec3& _position, float _size, const std::string& _materialName) { +ememory::SharedPtr ege::resource::Mesh::createGrid(int32_t _lineCount, const vec3& _position, float _size, const etk::String& _materialName) { ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); if (out != nullptr) { ememory::SharedPtr material = ememory::makeShared(); @@ -73,12 +73,12 @@ ememory::SharedPtr ege::resource::Mesh::createGrid(int32_t out->addLine(_materialName, _position+vec3(-1,-1,_lineCount+2.0f)*_size, _position+vec3(-1, 1,_lineCount+2.0f)*_size, etk::color::blue); } else { - std::vector list; - list.push_back(_position+vec3(-1,-1,iii)*_size); - list.push_back(_position+vec3(1,-1,iii)*_size); - list.push_back(_position+vec3(1,1,iii)*_size); - list.push_back(_position+vec3(-1,1,iii)*_size); - list.push_back(_position+vec3(-1,-1,iii)*_size); + etk::Vector list; + list.pushBack(_position+vec3(-1,-1,iii)*_size); + list.pushBack(_position+vec3(1,-1,iii)*_size); + list.pushBack(_position+vec3(1,1,iii)*_size); + list.pushBack(_position+vec3(-1,1,iii)*_size); + list.pushBack(_position+vec3(-1,-1,iii)*_size); out->addLines(_materialName, list, etk::color::gray); } //out->addPoint(_materialName, vec3(iii,-_lineCount,0), etk::color::white); diff --git a/ege/resource/MeshObj.cpp b/ege/resource/MeshObj.cpp index 23728d2..6651d85 100644 --- a/ege/resource/MeshObj.cpp +++ b/ege/resource/MeshObj.cpp @@ -8,7 +8,7 @@ #include -bool ege::resource::Mesh::loadOBJ(const std::string& _fileName) { +bool ege::resource::Mesh::loadOBJ(const etk::String& _fileName) { m_normalMode = ege::resource::Mesh::normalMode::none; #if 0 etk::FSNode fileName(_fileName); @@ -37,12 +37,12 @@ bool ege::resource::Mesh::loadOBJ(const std::string& _fileName) { // Texture position : vt 0.748573 0.750412 vec2 vertex(0,0); sscanf(&inputDataLine[3], "%f %f", &vertex.m_floats[0], &vertex.m_floats[1]); - m_listUV.push_back(vertex); + m_listUV.pushBack(vertex); } else { // Vertice position : v 1.000000 -1.000000 -1.000000 vec3 vertex(0,0,0); sscanf(&inputDataLine[2], "%f %f %f", &vertex.m_floats[0], &vertex.m_floats[1], &vertex.m_floats[2] ); - m_listVertex.push_back(vertex); + m_listVertex.pushBack(vertex); } } else if (inputDataLine[0] == 'f') { // face : f 5/1/1 1/2/1 4/3/1* @@ -80,12 +80,12 @@ bool ege::resource::Mesh::loadOBJ(const std::string& _fileName) { } } if (quadMode == true) { - m_listFaces.push_back(Face(vertexIndex[0]-1, uvIndex[0]-1, + m_listFaces.pushBack(Face(vertexIndex[0]-1, uvIndex[0]-1, vertexIndex[1]-1, uvIndex[1]-1, vertexIndex[2]-1, uvIndex[2]-1, vertexIndex[3]-1, uvIndex[3]-1)); } else { - m_listFaces.push_back(Face(vertexIndex[0]-1, uvIndex[0]-1, + m_listFaces.pushBack(Face(vertexIndex[0]-1, uvIndex[0]-1, vertexIndex[1]-1, uvIndex[1]-1, vertexIndex[2]-1, uvIndex[2]-1)); } @@ -114,7 +114,7 @@ bool ege::resource::Mesh::loadOBJ(const std::string& _fileName) { } inputDataLine[strlen(inputDataLine)-1] = '\0'; } - std::string tmpVal(&inputDataLine[7]); + etk::String tmpVal(&inputDataLine[7]); setTexture(fileName.getRelativeFolder() + tmpVal); } else if( inputDataLine[0] == 'm' && inputDataLine[1] == 't' diff --git a/ege/resource/MeshSphere.cpp b/ege/resource/MeshSphere.cpp index 169b4c0..9ddfd47 100644 --- a/ege/resource/MeshSphere.cpp +++ b/ege/resource/MeshSphere.cpp @@ -7,7 +7,7 @@ #include #include -ememory::SharedPtr ege::resource::Mesh::createSphere(float _radius, const std::string& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { +ememory::SharedPtr ege::resource::Mesh::createSphere(float _radius, const etk::String& _materialName, const etk::Color& _color, int32_t _lats, int32_t _longs) { EGE_VERBOSE(" create a sphere _size=" << _radius << " _materialName=" << _materialName << " _color=" << _color); ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:color3.prog"); if (out != nullptr) { diff --git a/ege/resource/ParticuleMesh.cpp b/ege/resource/ParticuleMesh.cpp index 4836ff1..89ef534 100644 --- a/ege/resource/ParticuleMesh.cpp +++ b/ege/resource/ParticuleMesh.cpp @@ -13,7 +13,7 @@ ege::resource::ParticuleMesh::ParticuleMesh() { addResourceType("ege::resource::ParticuleMesh"); } -void ege::resource::ParticuleMesh::init(const std::string& _fileName, const std::string& _shaderName) { +void ege::resource::ParticuleMesh::init(const etk::String& _fileName, const etk::String& _shaderName) { ege::resource::Mesh::init(_fileName, _shaderName); if (m_GLprogram != nullptr) { m_GLMainColor = m_GLprogram->getUniform("EW_mainColor"); @@ -85,15 +85,15 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, vec3 cameraNormal = vec3(0,0,-1); cameraNormal.normalized(); // remove face that is notin the view ... - std::vector tmpIndexResult; - std::vector& tmppFaces = m_listFaces.getValue(kkk).m_faces; - //std::vector& tmppIndex = m_listFaces.getValue(kkk).m_index; + etk::Vector tmpIndexResult; + etk::Vector& tmppFaces = m_listFaces.getValue(kkk).m_faces; + //etk::Vector& tmppIndex = m_listFaces.getValue(kkk).m_index; if (m_normalMode == ege::resource::Mesh::normalMode::face) { for(size_t iii=0; iii= 0.0f) { - tmpIndexResult.push_back(iii*3); - tmpIndexResult.push_back(iii*3+1); - tmpIndexResult.push_back(iii*3+2); + tmpIndexResult.pushBack(iii*3); + tmpIndexResult.pushBack(iii*3+1); + tmpIndexResult.pushBack(iii*3+2); } } } else { @@ -101,9 +101,9 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, if( ((mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[0]]).dot(cameraNormal) >= -0.2f) || ((mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[1]]).dot(cameraNormal) >= -0.2f) || ((mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[2]]).dot(cameraNormal) >= -0.2f) ) { - tmpIndexResult.push_back(iii*3); - tmpIndexResult.push_back(iii*3+1); - tmpIndexResult.push_back(iii*3+2); + tmpIndexResult.pushBack(iii*3); + tmpIndexResult.pushBack(iii*3+1); + tmpIndexResult.pushBack(iii*3+2); } } } diff --git a/ege/resource/ParticuleMesh.hpp b/ege/resource/ParticuleMesh.hpp index 9576319..07affb3 100644 --- a/ege/resource/ParticuleMesh.hpp +++ b/ege/resource/ParticuleMesh.hpp @@ -14,7 +14,7 @@ namespace ege { int32_t m_GLMainColor; protected: ParticuleMesh(); - void init(const std::string& _fileName, const std::string& _shaderName="DATA:ParticuleMesh.prog"); + void init(const etk::String& _fileName, const etk::String& _shaderName="DATA:ParticuleMesh.prog"); public: DECLARE_RESOURCE_NAMED_FACTORY(ParticuleMesh); virtual ~ParticuleMesh(); diff --git a/ege/resource/tools/FaceIndexing.hpp b/ege/resource/tools/FaceIndexing.hpp index dcd05ee..fcab69c 100644 --- a/ege/resource/tools/FaceIndexing.hpp +++ b/ege/resource/tools/FaceIndexing.hpp @@ -8,8 +8,8 @@ namespace ege { class FaceIndexing { public: - std::vector m_faces; - std::vector m_index; //!< index of the vertex in the VBO not in the Mesh.m_listVertex + etk::Vector m_faces; + etk::Vector m_index; //!< index of the vertex in the VBO not in the Mesh.m_listVertex }; } diff --git a/ege/resource/tools/icoSphere.cpp b/ege/resource/tools/icoSphere.cpp index f79f5e2..4709934 100644 --- a/ege/resource/tools/icoSphere.cpp +++ b/ege/resource/tools/icoSphere.cpp @@ -9,7 +9,7 @@ #include // return index of point in the middle of p1 and p2 -static int32_t getMiddlePoint(std::vector& _listVertex, int32_t _p1, int32_t _p2) { +static int32_t getMiddlePoint(etk::Vector& _listVertex, int32_t _p1, int32_t _p2) { vec3 middle = (_listVertex[_p1] + _listVertex[_p2])*0.5f; // check if this point exist: int32_t id=0; @@ -19,19 +19,19 @@ static int32_t getMiddlePoint(std::vector& _listVertex, int32_t _p1, int32 } id++; } - _listVertex.push_back(middle.normalize()); + _listVertex.pushBack(middle.normalize()); return _listVertex.size()-1; } -static int32_t addUV(std::vector& _listUV, int32_t _uvId, float _add) { +static int32_t addUV(etk::Vector& _listUV, int32_t _uvId, float _add) { //vec2 plop(-_add, _listUV[_uvId].y()); - //_listUV.push_back(plop); - _listUV.push_back(_listUV[_uvId] + vec2(_add, 0.0f)); + //_listUV.pushBack(plop); + _listUV.pushBack(_listUV[_uvId] + vec2(_add, 0.0f)); return _listUV.size()-1; } -void ege::icoSphere::create(etk::Hash>& _materials, etk::Hash& _listFaces, std::vector& _listVertex, std::vector& _listUV, - const std::string& _materialName, float _size, int32_t _recursionLevel) { +void ege::icoSphere::create(etk::Hash>& _materials, etk::Hash& _listFaces, etk::Vector& _listVertex, etk::Vector& _listUV, + const etk::String& _materialName, float _size, int32_t _recursionLevel) { /* 5 o @@ -62,28 +62,28 @@ void ege::icoSphere::create(etk::Hash>& _mater double size = 1.0; double ttt = (1.0 + sqrt(5.0)) / 2.0*size; EGE_ERROR("podition : " << ttt); - _listVertex.push_back(vec3(-size, ttt, 0.0).normalize()); // 0 - _listVertex.push_back(vec3( size, ttt, 0.0).normalize()); // 1 - _listVertex.push_back(vec3(-size, -ttt, 0.0).normalize()); // 2 - _listVertex.push_back(vec3( size, -ttt, 0.0).normalize()); // 3 + _listVertex.pushBack(vec3(-size, ttt, 0.0).normalize()); // 0 + _listVertex.pushBack(vec3( size, ttt, 0.0).normalize()); // 1 + _listVertex.pushBack(vec3(-size, -ttt, 0.0).normalize()); // 2 + _listVertex.pushBack(vec3( size, -ttt, 0.0).normalize()); // 3 - _listVertex.push_back(vec3( 0.0, -1, ttt).normalize()); // 4 - _listVertex.push_back(vec3( 0.0, 1, ttt).normalize()); // 5 - _listVertex.push_back(vec3( 0.0, -1, -ttt).normalize()); // 6 - _listVertex.push_back(vec3( 0.0, 1, -ttt).normalize()); // 7 + _listVertex.pushBack(vec3( 0.0, -1, ttt).normalize()); // 4 + _listVertex.pushBack(vec3( 0.0, 1, ttt).normalize()); // 5 + _listVertex.pushBack(vec3( 0.0, -1, -ttt).normalize()); // 6 + _listVertex.pushBack(vec3( 0.0, 1, -ttt).normalize()); // 7 - _listVertex.push_back(vec3( ttt, 0.0, -size).normalize()); // 8 - _listVertex.push_back(vec3( ttt, 0.0, size).normalize()); // 9 - _listVertex.push_back(vec3(-ttt, 0.0, -size).normalize()); // 10 - _listVertex.push_back(vec3(-ttt, 0.0, size).normalize()); // 11 + _listVertex.pushBack(vec3( ttt, 0.0, -size).normalize()); // 8 + _listVertex.pushBack(vec3( ttt, 0.0, size).normalize()); // 9 + _listVertex.pushBack(vec3(-ttt, 0.0, -size).normalize()); // 10 + _listVertex.pushBack(vec3(-ttt, 0.0, size).normalize()); // 11 // _listUV ==> TODO : very bad code ... get from viewBox .... - _listUV.push_back(vec2(0.0, 0.0 )); // 0 - _listUV.push_back(vec2(0.0, 1.0 )); // 1 - _listUV.push_back(vec2(1.0, 0.0 )); // 2 + _listUV.pushBack(vec2(0.0, 0.0 )); // 0 + _listUV.pushBack(vec2(0.0, 1.0 )); // 1 + _listUV.pushBack(vec2(1.0, 0.0 )); // 2 for (auto &elem : _listVertex) { - EGE_INFO("plop : " << etk::to_string(elem)); + EGE_INFO("plop : " << etk::toString(elem)); } if (_listFaces.exist(_materialName) == false) { @@ -93,44 +93,44 @@ void ege::icoSphere::create(etk::Hash>& _mater { FaceIndexing& tmpElement = _listFaces[_materialName]; // 5 faces around point 0 - tmpElement.m_faces.push_back(Face(0,0, 11,1, 5,2)); - tmpElement.m_faces.push_back(Face(0,0, 5,1, 1,2)); - tmpElement.m_faces.push_back(Face(0,0, 1,1, 7,2)); - tmpElement.m_faces.push_back(Face(0,0, 7,1, 10,2)); - tmpElement.m_faces.push_back(Face(0,0, 10,1, 11,2)); + tmpElement.m_faces.pushBack(Face(0,0, 11,1, 5,2)); + tmpElement.m_faces.pushBack(Face(0,0, 5,1, 1,2)); + tmpElement.m_faces.pushBack(Face(0,0, 1,1, 7,2)); + tmpElement.m_faces.pushBack(Face(0,0, 7,1, 10,2)); + tmpElement.m_faces.pushBack(Face(0,0, 10,1, 11,2)); // 5 adjacent faces - tmpElement.m_faces.push_back(Face( 1,0, 5,1, 9,2)); - tmpElement.m_faces.push_back(Face( 5,0, 11,1, 4,2)); - tmpElement.m_faces.push_back(Face(11,0, 10,1, 2,2)); - tmpElement.m_faces.push_back(Face(10,0, 7,1, 6,2)); - tmpElement.m_faces.push_back(Face( 7,0, 1,1, 8,2)); + tmpElement.m_faces.pushBack(Face( 1,0, 5,1, 9,2)); + tmpElement.m_faces.pushBack(Face( 5,0, 11,1, 4,2)); + tmpElement.m_faces.pushBack(Face(11,0, 10,1, 2,2)); + tmpElement.m_faces.pushBack(Face(10,0, 7,1, 6,2)); + tmpElement.m_faces.pushBack(Face( 7,0, 1,1, 8,2)); // 5 faces around point 3 - tmpElement.m_faces.push_back(Face(3,0, 9,1, 4,2)); - tmpElement.m_faces.push_back(Face(3,0, 4,1, 2,2)); - tmpElement.m_faces.push_back(Face(3,0, 2,1, 6,2)); - tmpElement.m_faces.push_back(Face(3,0, 6,1, 8,2)); - tmpElement.m_faces.push_back(Face(3,0, 8,1, 9,2)); + tmpElement.m_faces.pushBack(Face(3,0, 9,1, 4,2)); + tmpElement.m_faces.pushBack(Face(3,0, 4,1, 2,2)); + tmpElement.m_faces.pushBack(Face(3,0, 2,1, 6,2)); + tmpElement.m_faces.pushBack(Face(3,0, 6,1, 8,2)); + tmpElement.m_faces.pushBack(Face(3,0, 8,1, 9,2)); // 5 adjacent faces - tmpElement.m_faces.push_back(Face(4,0, 9,1, 5,2)); - tmpElement.m_faces.push_back(Face(2,0, 4,1, 11,2)); - tmpElement.m_faces.push_back(Face(6,0, 2,1, 10,2)); - tmpElement.m_faces.push_back(Face(8,0, 6,1, 7,2)); - tmpElement.m_faces.push_back(Face(9,0, 8,1, 1,2)); + tmpElement.m_faces.pushBack(Face(4,0, 9,1, 5,2)); + tmpElement.m_faces.pushBack(Face(2,0, 4,1, 11,2)); + tmpElement.m_faces.pushBack(Face(6,0, 2,1, 10,2)); + tmpElement.m_faces.pushBack(Face(8,0, 6,1, 7,2)); + tmpElement.m_faces.pushBack(Face(9,0, 8,1, 1,2)); // refine triangles for (int i = 0; i < _recursionLevel; i++) { - std::vector listFaces; + etk::Vector listFaces; for (auto &tri : tmpElement.m_faces) { // replace triangle by 4 triangles int32_t a = getMiddlePoint(_listVertex, tri.m_vertex[0], tri.m_vertex[1]); int32_t b = getMiddlePoint(_listVertex, tri.m_vertex[1], tri.m_vertex[2]); int32_t c = getMiddlePoint(_listVertex, tri.m_vertex[2], tri.m_vertex[0]); - listFaces.push_back(Face(tri.m_vertex[0],0, a,1, c,2)); - listFaces.push_back(Face(tri.m_vertex[1],0, b,1, a,2)); - listFaces.push_back(Face(tri.m_vertex[2],0, c,1, b,2)); - listFaces.push_back(Face(a,0, b,1, c,2)); + listFaces.pushBack(Face(tri.m_vertex[0],0, a,1, c,2)); + listFaces.pushBack(Face(tri.m_vertex[1],0, b,1, a,2)); + listFaces.pushBack(Face(tri.m_vertex[2],0, c,1, b,2)); + listFaces.pushBack(Face(a,0, b,1, c,2)); } tmpElement.m_faces = listFaces; } @@ -156,20 +156,20 @@ void ege::icoSphere::create(etk::Hash>& _mater angle = -angle; } } - //EGE_WARNING( "angle = " << (angle/M_PI*180.0f) << " from: vert=" << etk::to_string(vert) << " proj=" << proj ); + //EGE_WARNING( "angle = " << (angle/M_PI*180.0f) << " from: vert=" << etk::toString(vert) << " proj=" << proj ); texturePos.setX(angle/(2.0f*M_PI)+0.5f); angle = std::acos(proj/1.0f); if (vert.z()<0) { angle = -angle; } - //EGE_WARNING( "angle = " << (angle/M_PI*180.0f) << " from: vert=" << etk::to_string(vert) << " proj=" << proj ); + //EGE_WARNING( "angle = " << (angle/M_PI*180.0f) << " from: vert=" << etk::toString(vert) << " proj=" << proj ); texturePos.setY(angle/(M_PI)+0.5); texturePos.setMax(vec2(0.0f, 0.0f)); texturePos.setMin(vec2(1.0f, 1.0f)); //EGE_WARNING("texturePosition = " << texturePos); - _listUV.push_back(texturePos); + _listUV.pushBack(texturePos); } for (auto &face : tmpElement.m_faces) { float y0 = _listVertex[face.m_vertex[0]].y(); diff --git a/ege/resource/tools/icoSphere.hpp b/ege/resource/tools/icoSphere.hpp index ce70fec..943d152 100644 --- a/ege/resource/tools/icoSphere.hpp +++ b/ege/resource/tools/icoSphere.hpp @@ -12,8 +12,8 @@ namespace ege { namespace icoSphere { - void create(etk::Hash>& _materials, etk::Hash& _listFaces, std::vector& _listVertex, std::vector& _listUV, - const std::string& _materialName, float _size, int32_t _recursionLevel); + void create(etk::Hash>& _materials, etk::Hash& _listFaces, etk::Vector& _listVertex, etk::Vector& _listUV, + const etk::String& _materialName, float _size, int32_t _recursionLevel); } } diff --git a/ege/resource/tools/isoSphere.cpp b/ege/resource/tools/isoSphere.cpp index 089a1b0..3cea467 100644 --- a/ege/resource/tools/isoSphere.cpp +++ b/ege/resource/tools/isoSphere.cpp @@ -7,15 +7,15 @@ #include #include -void ege::isoSphere::create(etk::Hash>& _materials, etk::Hash& _listFaces, std::vector& _listVertex, std::vector& _listUV, - const std::string& _materialName, int32_t _recursionLevel) { - _recursionLevel = std::max(_recursionLevel, 3); +void ege::isoSphere::create(etk::Hash>& _materials, etk::Hash& _listFaces, etk::Vector& _listVertex, etk::Vector& _listUV, + const etk::String& _materialName, int32_t _recursionLevel) { + _recursionLevel = etk::max(_recursionLevel, 3); float size = 1.0f; //Add top and buttom point: - _listVertex.push_back(vec3(0.0f, 0.0f, size)); // 0 (top) - _listVertex.push_back(vec3(0.0f, 0.0f, -size)); // 1 (buttom) - _listUV.push_back(vec2(0.5, 1.0 )); // 0 - _listUV.push_back(vec2(0.5, 0.0 )); // 1 + _listVertex.pushBack(vec3(0.0f, 0.0f, size)); // 0 (top) + _listVertex.pushBack(vec3(0.0f, 0.0f, -size)); // 1 (buttom) + _listUV.pushBack(vec2(0.5, 1.0 )); // 0 + _listUV.pushBack(vec2(0.5, 0.0 )); // 1 for (int32_t iii=0; iii<_recursionLevel; iii++) { diff --git a/ege/resource/tools/isoSphere.hpp b/ege/resource/tools/isoSphere.hpp index 0e5b370..e418155 100644 --- a/ege/resource/tools/isoSphere.hpp +++ b/ege/resource/tools/isoSphere.hpp @@ -12,8 +12,8 @@ namespace ege { namespace isoSphere { - void create(etk::Hash>& _materials, etk::Hash& _listFaces, std::vector& _listVertex, std::vector& _listUV, - const std::string& _materialName, int32_t _recursionLevel); + void create(etk::Hash>& _materials, etk::Hash& _listFaces, etk::Vector& _listVertex, etk::Vector& _listUV, + const etk::String& _materialName, int32_t _recursionLevel); } } diff --git a/ege/resource/tools/viewBox.cpp b/ege/resource/tools/viewBox.cpp index 961dfc4..7fb5a77 100644 --- a/ege/resource/tools/viewBox.cpp +++ b/ege/resource/tools/viewBox.cpp @@ -9,8 +9,8 @@ -void ege::viewBox::create(etk::Hash>& _materials, etk::Hash& _listFaces, std::vector& _listVertex, std::vector& _listUV, - const std::string& _materialName, float _size) { +void ege::viewBox::create(etk::Hash>& _materials, etk::Hash& _listFaces, etk::Vector& _listVertex, etk::Vector& _listUV, + const etk::String& _materialName, float _size) { // This is the direct generation basis on the .obj system /* 5 6 @@ -36,14 +36,14 @@ void ege::viewBox::create(etk::Hash>& _materia o---------------------o 0 3 */ - _listVertex.push_back(vec3( _size, -_size, -_size)); // 0 - _listVertex.push_back(vec3( _size, -_size, _size)); // 1 - _listVertex.push_back(vec3(-_size, -_size, _size)); // 2 - _listVertex.push_back(vec3(-_size, -_size, -_size)); // 3 - _listVertex.push_back(vec3( _size, _size, -_size)); // 4 - _listVertex.push_back(vec3( _size, _size, _size)); // 5 - _listVertex.push_back(vec3(-_size, _size, _size)); // 6 - _listVertex.push_back(vec3(-_size, _size, -_size)); // 7 + _listVertex.pushBack(vec3( _size, -_size, -_size)); // 0 + _listVertex.pushBack(vec3( _size, -_size, _size)); // 1 + _listVertex.pushBack(vec3(-_size, -_size, _size)); // 2 + _listVertex.pushBack(vec3(-_size, -_size, -_size)); // 3 + _listVertex.pushBack(vec3( _size, _size, -_size)); // 4 + _listVertex.pushBack(vec3( _size, _size, _size)); // 5 + _listVertex.pushBack(vec3(-_size, _size, _size)); // 6 + _listVertex.pushBack(vec3(-_size, _size, -_size)); // 7 /* o----------o----------o----------o |8 |9 |10 |11 @@ -66,18 +66,18 @@ void ege::viewBox::create(etk::Hash>& _materia o----------o----------o----------o 0 1 2 3 */ - _listUV.push_back(vec2(0.0 , 0.0 )); // 0 - _listUV.push_back(vec2(1.0/3.0, 0.0 )); // 1 - _listUV.push_back(vec2(2.0/3.0, 0.0 )); // 2 - _listUV.push_back(vec2(1.0 , 0.0 )); // 3 - _listUV.push_back(vec2(0.0 , 0.5 )); // 4 - _listUV.push_back(vec2(1.0/3.0, 0.5 )); // 5 - _listUV.push_back(vec2(2.0/3.0, 0.5 )); // 6 - _listUV.push_back(vec2(1.0 , 0.5 )); // 7 - _listUV.push_back(vec2(0.0 , 1.0 )); // 8 - _listUV.push_back(vec2(1.0/3.0, 1.0 )); // 9 - _listUV.push_back(vec2(2.0/3.0, 1.0 )); // 10 - _listUV.push_back(vec2(1.0 , 1.0 )); // 11 + _listUV.pushBack(vec2(0.0 , 0.0 )); // 0 + _listUV.pushBack(vec2(1.0/3.0, 0.0 )); // 1 + _listUV.pushBack(vec2(2.0/3.0, 0.0 )); // 2 + _listUV.pushBack(vec2(1.0 , 0.0 )); // 3 + _listUV.pushBack(vec2(0.0 , 0.5 )); // 4 + _listUV.pushBack(vec2(1.0/3.0, 0.5 )); // 5 + _listUV.pushBack(vec2(2.0/3.0, 0.5 )); // 6 + _listUV.pushBack(vec2(1.0 , 0.5 )); // 7 + _listUV.pushBack(vec2(0.0 , 1.0 )); // 8 + _listUV.pushBack(vec2(1.0/3.0, 1.0 )); // 9 + _listUV.pushBack(vec2(2.0/3.0, 1.0 )); // 10 + _listUV.pushBack(vec2(1.0 , 1.0 )); // 11 if (_listFaces.exist(_materialName) == false) { FaceIndexing empty; @@ -85,17 +85,17 @@ void ege::viewBox::create(etk::Hash>& _materia } { FaceIndexing& tmpElement = _listFaces[_materialName]; - tmpElement.m_faces.push_back(Face(0,1, 1,5, 2,6)); // 4 - tmpElement.m_faces.push_back(Face(0,1, 2,6, 3,2)); // 4 - tmpElement.m_faces.push_back(Face(4,4, 0,0, 3,1)); // 3 - tmpElement.m_faces.push_back(Face(4,4, 3,1, 7,5)); // 3 - tmpElement.m_faces.push_back(Face(2,6, 6,10, 7,11)); // 2 - tmpElement.m_faces.push_back(Face(2,6, 7,11, 3,7)); // 2 - tmpElement.m_faces.push_back(Face(4,2, 7,3, 6,7)); // 5 - tmpElement.m_faces.push_back(Face(4,2, 6,7, 5,6)); // 5 - tmpElement.m_faces.push_back(Face(1,5, 5,9, 6,10)); // 1 - tmpElement.m_faces.push_back(Face(1,5, 6,10, 2,6)); // 1 - tmpElement.m_faces.push_back(Face(0,4, 4,8, 5,9)); // 0 - tmpElement.m_faces.push_back(Face(0,4, 5,9, 1,5)); // 0 + tmpElement.m_faces.pushBack(Face(0,1, 1,5, 2,6)); // 4 + tmpElement.m_faces.pushBack(Face(0,1, 2,6, 3,2)); // 4 + tmpElement.m_faces.pushBack(Face(4,4, 0,0, 3,1)); // 3 + tmpElement.m_faces.pushBack(Face(4,4, 3,1, 7,5)); // 3 + tmpElement.m_faces.pushBack(Face(2,6, 6,10, 7,11)); // 2 + tmpElement.m_faces.pushBack(Face(2,6, 7,11, 3,7)); // 2 + tmpElement.m_faces.pushBack(Face(4,2, 7,3, 6,7)); // 5 + tmpElement.m_faces.pushBack(Face(4,2, 6,7, 5,6)); // 5 + tmpElement.m_faces.pushBack(Face(1,5, 5,9, 6,10)); // 1 + tmpElement.m_faces.pushBack(Face(1,5, 6,10, 2,6)); // 1 + tmpElement.m_faces.pushBack(Face(0,4, 4,8, 5,9)); // 0 + tmpElement.m_faces.pushBack(Face(0,4, 5,9, 1,5)); // 0 } } diff --git a/ege/resource/tools/viewBox.hpp b/ege/resource/tools/viewBox.hpp index 86d5e69..8aeb0a1 100644 --- a/ege/resource/tools/viewBox.hpp +++ b/ege/resource/tools/viewBox.hpp @@ -12,8 +12,8 @@ namespace ege { namespace viewBox { - void create(etk::Hash>& _materials, etk::Hash& _listFaces, std::vector& _listVertex, std::vector& _listUV, - const std::string& _materialName, float _size); + void create(etk::Hash>& _materials, etk::Hash& _listFaces, etk::Vector& _listVertex, etk::Vector& _listUV, + const etk::String& _materialName, float _size); } } diff --git a/ege/widget/Mesh.cpp b/ege/widget/Mesh.cpp index c1524fe..e762e0c 100644 --- a/ege/widget/Mesh.cpp +++ b/ege/widget/Mesh.cpp @@ -85,7 +85,7 @@ bool ege::widget::Mesh::onEventInput(const ewol::event::Input& _event) { return false; } -void ege::widget::Mesh::setFile(const std::string& _filename) { +void ege::widget::Mesh::setFile(const etk::String& _filename) { if( _filename != "" && m_meshName != _filename ) { m_meshName = _filename; diff --git a/ege/widget/Mesh.hpp b/ege/widget/Mesh.hpp index ad031a0..66a908a 100644 --- a/ege/widget/Mesh.hpp +++ b/ege/widget/Mesh.hpp @@ -19,7 +19,7 @@ namespace ege { esignal::Signal<> signalPressed; private: // mesh name : - std::string m_meshName; + etk::String m_meshName; ememory::SharedPtr m_object; // mesh display properties: vec3 m_position; @@ -48,7 +48,7 @@ namespace ege { * @brief set a mesh name file * @param[in] _filename Name of the new mesh */ - void setFile(const std::string& _filename); + void setFile(const etk::String& _filename); /** * @brief set the mesh position * @param[in] _pos The new position of the mesh diff --git a/ege/widget/Scene.cpp b/ege/widget/Scene.cpp index 70ee374..2ed7b8a 100644 --- a/ege/widget/Scene.cpp +++ b/ege/widget/Scene.cpp @@ -17,7 +17,7 @@ #include namespace etk { - template<> std::string to_string >(const ememory::SharedPtr& _value) { + template<> etk::String toString >(const ememory::SharedPtr& _value) { return "{{ERROR}}"; } }; @@ -119,7 +119,7 @@ void ege::widget::Scene::systemDraw(const ewol::DrawProperty& _displayProp) { } -void ege::widget::Scene::setCamera(const std::string& _cameraName) { +void ege::widget::Scene::setCamera(const etk::String& _cameraName) { if (m_cameraName == _cameraName) { return; } diff --git a/ege/widget/Scene.hpp b/ege/widget/Scene.hpp index d83e86b..fbc1669 100644 --- a/ege/widget/Scene.hpp +++ b/ege/widget/Scene.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -51,23 +51,23 @@ namespace ege { */ virtual ~Scene(); protected: - std::string m_cameraName; //!< current camera name + etk::String m_cameraName; //!< current camera name public: /** * @brief Select a Camera for the display. * @param[in] _cameraName New name of the camera. */ - void setCamera(const std::string& _cameraName); + void setCamera(const etk::String& _cameraName); /** * @brief Get the current camera name to display the environnement. * @return the current camera name. */ - const std::string& getCamera() const { + const etk::String& getCamera() const { return m_cameraName; } protected: // Note : This is only for temporary entitys : on the display - std::vector m_displayEntityOrdered; + etk::Vector m_displayEntityOrdered; protected: esignal::Connection m_PCH; //!< Periodic call handle to remove it when needed /** diff --git a/sample/CameraPosition/appl/main.cpp b/sample/CameraPosition/appl/main.cpp index cf31945..939d939 100644 --- a/sample/CameraPosition/appl/main.cpp +++ b/sample/CameraPosition/appl/main.cpp @@ -23,7 +23,7 @@ class MainApplication : public ewol::context::Application { void onCreate(ewol::Context& _context) override { APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)"); for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { - std::string tmpppp = _context.getCmd().get(iii); + etk::String tmpppp = _context.getCmd().get(iii); if ( tmpppp == "-h" || tmpppp == "--help") { APPL_INFO(" -h/--help display this help" ); diff --git a/sample/CameraPosition/lutin_ege-sample-camera-position.py b/sample/CameraPosition/lutin_ege-sample-camera-position.py index 904ff90..04ca52e 100644 --- a/sample/CameraPosition/lutin_ege-sample-camera-position.py +++ b/sample/CameraPosition/lutin_ege-sample-camera-position.py @@ -47,7 +47,7 @@ def configure(target, my_module): my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\"" ]) # set the package properties: diff --git a/sample/Collision/appl/main.cpp b/sample/Collision/appl/main.cpp index cf31945..939d939 100644 --- a/sample/Collision/appl/main.cpp +++ b/sample/Collision/appl/main.cpp @@ -23,7 +23,7 @@ class MainApplication : public ewol::context::Application { void onCreate(ewol::Context& _context) override { APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)"); for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { - std::string tmpppp = _context.getCmd().get(iii); + etk::String tmpppp = _context.getCmd().get(iii); if ( tmpppp == "-h" || tmpppp == "--help") { APPL_INFO(" -h/--help display this help" ); diff --git a/sample/Collision/lutin_ege-sample-collision.py b/sample/Collision/lutin_ege-sample-collision.py index b941c3b..b0f3c30 100644 --- a/sample/Collision/lutin_ege-sample-collision.py +++ b/sample/Collision/lutin_ege-sample-collision.py @@ -47,7 +47,7 @@ def configure(target, my_module): my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\"" ]) # set the package properties : diff --git a/sample/DoubleView/appl/main.cpp b/sample/DoubleView/appl/main.cpp index cf31945..939d939 100644 --- a/sample/DoubleView/appl/main.cpp +++ b/sample/DoubleView/appl/main.cpp @@ -23,7 +23,7 @@ class MainApplication : public ewol::context::Application { void onCreate(ewol::Context& _context) override { APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)"); for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { - std::string tmpppp = _context.getCmd().get(iii); + etk::String tmpppp = _context.getCmd().get(iii); if ( tmpppp == "-h" || tmpppp == "--help") { APPL_INFO(" -h/--help display this help" ); diff --git a/sample/DoubleView/lutin_ege-sample-double-view.py b/sample/DoubleView/lutin_ege-sample-double-view.py index a5990f2..8e769c5 100644 --- a/sample/DoubleView/lutin_ege-sample-double-view.py +++ b/sample/DoubleView/lutin_ege-sample-double-view.py @@ -47,7 +47,7 @@ def configure(target, my_module): my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\"" ]) # set the package properties: diff --git a/sample/LowPoly/appl/main.cpp b/sample/LowPoly/appl/main.cpp index cf31945..939d939 100644 --- a/sample/LowPoly/appl/main.cpp +++ b/sample/LowPoly/appl/main.cpp @@ -23,7 +23,7 @@ class MainApplication : public ewol::context::Application { void onCreate(ewol::Context& _context) override { APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)"); for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { - std::string tmpppp = _context.getCmd().get(iii); + etk::String tmpppp = _context.getCmd().get(iii); if ( tmpppp == "-h" || tmpppp == "--help") { APPL_INFO(" -h/--help display this help" ); diff --git a/sample/LowPoly/lutin_ege-sample-low-poly.py b/sample/LowPoly/lutin_ege-sample-low-poly.py index f8facb3..feb0e57 100644 --- a/sample/LowPoly/lutin_ege-sample-low-poly.py +++ b/sample/LowPoly/lutin_ege-sample-low-poly.py @@ -47,7 +47,7 @@ def configure(target, my_module): my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\"" ]) # set the package properties: diff --git a/sample/MeshCreator/appl/Windows.cpp b/sample/MeshCreator/appl/Windows.cpp index 425d4f1..2bc19d6 100644 --- a/sample/MeshCreator/appl/Windows.cpp +++ b/sample/MeshCreator/appl/Windows.cpp @@ -160,7 +160,7 @@ void appl::Windows::setDebugShape() { m_env->getEngine("physics")->properties.set("debug-shape", "true"); } -void appl::Windows::setMeshName(const std::string& _fileName) { +void appl::Windows::setMeshName(const etk::String& _fileName) { // Create an external box: (no physics) ememory::SharedPtr myMesh = ege::resource::Mesh::create(_fileName); if (myMesh != nullptr) { diff --git a/sample/MeshCreator/appl/Windows.hpp b/sample/MeshCreator/appl/Windows.hpp index cb3645d..47b69fc 100644 --- a/sample/MeshCreator/appl/Windows.hpp +++ b/sample/MeshCreator/appl/Windows.hpp @@ -27,7 +27,7 @@ namespace appl { private: void onCallbackPeriodicUpdateCamera(const ewol::event::Time& _event); public: - void setMeshName(const std::string& _fileName); + void setMeshName(const etk::String& _fileName); void setDebugNormal(); void setDebugAABB(); void setDebugShape(); diff --git a/sample/MeshCreator/appl/main.cpp b/sample/MeshCreator/appl/main.cpp index 5fbf9d5..6d64f64 100644 --- a/sample/MeshCreator/appl/main.cpp +++ b/sample/MeshCreator/appl/main.cpp @@ -33,7 +33,7 @@ class MainApplication : public ewol::context::Application { ememory::SharedPtr basicWindows = appl::Windows::create(); for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { - std::string tmpppp = _context.getCmd().get(iii); + etk::String tmpppp = _context.getCmd().get(iii); if ( tmpppp == "-h" || tmpppp == "--help") { APPL_PRINT(" -h/--help display this help"); @@ -43,7 +43,7 @@ class MainApplication : public ewol::context::Application { APPL_PRINT(" --debug-shape Display Shape"); exit(0); } else if (etk::start_with(tmpppp, "--mesh=") == true) { - std::string fileName = &tmpppp[7]; + etk::String fileName = &tmpppp[7]; basicWindows->setMeshName(fileName); } else if (tmpppp == "--debug-normal") { basicWindows->setDebugNormal(); diff --git a/sample/MeshCreator/lutin_ege-sample-mesh-creator.py b/sample/MeshCreator/lutin_ege-sample-mesh-creator.py index a2c9b20..3dbf9d7 100644 --- a/sample/MeshCreator/lutin_ege-sample-mesh-creator.py +++ b/sample/MeshCreator/lutin_ege-sample-mesh-creator.py @@ -46,7 +46,7 @@ def configure(target, my_module): my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\"" ]) # set the package properties: diff --git a/sample/RayTest/appl/Windows.cpp b/sample/RayTest/appl/Windows.cpp index b26e92d..ca13bd3 100644 --- a/sample/RayTest/appl/Windows.cpp +++ b/sample/RayTest/appl/Windows.cpp @@ -181,20 +181,20 @@ bool appl::Windows::onEventInput(const ewol::event::Input& _event) { if (_event.getStatus() == gale::key::status::down) { vec2 pos = relativePosition(_event.getPos()); ege::Ray ray = m_camera->getRayFromScreenPosition(pos, m_size); - m_ray = std::make_pair(ray.getOrigin(), ray.getOrigin()+ray.getDirection()*50000); + m_ray = etk::makePair(ray.getOrigin(), ray.getOrigin()+ray.getDirection()*50000); APPL_DEBUG("pos=" << pos << " ray = " << ray); ememory::SharedPtr engine = ememory::dynamicPointerCast(m_env->getEngine("physics")); if (engine != nullptr) { /* - std::pair, std::pair> result = engine->testRayObject(m_ray); + etk::Pair, etk::Pair> result = engine->testRayObject(m_ray); if (result.first != nullptr) { APPL_INFO("Select Object :" << result.first->getUID()); } */ - std::pair result = engine->testRay(ray); + etk::Pair result = engine->testRay(ray); if (result.second != vec3(0,0,0)) { APPL_INFO("impact at: pos=" << result.first << " normal=" << result.second); - m_destination = std::make_pair(result.first, result.first+result.second*50); + m_destination = etk::makePair(result.first, result.first+result.second*50); m_ray.second = result.first; } } @@ -210,10 +210,10 @@ void appl::Windows::onCallbackDisplayDebug(const ememory::SharedPtr vertices; + static etk::Vector vertices; if (m_ray.first != vec3(0,0,0)) { - vertices.push_back(m_ray.first); - vertices.push_back(m_ray.second); + vertices.pushBack(m_ray.first); + vertices.pushBack(m_ray.second); // prevent Ray removing with empty m_ray.first = vec3(0,0,0); } @@ -224,10 +224,10 @@ void appl::Windows::onCallbackDisplayDebug(const ememory::SharedPtr vertices; + static etk::Vector vertices; if (m_destination.second != vec3(0,0,0)) { - vertices.push_back(m_destination.first); - vertices.push_back(m_destination.second); + vertices.pushBack(m_destination.first); + vertices.pushBack(m_destination.second); m_destination.second = vec3(0,0,0); } if (vertices.size() > 250) { diff --git a/sample/RayTest/appl/Windows.hpp b/sample/RayTest/appl/Windows.hpp index 7899a4d..a6bbbe9 100644 --- a/sample/RayTest/appl/Windows.hpp +++ b/sample/RayTest/appl/Windows.hpp @@ -31,8 +31,8 @@ namespace appl { bool onEventEntry(const ewol::event::Entry& _event) override; bool onEventInput(const ewol::event::Input& _event) override; void onCallbackDisplayDebug(const ememory::SharedPtr& _obj); - std::pair m_ray; - std::pair m_destination; + etk::Pair m_ray; + etk::Pair m_destination; }; } diff --git a/sample/RayTest/appl/main.cpp b/sample/RayTest/appl/main.cpp index cf31945..939d939 100644 --- a/sample/RayTest/appl/main.cpp +++ b/sample/RayTest/appl/main.cpp @@ -23,7 +23,7 @@ class MainApplication : public ewol::context::Application { void onCreate(ewol::Context& _context) override { APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)"); for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { - std::string tmpppp = _context.getCmd().get(iii); + etk::String tmpppp = _context.getCmd().get(iii); if ( tmpppp == "-h" || tmpppp == "--help") { APPL_INFO(" -h/--help display this help" ); diff --git a/sample/RayTest/lutin_ege-sample-raytracing.py b/sample/RayTest/lutin_ege-sample-raytracing.py index 1011b6f..e5d008e 100644 --- a/sample/RayTest/lutin_ege-sample-raytracing.py +++ b/sample/RayTest/lutin_ege-sample-raytracing.py @@ -47,7 +47,7 @@ def configure(target, my_module): my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\"" ]) # set the package properties: diff --git a/sample/TorqueApply/appl/main.cpp b/sample/TorqueApply/appl/main.cpp index cf31945..939d939 100644 --- a/sample/TorqueApply/appl/main.cpp +++ b/sample/TorqueApply/appl/main.cpp @@ -23,7 +23,7 @@ class MainApplication : public ewol::context::Application { void onCreate(ewol::Context& _context) override { APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)"); for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { - std::string tmpppp = _context.getCmd().get(iii); + etk::String tmpppp = _context.getCmd().get(iii); if ( tmpppp == "-h" || tmpppp == "--help") { APPL_INFO(" -h/--help display this help" ); diff --git a/sample/TorqueApply/lutin_ege-sample-torque-apply.py b/sample/TorqueApply/lutin_ege-sample-torque-apply.py index 9da478b..56093af 100644 --- a/sample/TorqueApply/lutin_ege-sample-torque-apply.py +++ b/sample/TorqueApply/lutin_ege-sample-torque-apply.py @@ -47,7 +47,7 @@ def configure(target, my_module): my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\"" ]) # set the package properties :