diff --git a/doc/index.bb b/doc/index.bb deleted file mode 100644 index ddd5a04..0000000 --- a/doc/index.bb +++ /dev/null @@ -1,42 +0,0 @@ -== [center]ETK library[/center] == -__________________________________________________ - -===What is ETK, and how can I use it?=== -ETK, or Ewol Tool kit is a simple abstraction layer for some elements like mutex, std missing element(in android or MacOS) and ... - -We can simply say: Just a tool-box - - -ETK is composed of some part: -:** Log system interface -:** File access abstraction (for android, data are stored in a .apk (== zip file)) -:** Mutex / semaphore abstraction (can not use pthread on windows) -:** Regular expression -:** Generic color interface -:** Std adding missing element on some platform. - - - -===What languages are supported?=== -ETK is written in C++. - - -===Are there any licensing restrictions?=== -ETK is [b]FREE software[/b] - - -==== License (APACHE-2.0) ==== -Copyright etk Edouard DUPIN - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - diff --git a/doc/mainpage.md b/doc/mainpage.md new file mode 100644 index 0000000..5330345 --- /dev/null +++ b/doc/mainpage.md @@ -0,0 +1,50 @@ +ETK library {#mainpage} +=========== + +What is ETK, and how can I use it? +---------------------------------- + +ETK, or Ewol Tool kit is a simple abstraction layer for some elements like mutex, std missing element(in android or MacOS) and ... + +We can simply say: Just a tool-box **(I use it to add many test prototyping ... and bad things ...)** + + +ETK is composed of some part: + - Log system interface + - File access abstraction (for android, data are stored in a .apk (== zip file)) + - Mutex / semaphore abstraction (can not use pthread on windows) + - Regular expression + - Generic color interface + - Std adding missing element on some platform. + + + +What languages are supported? +----------------------------- + +ETK is written in C++. + + +Are there any licensing restrictions? +------------------------------------- + +ETK is **FREE software** and //all sub-library are FREE and staticly linkable !!!// + + +License (APACHE-2.0) +-------------------- + +Copyright etk Edouard DUPIN + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + diff --git a/doxy_etk.py b/doxy_etk.py index ef377a3..10a3181 100644 --- a/doxy_etk.py +++ b/doxy_etk.py @@ -10,7 +10,11 @@ def create(target, module_name): my_module.set_title("Etk: Ewol Tool Kit") my_module.set_website("http://atria-soft.github.io/" + module_name) my_module.set_website_sources("http://github.com/atria-soft/" + module_name) - my_module.set_path(os.path.join(tools.get_current_path(__file__), module_name)) + my_module.add_path([ + module_name, + "doc" + ]) + my_module.add_data_path("data/dox") my_module.add_module_depend([ 'elog' ]) diff --git a/etk/Color.h b/etk/Color.h index 38b08d4..9fad0bb 100644 --- a/etk/Color.h +++ b/etk/Color.h @@ -93,7 +93,7 @@ namespace etk { * @return reference on this element. */ Color& operator=(const etk::Color& _input) { - for (size_t iii=0; iii& _obj) const { - for (size_t iii=0; iii& _obj) const { - for (size_t iii=0; iii std::ostream& operator <<(std::ostream& _os, const std::vector >& _obj) { - for (size_t iii = 0; iii < _obj.size();iii) { + for (size_t iii = 0; iii < _obj.size(); ++iii) { if (iii != 0) { _os << " "; } diff --git a/etk/Noise.cpp b/etk/Noise.cpp index 2757dc2..cffabcb 100644 --- a/etk/Noise.cpp +++ b/etk/Noise.cpp @@ -119,7 +119,7 @@ etk::Noise::Noise(enum etk::noiseType _type, ivec2 _size, int32_t _depth) : } } break; - case etk::noiseType_turbulence_no_smooth: + case etk::noiseType_turbulenceNoSmooth: { etk::BaseNoise myNoise(ivec2(m_size.x()/_depth,m_size.y()/_depth),0.0f,1.0f); for(int32_t iii=0; iii -/** - * @brief Convert degree in radian - * @param[in] a Value to converted in degree - * @return Angle in radian - */ -#define DEG_TO_RAD(a) ((a)*M_PI/180.0f) -/** - * @brief Convert radian in degree - * @param[in] a Value to converted in radian - * @return Angle in degree - */ -#define RAD_TO_DEG(a) ((a)*180.0f/M_PI) - namespace etk { + /** + * @brief Convert degree in radian + * @param[in] _val Value to converted in degree + * @return Angle in radian + */ + template + T degreeToRadian(T _val) { + return _val*M_PI/T(180.0); + } + /** + * @brief Convert radian in degree + * @param[in] _val Value to converted in radian + * @return Angle in degree + */ + template + T radianToDegree(T _val) { + return _val*T(180.0)/M_PI; + } /** * @brief Transformation matrix for vector 3D. */ class Matrix4 { - private: + public: float m_mat[4*4]; //!< matrix data public: /** @@ -183,9 +188,46 @@ namespace etk { * @return The inverted matrix. */ Matrix4 invert(); + friend etk::Matrix4 etk::matFrustum(float, float, float, float, float, float); + friend etk::Matrix4 etk::matPerspective(float, float, float, float); + friend etk::Matrix4 etk::matOrtho(float, float, float, float, float, float); + friend etk::Matrix4 etk::matTranslate(vec3); + friend etk::Matrix4 etk::matScale(vec3); + friend etk::Matrix4 etk::matRotate(vec3, float); + friend etk::Matrix4 etk::matRotate2(vec3); + friend etk::Matrix4 etk::matLookAt(const vec3&, const vec3&, const vec3&); + friend std::ostream& operator <<(std::ostream&, const etk::Matrix4&); }; + /** + * @brief Create projection matrix with the box parameter (camera view in -z axis) + * @param[in] _xmin X minimum size of the frustum + * @param[in] _xmax X maximum size of the frustum + * @param[in] _ymin Y minimum size of the frustum + * @param[in] _ymax Y maximum size of the frustum + * @param[in] _zNear Z minimum size of the frustum + * @param[in] _zFar Z maximum size of the frustum + * @return New matrix of the transformation requested + */ Matrix4 matFrustum(float _xmin, float _xmax, float _ymin, float _ymax, float _zNear, float _zFar); + /** + * @brief Create projection matrix with human repensentation view (camera view in -z axis) + * @param[in] _foxy Focal in radian of the camera + * @param[in] _aspect aspect ratio of the camera + * @param[in] _zNear Z near size of the camera + * @param[in] _zFar Z far size of the camera + * @return New matrix of the transformation requested + */ Matrix4 matPerspective(float _foxy, float _aspect, float _zNear, float _zFar); + /** + * @brief Create orthogonal projection matrix with the box parameter (camera view in -z axis) + * @param[in] _left left size of the camera + * @param[in] _right Right size of the camera + * @param[in] _bottom Buttom size of the camera + * @param[in] _top Top Size of the camera + * @param[in] _nearVal Z near size of the camera + * @param[in] _farVal Z far size of the camera + * @return New matrix of the transformation requested + */ Matrix4 matOrtho(float _left, float _right, float _bottom, float _top, float _nearVal, float _farVal); /** * @brief Create a matrix 3D with a simple translation @@ -207,7 +249,13 @@ namespace etk { */ Matrix4 matRotate(vec3 _normal, float _angleRad=0.0); //! @not_in_doc - Matrix4 matRotate2(vec3 _vect); + Matrix4 matRotate2(vec3 _vect); /** + * @brief Create projection matrix with camera property (camera view in -z axis) + * @param[in] _eye Optical center of the camera + * @param[in] _target Point of where the camera is showing + * @param[in] _up Up vector of the camera + * @return New matrix of the transformation requested + */ Matrix4 matLookAt(const vec3& _eye, const vec3& _target, const vec3& _up); diff --git a/etk/os/FSNodeRight.cpp b/etk/os/FSNodeRight.cpp index 8fd788d..b5a2eaa 100644 --- a/etk/os/FSNodeRight.cpp +++ b/etk/os/FSNodeRight.cpp @@ -22,11 +22,6 @@ enum { right_user_read = 1 << 8, }; -etk::FSNodeRight::FSNodeRight() : - m_rights(0) { - -} - etk::FSNodeRight::FSNodeRight(int16_t _newRight) : m_rights(_newRight&0x01FF) { diff --git a/test/main.cpp b/test/main.cpp index 3239715..45a09d1 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -30,9 +30,7 @@ int main(int argc, const char *argv[]) { // init Google test : ::testing::InitGoogleTest(&argc, const_cast(argv)); // the only one init for etk: - //elog::setLevel(elog::logLevelVerbose); - elog::setLevel(elog::logLevelInfo); - etk::setArgZero(argv[0]); + etk::init(argc, argv); etk::initDefaultFolder("ewolApplNoName"); return RUN_ALL_TESTS(); }