From a3f4d0d129221ea06c6331f0c8fa9a8bd9b0d458 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Fri, 25 Oct 2013 20:47:46 +0200 Subject: [PATCH] [DEV] update Debug in debug --- etk/Char.cpp | 3 +- etk/Char.h | 2 - etk/Color.cpp | 2 +- etk/Hash.h | 2 +- etk/Noise.cpp | 2 +- etk/RegExp.h | 2 +- etk/Stream.cpp | 2 +- etk/UChar.cpp | 2 +- etk/UString.cpp | 2 +- etk/UString.h | 3 +- etk/Vector.h | 2 +- etk/archive/Archive.cpp | 2 +- etk/archive/Zip.cpp | 2 +- etk/{DebugInternal.cpp => debug.cpp} | 2 + etk/{DebugInternal.h => debug.h} | 7 +- etk/{Debug.cpp => debugGeneric.cpp} | 2 +- etk/{Debug.h => debugGeneric.h} | 4 +- etk/math/Matrix4.cpp | 2 +- etk/math/Plane.h | 110 +++++++++++---------------- etk/math/Vector3D.h | 2 +- etk/math/Vector4D.h | 2 +- etk/os/FSNode.cpp | 2 +- etk/os/FSNodeRight.cpp | 2 +- etk/os/Mutex.Generic.cpp | 2 +- etk/os/Semaphore.Generic.cpp | 2 +- etk/os/Semaphore.Windows.cpp | 2 +- etk/unicode.cpp | 2 +- etk/unicodeTable.cpp | 2 +- lutin_etk.py | 4 +- test/main.cpp | 3 +- 30 files changed, 79 insertions(+), 101 deletions(-) rename etk/{DebugInternal.cpp => debug.cpp} (87%) rename etk/{DebugInternal.h => debug.h} (88%) rename etk/{Debug.cpp => debugGeneric.cpp} (98%) rename etk/{Debug.h => debugGeneric.h} (97%) diff --git a/etk/Char.cpp b/etk/Char.cpp index 16e6c7c..ad93ca0 100644 --- a/etk/Char.cpp +++ b/etk/Char.cpp @@ -7,7 +7,8 @@ */ #include - +#include +#include etk::Char::Char(void) { m_data.pushBack('\0'); diff --git a/etk/Char.h b/etk/Char.h index c8fda32..1216029 100644 --- a/etk/Char.h +++ b/etk/Char.h @@ -9,8 +9,6 @@ #ifndef __ETK_CHAR_H__ #define __ETK_CHAR_H__ -#include -#include #include namespace etk diff --git a/etk/Color.cpp b/etk/Color.cpp index cc39e76..37cdf3f 100644 --- a/etk/Color.cpp +++ b/etk/Color.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include static bool strnCmpNoCase(const char * input1, const char * input2, int32_t maxLen) { diff --git a/etk/Hash.h b/etk/Hash.h index c038411..3259ee8 100644 --- a/etk/Hash.h +++ b/etk/Hash.h @@ -10,7 +10,7 @@ #define __ETK_HACH_H__ #include -#include +#include #include #include diff --git a/etk/Noise.cpp b/etk/Noise.cpp index c33517b..cac789f 100644 --- a/etk/Noise.cpp +++ b/etk/Noise.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include #include // for the rand ... diff --git a/etk/RegExp.h b/etk/RegExp.h index c643cf8..150350a 100644 --- a/etk/RegExp.h +++ b/etk/RegExp.h @@ -10,7 +10,7 @@ #define __TK_REG_EXP_H__ #include -#include +#include #include #include diff --git a/etk/Stream.cpp b/etk/Stream.cpp index 5ef2174..9e573d7 100644 --- a/etk/Stream.cpp +++ b/etk/Stream.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #if defined(__TARGET_OS__Linux) && DEBUG_LEVEL > 2 #include diff --git a/etk/UChar.cpp b/etk/UChar.cpp index 877f85d..1c7c3b7 100644 --- a/etk/UChar.cpp +++ b/etk/UChar.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/etk/UString.cpp b/etk/UString.cpp index 4a53c60..afe139a 100644 --- a/etk/UString.cpp +++ b/etk/UString.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include int32_t strlen(const etk::UChar * _data) { diff --git a/etk/UString.h b/etk/UString.h index d1d14fb..815cb4c 100644 --- a/etk/UString.h +++ b/etk/UString.h @@ -9,8 +9,7 @@ #ifndef __ETK_USTRING_H__ #define __ETK_USTRING_H__ -#include -#include +#include #include #include #include diff --git a/etk/Vector.h b/etk/Vector.h index 6da375c..588f0f2 100644 --- a/etk/Vector.h +++ b/etk/Vector.h @@ -10,7 +10,7 @@ #define __ETK_VECTOR_H__ #include -#include +#include #undef __class__ #define __class__ "etk::Vector" diff --git a/etk/archive/Archive.cpp b/etk/archive/Archive.cpp index cf3c98d..259ff3e 100644 --- a/etk/archive/Archive.cpp +++ b/etk/archive/Archive.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include const etk::Archive::Content& etk::Archive::getContent(const etk::UString& _key) const { diff --git a/etk/archive/Zip.cpp b/etk/archive/Zip.cpp index e554b18..9299018 100644 --- a/etk/archive/Zip.cpp +++ b/etk/archive/Zip.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include etk::archive::Zip::Zip(const etk::UString& _fileName) : etk::Archive(_fileName), diff --git a/etk/DebugInternal.cpp b/etk/debug.cpp similarity index 87% rename from etk/DebugInternal.cpp rename to etk/debug.cpp index fc83830..8952300 100644 --- a/etk/DebugInternal.cpp +++ b/etk/debug.cpp @@ -6,4 +6,6 @@ * @license BSD v3 (see license file) */ +#include + const char * etkLibName = "Etk "; diff --git a/etk/DebugInternal.h b/etk/debug.h similarity index 88% rename from etk/DebugInternal.h rename to etk/debug.h index 9c707bf..c0de20c 100644 --- a/etk/DebugInternal.h +++ b/etk/debug.h @@ -6,11 +6,10 @@ * @license BSD v3 (see license file) */ -#include "etk/Debug.h" - -#ifndef __ETK_DEBUG_INTERNAL_H__ -#define __ETK_DEBUG_INTERNAL_H__ +#ifndef __ETK_DEBUG_H__ +#define __ETK_DEBUG_H__ +#include extern const char * etkLibName; diff --git a/etk/Debug.cpp b/etk/debugGeneric.cpp similarity index 98% rename from etk/Debug.cpp rename to etk/debugGeneric.cpp index dd9163e..aaa2a5c 100644 --- a/etk/Debug.cpp +++ b/etk/debugGeneric.cpp @@ -6,7 +6,7 @@ * @license BSD v3 (see license file) */ -#include +#include #include // Max string size : (wide screan console nb caractere) diff --git a/etk/Debug.h b/etk/debugGeneric.h similarity index 97% rename from etk/Debug.h rename to etk/debugGeneric.h index 933bb19..1b647a1 100644 --- a/etk/Debug.h +++ b/etk/debugGeneric.h @@ -6,8 +6,8 @@ * @license BSD v3 (see license file) */ -#ifndef __ETK_DEBUG_H__ -#define __ETK_DEBUG_H__ +#ifndef __ETK_DEBUG_GENERIC_H__ +#define __ETK_DEBUG_GENERIC_H__ #include #include diff --git a/etk/math/Matrix4.cpp b/etk/math/Matrix4.cpp index 646e217..7acf1bd 100644 --- a/etk/math/Matrix4.cpp +++ b/etk/math/Matrix4.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include diff --git a/etk/math/Plane.h b/etk/math/Plane.h index 62f37bb..991d3af 100644 --- a/etk/math/Plane.h +++ b/etk/math/Plane.h @@ -9,44 +9,38 @@ #ifndef __ETK_TYPES_PLANE_H__ #define __ETK_TYPES_PLANE_H__ -#include -#include +#include #include namespace etk { - template class Plane - { + template class Plane { public : //member variables - etk::Vector3D m_normal; //X.N+intercept=0 - T m_intercept; + etk::Vector3D m_normal; //!< X.N+intercept=0 + T m_intercept; public: /***************************************************** * Constructor *****************************************************/ Plane(void) : - m_normal(0, 0, 0), - m_intercept(0) - { + m_normal(0, 0, 0), + m_intercept(0) { } Plane(etk::Vector3D _normal, T _intercept=0) : - m_normal(_normal), - m_intercept(_intercept) - { + m_normal(_normal), + m_intercept(_intercept) { } Plane(const Plane& obj) : - m_normal(obj.m_normal), - m_intercept(obj.m_intercept) - { + m_normal(obj.m_normal), + m_intercept(obj.m_intercept) { } /***************************************************** * Destructor *****************************************************/ - ~Plane(void) - { + ~Plane(void) { }; @@ -55,9 +49,8 @@ namespace etk { * @param[in,out] * @return */ - void setNormal(const etk::Vector3D& obj) - { - m_normal=obj; + void setNormal(const etk::Vector3D& _obj) { + m_normal = _obj; }; /** @@ -65,8 +58,7 @@ namespace etk { * @param[in,out] * @return */ - void setIntercept(float _intercept) - { + void setIntercept(float _intercept) { m_intercept=_intercept; }; @@ -75,13 +67,12 @@ namespace etk { * @param[in,out] * @return */ - void setFromPoints(const etk::Vector3D & p0, - const etk::Vector3D & p1, - const etk::Vector3D & p2) - { - m_normal=(p1-p0).crossProduct(p2-p0); + void setFromPoints(const etk::Vector3D& p0, + const etk::Vector3D& p1, + const etk::Vector3D& p2) { + m_normal = (_p1 - _p0).crossProduct(_p2 - _p0); m_normal.normalize(); - calculateIntercept(p0); + calculateIntercept(_p0); }; /** @@ -89,9 +80,8 @@ namespace etk { * @param[in,out] * @return */ - void calculateIntercept(const etk::Vector3D& pointOnPlane) - { - m_intercept=-m_normal.dotProduct(pointOnPlane); + void calculateIntercept(const etk::Vector3D& _pointOnPlane) { + m_intercept=-m_normal.dotProduct(_pointOnPlane); } /** @@ -99,8 +89,7 @@ namespace etk { * @param[in,out] * @return */ - void normalize(void) - { + void normalize(void) { float normalLength=m_normal.getLength(); m_normal/=normalLength; m_intercept/=normalLength; @@ -111,8 +100,7 @@ namespace etk { * @param[in,out] * @return */ - etk::Vector3D getNormal(void) - { + etk::Vector3D getNormal(void) { return m_normal; }; @@ -121,8 +109,7 @@ namespace etk { * @param[in,out] * @return */ - float getIntercept() - { + float getIntercept(void) { return m_intercept; } @@ -132,20 +119,19 @@ namespace etk { * @param[in,out] * @return */ - bool intersect3(const Plane& p2, - const Plane & p3, - etk::Vector3D & result) - { - float denominator=m_normal.dotProduct((p2.m_normal).crossProduct(p3.m_normal)); + bool intersect3(const Plane& _p2, + const Plane& _p3, + etk::Vector3D& _result) { + float denominator = m_normal.dotProduct((_p2.m_normal).crossProduct(_p3.m_normal)); //scalar triple product of normals if(denominator==0.0f) { //no intersection return false; } etk::Vector3D temp1, temp2, temp3; - temp1=(p2.m_normal.crossProduct(p3.m_normal))*m_intercept; - temp2=(p3.m_normal.crossProduct(m_normal))*p2.m_intercept; - temp3=(m_normal.crossProduct(p2.m_normal))*p3.m_intercept; + temp1 = (_p2.m_normal.crossProduct(_p3.m_normal))*m_intercept; + temp2 = (_p3.m_normal.crossProduct(m_normal)) * _p2.m_intercept; + temp3 = (m_normal.crossProduct(_p2.m_normal)) * _p3.m_intercept; result=(temp1+temp2+temp3)/(-denominator); @@ -157,11 +143,10 @@ namespace etk { * @param[in,out] * @return */ - float getDistance(const etk::Vector3D & point) const - { - return point.x*m_normal.x - + point.y*m_normal.y - + point.z*m_normal.z + float getDistance(const etk::Vector3D& _point) const { + return _point.x * m_normal.x + + _point.y * m_normal.y + + _point.z * m_normal.z + m_intercept; }; @@ -170,12 +155,11 @@ namespace etk { * @param[in,out] * @return */ - Plane linearInterpolate(const Plane & p2, float factor) - { + Plane linearInterpolate(const Plane& _p2, float _factor) { Plane result; - result.m_normal=m_normal*(1.0f-factor) + p2.m_normal*factor; + result.m_normal=m_normal*(1.0f-_factor) + _p2.m_normal*_factor; result.m_normal.normalize(); - result.m_intercept=m_intercept*(1.0f-factor) + p2.m_intercept*factor; + result.m_intercept=m_intercept*(1.0f-_factor) + _p2.m_intercept*_factor; return result; }; @@ -185,10 +169,9 @@ namespace etk { * @param[in,out] * @return */ - bool operator==(const Plane & obj) const - { - if( m_normal==obj.m_normal - && m_intercept==obj.m_intercept) { + bool operator==(const Plane & _obj) const { + if( m_normal == _obj.m_normal + && m_intercept == _obj.m_intercept) { return true; } return false; @@ -199,9 +182,8 @@ namespace etk { * @param[in,out] * @return */ - bool operator!=(const Plane & obj) const - { - return!((*this)==obj); + bool operator!=(const Plane& _obj) const { + return!((*this) == _obj); } //unary operators @@ -210,8 +192,7 @@ namespace etk { * @param[in,out] * @return */ - Plane operator-(void) const - { + Plane operator-(void) const { return Plane(-m_normal, -m_intercept); } @@ -220,8 +201,7 @@ namespace etk { * @param[in,out] * @return */ - Plane operator+(void) const - { + Plane operator+(void) const { return *this; } }; diff --git a/etk/math/Vector3D.h b/etk/math/Vector3D.h index 6e5fa4c..38bbc70 100644 --- a/etk/math/Vector3D.h +++ b/etk/math/Vector3D.h @@ -10,7 +10,7 @@ #define __ETK_MATH_VECTOR3D_H__ #include -#include +#include #include #include #include diff --git a/etk/math/Vector4D.h b/etk/math/Vector4D.h index 0584f49..fde0ebe 100644 --- a/etk/math/Vector4D.h +++ b/etk/math/Vector4D.h @@ -10,7 +10,7 @@ #define __ETK_MATH_VECTOR4D_H__ #include -#include +#include #include #include #include diff --git a/etk/os/FSNode.cpp b/etk/os/FSNode.cpp index 571cb66..7f9be5d 100644 --- a/etk/os/FSNode.cpp +++ b/etk/os/FSNode.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include #include #include diff --git a/etk/os/FSNodeRight.cpp b/etk/os/FSNodeRight.cpp index bfb1fd5..5315c12 100644 --- a/etk/os/FSNodeRight.cpp +++ b/etk/os/FSNodeRight.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include // Right Flags : diff --git a/etk/os/Mutex.Generic.cpp b/etk/os/Mutex.Generic.cpp index 0c294e6..bf7dadc 100644 --- a/etk/os/Mutex.Generic.cpp +++ b/etk/os/Mutex.Generic.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include etk::Mutex::Mutex(void) { diff --git a/etk/os/Semaphore.Generic.cpp b/etk/os/Semaphore.Generic.cpp index 972e198..58f031c 100644 --- a/etk/os/Semaphore.Generic.cpp +++ b/etk/os/Semaphore.Generic.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) diff --git a/etk/os/Semaphore.Windows.cpp b/etk/os/Semaphore.Windows.cpp index 1079e2e..d83d90e 100644 --- a/etk/os/Semaphore.Windows.cpp +++ b/etk/os/Semaphore.Windows.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) { diff --git a/etk/unicode.cpp b/etk/unicode.cpp index e114cb3..21bd5bb 100644 --- a/etk/unicode.cpp +++ b/etk/unicode.cpp @@ -9,7 +9,7 @@ // see : http://unicode.org/fr/charts/symbols.html#CombiningDiacriticalMarks #include -#include +#include #include #include diff --git a/etk/unicodeTable.cpp b/etk/unicodeTable.cpp index 011d6dd..09ad732 100644 --- a/etk/unicodeTable.cpp +++ b/etk/unicodeTable.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include #include extern "C" { diff --git a/lutin_etk.py b/lutin_etk.py index 328753f..cd66044 100644 --- a/lutin_etk.py +++ b/lutin_etk.py @@ -8,8 +8,8 @@ def Create(target): # add the file to compile: myModule.AddSrcFile([ - 'etk/Debug.cpp', - 'etk/DebugInternal.cpp', + 'etk/debugGeneric.cpp', + 'etk/debug.cpp', 'etk/unicode.cpp', 'etk/unicodeTable.cpp', 'etk/Char.cpp', diff --git a/test/main.cpp b/test/main.cpp index c269b47..5bf1be6 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -6,12 +6,11 @@ * @license BSD v3 (see license file) */ -#include +#include #include #include #include #include -#include #include #undef __class__