[DEV] update Debug in debug

This commit is contained in:
Edouard DUPIN 2013-10-25 20:47:46 +02:00
parent a8462354d8
commit a3f4d0d129
30 changed files with 79 additions and 101 deletions

View File

@ -7,7 +7,8 @@
*/ */
#include <etk/Char.h> #include <etk/Char.h>
#include <etk/debug.h>
#include <etk/Stream.h>
etk::Char::Char(void) { etk::Char::Char(void) {
m_data.pushBack('\0'); m_data.pushBack('\0');

View File

@ -9,8 +9,6 @@
#ifndef __ETK_CHAR_H__ #ifndef __ETK_CHAR_H__
#define __ETK_CHAR_H__ #define __ETK_CHAR_H__
#include <etk/DebugInternal.h>
#include <etk/Stream.h>
#include <etk/Vector.h> #include <etk/Vector.h>
namespace etk namespace etk

View File

@ -9,7 +9,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/tool.h> #include <etk/tool.h>
#include <etk/Color.h> #include <etk/Color.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
static bool strnCmpNoCase(const char * input1, const char * input2, int32_t maxLen) static bool strnCmpNoCase(const char * input1, const char * input2, int32_t maxLen)
{ {

View File

@ -10,7 +10,7 @@
#define __ETK_HACH_H__ #define __ETK_HACH_H__
#include <etk/types.h> #include <etk/types.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <etk/Vector.h> #include <etk/Vector.h>
#include <etk/UString.h> #include <etk/UString.h>

View File

@ -8,7 +8,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/Debug.h> #include <etk/debug.h>
#include <etk/tool.h> #include <etk/tool.h>
#include <etk/Noise.h> #include <etk/Noise.h>
// for the rand ... // for the rand ...

View File

@ -10,7 +10,7 @@
#define __TK_REG_EXP_H__ #define __TK_REG_EXP_H__
#include <etk/types.h> #include <etk/types.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <etk/UString.h> #include <etk/UString.h>
#include <etk/Vector.h> #include <etk/Vector.h>

View File

@ -8,7 +8,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/Stream.h> #include <etk/Stream.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#if defined(__TARGET_OS__Linux) && DEBUG_LEVEL > 2 #if defined(__TARGET_OS__Linux) && DEBUG_LEVEL > 2
#include <execinfo.h> #include <execinfo.h>

View File

@ -10,7 +10,7 @@
#include <etk/UChar.h> #include <etk/UChar.h>
#include <etk/unicode.h> #include <etk/unicode.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <etk/Stream.h> #include <etk/Stream.h>
#include <etk/Vector.h> #include <etk/Vector.h>
#include <etk/Char.h> #include <etk/Char.h>

View File

@ -8,7 +8,7 @@
#include <etk/UString.h> #include <etk/UString.h>
#include <etk/unicode.h> #include <etk/unicode.h>
#include <etk/Debug.h> #include <etk/debug.h>
int32_t strlen(const etk::UChar * _data) int32_t strlen(const etk::UChar * _data)
{ {

View File

@ -9,8 +9,7 @@
#ifndef __ETK_USTRING_H__ #ifndef __ETK_USTRING_H__
#define __ETK_USTRING_H__ #define __ETK_USTRING_H__
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <etk/Stream.h>
#include <etk/Vector.h> #include <etk/Vector.h>
#include <etk/Char.h> #include <etk/Char.h>
#include <etk/unicode.h> #include <etk/unicode.h>

View File

@ -10,7 +10,7 @@
#define __ETK_VECTOR_H__ #define __ETK_VECTOR_H__
#include <etk/types.h> #include <etk/types.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#undef __class__ #undef __class__
#define __class__ "etk::Vector" #define __class__ "etk::Vector"

View File

@ -8,7 +8,7 @@
#include <etk/archive/Archive.h> #include <etk/archive/Archive.h>
#include <etk/archive/Zip.h> #include <etk/archive/Zip.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
const etk::Archive::Content& etk::Archive::getContent(const etk::UString& _key) const const etk::Archive::Content& etk::Archive::getContent(const etk::UString& _key) const
{ {

View File

@ -7,7 +7,7 @@
*/ */
#include <etk/archive/Zip.h> #include <etk/archive/Zip.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
etk::archive::Zip::Zip(const etk::UString& _fileName) : etk::archive::Zip::Zip(const etk::UString& _fileName) :
etk::Archive(_fileName), etk::Archive(_fileName),

View File

@ -6,4 +6,6 @@
* @license BSD v3 (see license file) * @license BSD v3 (see license file)
*/ */
#include <etk/debug.h>
const char * etkLibName = "Etk "; const char * etkLibName = "Etk ";

View File

@ -6,11 +6,10 @@
* @license BSD v3 (see license file) * @license BSD v3 (see license file)
*/ */
#include "etk/Debug.h" #ifndef __ETK_DEBUG_H__
#define __ETK_DEBUG_H__
#ifndef __ETK_DEBUG_INTERNAL_H__
#define __ETK_DEBUG_INTERNAL_H__
#include <etk/debugGeneric.h>
extern const char * etkLibName; extern const char * etkLibName;

View File

@ -6,7 +6,7 @@
* @license BSD v3 (see license file) * @license BSD v3 (see license file)
*/ */
#include <etk/Debug.h> #include <etk/debugGeneric.h>
#include <time.h> #include <time.h>
// Max string size : (wide screan console nb caractere) // Max string size : (wide screan console nb caractere)

View File

@ -6,8 +6,8 @@
* @license BSD v3 (see license file) * @license BSD v3 (see license file)
*/ */
#ifndef __ETK_DEBUG_H__ #ifndef __ETK_DEBUG_GENERIC_H__
#define __ETK_DEBUG_H__ #define __ETK_DEBUG_GENERIC_H__
#include <etk/types.h> #include <etk/types.h>
#include <etk/Stream.h> #include <etk/Stream.h>

View File

@ -8,7 +8,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/math/Matrix4.h> #include <etk/math/Matrix4.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <math.h> #include <math.h>

View File

@ -9,44 +9,38 @@
#ifndef __ETK_TYPES_PLANE_H__ #ifndef __ETK_TYPES_PLANE_H__
#define __ETK_TYPES_PLANE_H__ #define __ETK_TYPES_PLANE_H__
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <etk/math/Vector3D.h>
#include <etk/Vector.h> #include <etk/Vector.h>
namespace etk { namespace etk {
template <typename T> class Plane template <typename T> class Plane {
{
public : public :
//member variables //member variables
etk::Vector3D<T> m_normal; //X.N+intercept=0 etk::Vector3D<T> m_normal; //!< X.N+intercept=0
T m_intercept; T m_intercept;
public: public:
/***************************************************** /*****************************************************
* Constructor * Constructor
*****************************************************/ *****************************************************/
Plane(void) : Plane(void) :
m_normal(0, 0, 0), m_normal(0, 0, 0),
m_intercept(0) m_intercept(0) {
{
} }
Plane(etk::Vector3D<T> _normal, T _intercept=0) : Plane(etk::Vector3D<T> _normal, T _intercept=0) :
m_normal(_normal), m_normal(_normal),
m_intercept(_intercept) m_intercept(_intercept) {
{
} }
Plane(const Plane& obj) : Plane(const Plane& obj) :
m_normal(obj.m_normal), m_normal(obj.m_normal),
m_intercept(obj.m_intercept) m_intercept(obj.m_intercept) {
{
} }
/***************************************************** /*****************************************************
* Destructor * Destructor
*****************************************************/ *****************************************************/
~Plane(void) ~Plane(void) {
{
}; };
@ -55,9 +49,8 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
void setNormal(const etk::Vector3D<T>& obj) void setNormal(const etk::Vector3D<T>& _obj) {
{ m_normal = _obj;
m_normal=obj;
}; };
/** /**
@ -65,8 +58,7 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
void setIntercept(float _intercept) void setIntercept(float _intercept) {
{
m_intercept=_intercept; m_intercept=_intercept;
}; };
@ -75,13 +67,12 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
void setFromPoints(const etk::Vector3D<T> & p0, void setFromPoints(const etk::Vector3D<T>& p0,
const etk::Vector3D<T> & p1, const etk::Vector3D<T>& p1,
const etk::Vector3D<T> & p2) const etk::Vector3D<T>& p2) {
{ m_normal = (_p1 - _p0).crossProduct(_p2 - _p0);
m_normal=(p1-p0).crossProduct(p2-p0);
m_normal.normalize(); m_normal.normalize();
calculateIntercept(p0); calculateIntercept(_p0);
}; };
/** /**
@ -89,9 +80,8 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
void calculateIntercept(const etk::Vector3D<T>& pointOnPlane) void calculateIntercept(const etk::Vector3D<T>& _pointOnPlane) {
{ m_intercept=-m_normal.dotProduct(_pointOnPlane);
m_intercept=-m_normal.dotProduct(pointOnPlane);
} }
/** /**
@ -99,8 +89,7 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
void normalize(void) void normalize(void) {
{
float normalLength=m_normal.getLength(); float normalLength=m_normal.getLength();
m_normal/=normalLength; m_normal/=normalLength;
m_intercept/=normalLength; m_intercept/=normalLength;
@ -111,8 +100,7 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
etk::Vector3D<T> getNormal(void) etk::Vector3D<T> getNormal(void) {
{
return m_normal; return m_normal;
}; };
@ -121,8 +109,7 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
float getIntercept() float getIntercept(void) {
{
return m_intercept; return m_intercept;
} }
@ -132,20 +119,19 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
bool intersect3(const Plane<T>& p2, bool intersect3(const Plane<T>& _p2,
const Plane<T> & p3, const Plane<T>& _p3,
etk::Vector3D<T> & result) etk::Vector3D<T>& _result) {
{ float denominator = m_normal.dotProduct((_p2.m_normal).crossProduct(_p3.m_normal));
float denominator=m_normal.dotProduct((p2.m_normal).crossProduct(p3.m_normal));
//scalar triple product of normals //scalar triple product of normals
if(denominator==0.0f) { if(denominator==0.0f) {
//no intersection //no intersection
return false; return false;
} }
etk::Vector3D<T> temp1, temp2, temp3; etk::Vector3D<T> temp1, temp2, temp3;
temp1=(p2.m_normal.crossProduct(p3.m_normal))*m_intercept; temp1 = (_p2.m_normal.crossProduct(_p3.m_normal))*m_intercept;
temp2=(p3.m_normal.crossProduct(m_normal))*p2.m_intercept; temp2 = (_p3.m_normal.crossProduct(m_normal)) * _p2.m_intercept;
temp3=(m_normal.crossProduct(p2.m_normal))*p3.m_intercept; temp3 = (m_normal.crossProduct(_p2.m_normal)) * _p3.m_intercept;
result=(temp1+temp2+temp3)/(-denominator); result=(temp1+temp2+temp3)/(-denominator);
@ -157,11 +143,10 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
float getDistance(const etk::Vector3D<T> & point) const float getDistance(const etk::Vector3D<T>& _point) const {
{ return _point.x * m_normal.x
return point.x*m_normal.x + _point.y * m_normal.y
+ point.y*m_normal.y + _point.z * m_normal.z
+ point.z*m_normal.z
+ m_intercept; + m_intercept;
}; };
@ -170,12 +155,11 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
Plane<T> linearInterpolate(const Plane<T> & p2, float factor) Plane<T> linearInterpolate(const Plane<T>& _p2, float _factor) {
{
Plane<T> result; Plane<T> 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_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; return result;
}; };
@ -185,10 +169,9 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
bool operator==(const Plane<T> & obj) const bool operator==(const Plane<T> & _obj) const {
{ if( m_normal == _obj.m_normal
if( m_normal==obj.m_normal && m_intercept == _obj.m_intercept) {
&& m_intercept==obj.m_intercept) {
return true; return true;
} }
return false; return false;
@ -199,9 +182,8 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
bool operator!=(const Plane<T> & obj) const bool operator!=(const Plane<T>& _obj) const {
{ return!((*this) == _obj);
return!((*this)==obj);
} }
//unary operators //unary operators
@ -210,8 +192,7 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
Plane<T> operator-(void) const Plane<T> operator-(void) const {
{
return Plane<T>(-m_normal, -m_intercept); return Plane<T>(-m_normal, -m_intercept);
} }
@ -220,8 +201,7 @@ namespace etk {
* @param[in,out] * @param[in,out]
* @return * @return
*/ */
Plane<T> operator+(void) const Plane<T> operator+(void) const {
{
return *this; return *this;
} }
}; };

View File

@ -10,7 +10,7 @@
#define __ETK_MATH_VECTOR3D_H__ #define __ETK_MATH_VECTOR3D_H__
#include <etk/types.h> #include <etk/types.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <math.h> #include <math.h>
#include <etk/Stream.h> #include <etk/Stream.h>
#include <LinearMath/btScalar.h> #include <LinearMath/btScalar.h>

View File

@ -10,7 +10,7 @@
#define __ETK_MATH_VECTOR4D_H__ #define __ETK_MATH_VECTOR4D_H__
#include <etk/types.h> #include <etk/types.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <math.h> #include <math.h>
#include <etk/Stream.h> #include <etk/Stream.h>
#include <LinearMath/btScalar.h> #include <LinearMath/btScalar.h>

View File

@ -8,7 +8,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <etk/os/FSNode.h> #include <etk/os/FSNode.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -8,7 +8,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <etk/os/FSNodeRight.h> #include <etk/os/FSNodeRight.h>
// Right Flags : // Right Flags :

View File

@ -7,7 +7,7 @@
*/ */
#include <etk/os/Mutex.h> #include <etk/os/Mutex.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
etk::Mutex::Mutex(void) etk::Mutex::Mutex(void)
{ {

View File

@ -8,7 +8,7 @@
#include <etk/os/Semaphore.h> #include <etk/os/Semaphore.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
#include <sys/time.h> #include <sys/time.h>
etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax)

View File

@ -7,7 +7,7 @@
*/ */
#include <etk/os/Semaphore.h> #include <etk/os/Semaphore.h>
#include <etk/DebugInternal.h> #include <etk/debug.h>
etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax)
{ {

View File

@ -9,7 +9,7 @@
// see : http://unicode.org/fr/charts/symbols.html#CombiningDiacriticalMarks // see : http://unicode.org/fr/charts/symbols.html#CombiningDiacriticalMarks
#include <etk/types.h> #include <etk/types.h>
#include <etk/Debug.h> #include <etk/debug.h>
#include <etk/unicodeTable.h> #include <etk/unicodeTable.h>
#include <etk/unicode.h> #include <etk/unicode.h>

View File

@ -7,7 +7,7 @@
*/ */
#include <etk/types.h> #include <etk/types.h>
#include <etk/Debug.h> #include <etk/debug.h>
#include <etk/unicodeTable.h> #include <etk/unicodeTable.h>
extern "C" { extern "C" {

View File

@ -8,8 +8,8 @@ def Create(target):
# add the file to compile: # add the file to compile:
myModule.AddSrcFile([ myModule.AddSrcFile([
'etk/Debug.cpp', 'etk/debugGeneric.cpp',
'etk/DebugInternal.cpp', 'etk/debug.cpp',
'etk/unicode.cpp', 'etk/unicode.cpp',
'etk/unicodeTable.cpp', 'etk/unicodeTable.cpp',
'etk/Char.cpp', 'etk/Char.cpp',

View File

@ -6,12 +6,11 @@
* @license BSD v3 (see license file) * @license BSD v3 (see license file)
*/ */
#include <etk/Debug.h> #include <etk/debug.h>
#include <etk/Vector.h> #include <etk/Vector.h>
#include <etk/UString.h> #include <etk/UString.h>
#include <etk/Hash.h> #include <etk/Hash.h>
#include <etk/os/FSNode.h> #include <etk/os/FSNode.h>
#include <etk/DebugInternal.h>
#include <etk/archive/Archive.h> #include <etk/archive/Archive.h>
#undef __class__ #undef __class__