Skip to content

Commit

Permalink
merged with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ebertolazzi committed Dec 27, 2022
1 parent ab615d6 commit bd54c8c
Show file tree
Hide file tree
Showing 17 changed files with 282 additions and 111 deletions.
8 changes: 5 additions & 3 deletions Clothoids.prj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<param.summary>Clothoids, a library for clothoids computation and more</param.summary>
<param.description>A library for clothoids computation and more.</param.description>
<param.screenshot>${PROJECT_ROOT}/toolbox/logo.png</param.screenshot>
<param.version>2.0.11</param.version>
<param.version>2.0.12</param.version>
<param.output>${PROJECT_ROOT}/Clothoids.mltbx</param.output>
<param.products.name />
<param.products.id />
Expand Down Expand Up @@ -98,8 +98,10 @@ setup.m
<file>${PROJECT_ROOT}/toolbox</file>
</fileset.rootdir>
<fileset.rootfiles>
<file>${PROJECT_ROOT}/toolbox/CompileClothoidsLib.m</file>
<file>${PROJECT_ROOT}/toolbox/CMakeLists.txt</file>
<file>${PROJECT_ROOT}/toolbox/bin</file>
<file>${PROJECT_ROOT}/toolbox/build</file>
<file>${PROJECT_ROOT}/toolbox/cmake_utils</file>
<file>${PROJECT_ROOT}/toolbox/demos.xml</file>
<file>${PROJECT_ROOT}/toolbox/doc</file>
<file>${PROJECT_ROOT}/toolbox/helptoc.xml</file>
Expand Down Expand Up @@ -164,7 +166,7 @@ setup.m
<vista>false</vista>
<linux>false</linux>
<solaris>false</solaris>
<osver>12.2.1</osver>
<osver>13.1</osver>
<os32>false</os32>
<os64>true</os64>
<arch>maci64</arch>
Expand Down
12 changes: 6 additions & 6 deletions toolbox/src/ClothoidG2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ namespace G2lib {
if ( s < S0.length() ) return S0.theta(s);
s -= S0.length();
if ( s < SM.length() ) return SM.theta(s);
s -= S0.length();
s -= SM.length();
return S1.theta(s);
}

Expand All @@ -954,7 +954,7 @@ namespace G2lib {
if ( s < S0.length() ) return S0.theta_D(s);
s -= S0.length();
if ( s < SM.length() ) return SM.theta_D(s);
s -= S0.length();
s -= SM.length();
return S1.theta_D(s);
}

Expand All @@ -965,7 +965,7 @@ namespace G2lib {
if ( s < S0.length() ) return S0.theta_DD(s);
s -= S0.length();
if ( s < SM.length() ) return SM.theta_DD(s);
s -= S0.length();
s -= SM.length();
return S1.theta_DD(s);
}

Expand All @@ -976,7 +976,7 @@ namespace G2lib {
if ( s < S0.length() ) return S0.theta_DDD(s);
s -= S0.length();
if ( s < SM.length() ) return SM.theta_DDD(s);
s -= S0.length();
s -= SM.length();
return S1.theta_DDD(s);
}

Expand All @@ -987,7 +987,7 @@ namespace G2lib {
if ( s < S0.length() ) return S0.X(s);
s -= S0.length();
if ( s < SM.length() ) return SM.X(s);
s -= S0.length();
s -= SM.length();
return S1.X(s);
}

Expand All @@ -998,7 +998,7 @@ namespace G2lib {
if ( s < S0.length() ) return S0.Y(s);
s -= S0.length();
if ( s < SM.length() ) return SM.Y(s);
s -= S0.length();
s -= SM.length();
return S1.Y(s);
}

Expand Down
103 changes: 66 additions & 37 deletions toolbox/src/Console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,152 +47,155 @@ namespace Utils {
m_level = new_level;
}

void
Console::change_stream( ostream_type * new_p_stream ) {
m_stream = new_p_stream;
}

Console const &
Console::black( string const & msg, int msg_level ) const {
Console::black( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream) << rang::fg::black << msg << rang::fg::reset;
return *this;
}

Console const &
Console::red( string const & msg, int msg_level ) const {
Console::red( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream) << rang::fg::red << msg << rang::fg::reset;
return *this;
}

Console const &
Console::green( string const & msg, int msg_level ) const {
Console::green( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream) << rang::fg::green << msg << rang::fg::reset;
return *this;
}

Console const &
Console::yellow( string const & msg, int msg_level ) const {
Console::yellow( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream) << rang::fg::yellow << msg << rang::fg::reset;
return *this;
}

Console const &
Console::blue( string const & msg, int msg_level ) const {
Console::blue( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream) << rang::fg::blue << msg << rang::fg::reset;
return *this;
}

Console const &
Console::magenta( string const & msg, int msg_level ) const {
Console::magenta( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream) << rang::fg::magenta << msg << rang::fg::reset;
return *this;
}

Console const &
Console::cyan( string const & msg, int msg_level ) const {
Console::cyan( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream) << rang::fg::cyan << msg << rang::fg::reset;
return *this;
}

Console const &
Console::gray( string const & msg, int msg_level ) const {
Console::gray( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream) << rang::fg::gray << msg << rang::fg::reset;
return *this;
}

Console const &
Console::black_reversed( string const & msg, int msg_level ) const {
Console::black_reversed( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
<< rang::fg::black << rang::style::reversed
<< msg << rang::style::reset << rang::fg::reset;
<< msg
<< rang::style::reset << rang::fg::reset;
return *this;
}

Console const &
Console::red_reversed( string const & msg, int msg_level ) const {
Console::red_reversed( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
<< rang::fg::red << rang::style::reversed
<< msg << rang::style::reset << rang::fg::reset;
<< msg
<< rang::style::reset << rang::fg::reset;
return *this;
}

Console const &
Console::green_reversed( string const & msg, int msg_level ) const {
Console::green_reversed( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
<< rang::fg::green << rang::style::reversed
<< msg << rang::style::reset << rang::fg::reset;
<< msg
<< rang::style::reset << rang::fg::reset;
return *this;
}

Console const &
Console::yellow_reversed( string const & msg, int msg_level ) const {
Console::yellow_reversed( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
<< rang::fg::yellow << rang::style::reversed
<< msg << rang::style::reset << rang::fg::reset;
<< msg
<< rang::style::reset << rang::fg::reset;
return *this;
}

Console const &
Console::blue_reversed( string const & msg, int msg_level ) const {
Console::blue_reversed( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
<< rang::fg::blue << rang::style::reversed
<< msg << rang::style::reset << rang::fg::reset;
<< msg
<< rang::style::reset << rang::fg::reset;
return *this;
}

Console const &
Console::magenta_reversed( string const & msg, int msg_level ) const {
Console::magenta_reversed( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
<< rang::fg::magenta << rang::style::reversed
<< msg << rang::style::reset << rang::fg::reset;
<< msg
<< rang::style::reset << rang::fg::reset;
return *this;
}

Console const &
Console::cyan_reversed( string const & msg, int msg_level ) const {
Console::cyan_reversed( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
<< rang::fg::cyan << rang::style::reversed
<< msg << rang::style::reset << rang::fg::reset;
<< msg
<< rang::style::reset << rang::fg::reset;
return *this;
}

Console const &
Console::gray_reversed( string const & msg, int msg_level ) const {
Console::gray_reversed( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
<< rang::fg::gray << rang::style::reversed
<< msg << rang::style::reset << rang::fg::reset;
<< msg
<< rang::style::reset << rang::fg::reset;
return *this;
}

Expand All @@ -219,13 +222,15 @@ namespace Utils {

Console const &
Console::semaphore(
unsigned rvg,
string const & msg,
int msg_level
unsigned rvg,
char const * msg,
int msg_level
) const {
lock_guard<mutex> lock_access(m_message_mutex);
static rang::fg rvg_color[3] = {
rang::fg::red, rang::fg::yellow, rang::fg::green
rang::fg::red,
rang::fg::yellow,
rang::fg::green
};
if ( msg_level <= m_level )
(*m_stream)
Expand All @@ -238,7 +243,31 @@ namespace Utils {
}

Console const &
Console::message( string const & msg, int msg_level ) const {
Console::colors(
unsigned c,
char const * msg,
int msg_level
) const {
lock_guard<mutex> lock_access(m_message_mutex);
static rang::fg rvg_color[5] = {
rang::fg::red,
rang::fg::magenta,
rang::fg::yellow,
rang::fg::cyan,
rang::fg::green
};
if ( msg_level <= m_level )
(*m_stream)
<< rang::style::reset
<< rang::bg::reset
<< rvg_color[c%5]
<< msg
<< rang::fg::reset;
return *this;
}

Console const &
Console::message( char const * msg, int msg_level ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( msg_level <= m_level )
(*m_stream)
Expand All @@ -253,7 +282,7 @@ namespace Utils {
}

Console const &
Console::warning( string const & msg ) const {
Console::warning( char const * msg ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( m_level >= 2 )
(*m_stream)
Expand All @@ -268,7 +297,7 @@ namespace Utils {
}

Console const &
Console::error( string const & msg ) const {
Console::error( char const * msg ) const {
lock_guard<mutex> lock_access(m_message_mutex);
if ( m_level >= 1 )
(*m_stream)
Expand All @@ -283,7 +312,7 @@ namespace Utils {
}

Console const &
Console::fatal( string const & msg ) const {
Console::fatal( char const * msg ) const {
lock_guard<mutex> lock_access(m_message_mutex);
(*m_stream)
<< m_fatal_style.s
Expand Down
Loading

0 comments on commit bd54c8c

Please sign in to comment.