[DOC] basic step ended all documented

This commit is contained in:
Edouard DUPIN 2016-04-04 21:55:27 +02:00
parent 5f287ebdfe
commit 57c20d0aae
11 changed files with 134 additions and 113 deletions

View File

@ -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.

50
doc/mainpage.md Normal file
View File

@ -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
<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.

View File

@ -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'
])

View File

@ -93,7 +93,7 @@ namespace etk {
* @return reference on this element.
*/
Color<MY_TYPE,MY_TYPE_SIZE>& operator=(const etk::Color<MY_TYPE,MY_TYPE_SIZE>& _input) {
for (size_t iii=0; iii<MY_TYPE_SIZE;iii) {
for (size_t iii=0; iii<MY_TYPE_SIZE; ++iii) {
m_element[iii] = _input.m_element[iii];
}
return *this;
@ -105,7 +105,7 @@ namespace etk {
* @return false This is the same color.
*/
bool operator!= (const etk::Color<MY_TYPE,MY_TYPE_SIZE>& _obj) const {
for (size_t iii=0; iii<MY_TYPE_SIZE;iii) {
for (size_t iii=0; iii<MY_TYPE_SIZE;++iii) {
if(m_element[iii] != _obj.m_element[iii]) {
return true;
}
@ -119,7 +119,7 @@ namespace etk {
* @return false The color are different.
*/
bool operator== (const etk::Color<MY_TYPE,MY_TYPE_SIZE>& _obj) const {
for (size_t iii=0; iii<MY_TYPE_SIZE;iii) {
for (size_t iii=0; iii<MY_TYPE_SIZE;++iii) {
if(m_element[iii] != _obj.m_element[iii]) {
return false;
}
@ -645,7 +645,7 @@ namespace etk {
}
//! @not_in_doc
template<typename MY_TYPE, int MY_TYPE_SIZE> std::ostream& operator <<(std::ostream& _os, const std::vector<Color<MY_TYPE, MY_TYPE_SIZE> >& _obj) {
for (size_t iii = 0; iii < _obj.size();iii) {
for (size_t iii = 0; iii < _obj.size(); ++iii) {
if (iii != 0) {
_os << " ";
}

View File

@ -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<m_size.y(); iii++) {

View File

@ -46,7 +46,7 @@ namespace etk {
noiseType_base, //!< basic random noise
noiseType_smooth, //!< Noise smoothed
noiseType_turbulence, //!< Noise in turbulence mode
noiseType_turbulence_no_smooth, //!< Noise Turbulence with no smooth apply
noiseType_turbulenceNoSmooth, //!< Noise Turbulence with no smooth apply
noiseType_cloud, //!< Noise like a cloud
noiseType_marble, //!< Noise like marble
noiseType_wood //!< Noise like wood

View File

@ -15,7 +15,7 @@ namespace etk {
* @brief Transformation matrix for vector 2D.
*/
class Matrix2 {
private:
public:
/**
* @brief Internal data
* sx shx tx
@ -173,6 +173,12 @@ namespace etk {
* @return The inverted matrix.
*/
void invert();
friend Matrix2 mat2Rotate(float);
friend Matrix2 mat2Scale(const vec2&);
friend Matrix2 mat2Scale(float);
friend Matrix2 mat2Translate(const vec2&);
friend Matrix2 mat2Skew(const vec2&);
friend std::ostream& operator <<(std::ostream&, const etk::Matrix2&);
};
/**
* @brief Create a matrix 2D with a simple rotation

View File

@ -397,42 +397,4 @@ std::ostream& etk::operator <<(std::ostream& _os, const etk::Matrix4& _obj) {
_os << ",";
}
return _os;
}
#else
std::ostream& operator <<(std::ostream& _os, const mat4& _obj) {
_os << "matrix4 : ({";
for (int32_t iii=0; iii<4; iii++) {
if (iii!= 0) {
_os << "},{";
}
for (int32_t jjj=0; jjj<4; jjj++) {
if (jjj!= 0) {
_os << ",";
}
_os << _obj.getElem(jjj,iii);
}
}
_os << "})";
return _os;
}
mat4 etk::matTranslate(const vec3& _vect) {
mat4 tmp;
tmp.translation(_vect);
return tmp;
}
mat4 etk::matScale(const vec3& _vect) {
mat4 tmp;
tmp.scale(_vect);
return tmp;
}
mat4 etk::matRotate(const vec3& _vect, float _angleRad) {
mat4 tmp;
tmp.rotation(_angleRad, _vect);
return tmp;
}
}

View File

@ -14,25 +14,30 @@
#include <math.h>
/**
* @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<class T>
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<class T>
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);

View File

@ -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) {

View File

@ -13,7 +13,7 @@
#include <etk/Hash.h>
#include <etk/os/FSNode.h>
#include <etk/archive/Archive.h>
#include <elog/log.h>
#include <etk/etk.h>
#include <etk/Color.h>
#include <etk/stdTools.h>
#include <string>
@ -30,9 +30,7 @@ int main(int argc, const char *argv[]) {
// init Google test :
::testing::InitGoogleTest(&argc, const_cast<char **>(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();
}