Commit 706c4684 authored by Johnny Jazeix's avatar Johnny Jazeix

visual c++ compilation works (solution generated by cmake). Corrected an error...

visual c++ compilation works (solution generated by cmake). Corrected an error in the documentation.
parent c923baaf
...@@ -81,6 +81,13 @@ public: ...@@ -81,6 +81,13 @@ public:
Message *Message::_message = NULL; Message *Message::_message = NULL;
Interface *Message::_interface = NULL; Interface *Message::_interface = NULL;
#ifdef _MSC_VER // TODO : Check if needed for icc
const Message::end_error_t Message::ende;
const Message::end_warning_t Message::endw;
const Message::end_information_t Message::endi;
const Message::end_selection_information_t Message::endsi;
#endif
Message::Message() { Message::Message() {
} }
......
...@@ -60,10 +60,10 @@ private: ...@@ -60,10 +60,10 @@ private:
Message(); Message();
public: public:
static const struct end_error_t { } ende; static const class end_error_t { } ende;
static const struct end_warning_t { } endw; static const class end_warning_t { } endw;
static const struct end_information_t { } endi; static const class end_information_t { } endi;
static const struct end_selection_information_t { } endsi; static const class end_selection_information_t { } endsi;
static Message *get_instance(); static Message *get_instance();
static void kill(); static void kill();
......
...@@ -52,6 +52,10 @@ ...@@ -52,6 +52,10 @@
#include "render/Ruler.hpp" #include "render/Ruler.hpp"
#include "common/info.hpp" #include "common/info.hpp"
#ifndef M_PI // Visual c++ for example
#define M_PI 3.14159265358979323846
#endif
/*! /*!
* \brief Structure used to store container information. * \brief Structure used to store container information.
*/ */
......
...@@ -185,13 +185,13 @@ float Ruler::get_common_part(const Element_pos n, const Element_pos coeff_for_co ...@@ -185,13 +185,13 @@ float Ruler::get_common_part(const Element_pos n, const Element_pos coeff_for_co
} }
float Ruler::get_variable_part(const Element_pos n, const Element_pos coeff_for_common_prefix, const int nb_digit_after_comma){ float Ruler::get_variable_part(const Element_pos n, const Element_pos coeff_for_common_prefix, const int nb_digit_after_comma){
const int common_part = floor( (n*coeff_for_common_prefix - floor(n*coeff_for_common_prefix))*pow(10, nb_digit_after_comma)); const float common_part = floor( (n*coeff_for_common_prefix - floor(n*coeff_for_common_prefix))*pow(10., nb_digit_after_comma));
const float common_part_without_coeff = common_part/(coeff_for_common_prefix*pow(10, nb_digit_after_comma)); const float common_part_without_coeff = common_part/(coeff_for_common_prefix*pow(10., nb_digit_after_comma));
if ( floor(common_part_without_coeff) != 0 )/* and there is numbers before comma */ if ( floor(common_part_without_coeff) != 0 )/* and there is numbers before comma */
return common_part_without_coeff; return common_part_without_coeff;
else else
return (float)common_part; return common_part;
} }
...@@ -199,8 +199,6 @@ string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_ ...@@ -199,8 +199,6 @@ string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_
int i, common_part; int i, common_part;
Element_pos buf; Element_pos buf;
ostringstream buf_txt, result_txt; ostringstream buf_txt, result_txt;
string::reverse_iterator rit;
/** /**
* *
...@@ -230,7 +228,7 @@ string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_ ...@@ -230,7 +228,7 @@ string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_
buf *= 10; buf *= 10;
} }
for (i=0 ; common_part > 0 ; common_part = floor(common_part/10)){ for (i=0 ; common_part > 0 ; common_part = floor(common_part/10.)){
buf_txt << common_part%10; buf_txt << common_part%10;
if (coeff_for_common_prefix < 1) if (coeff_for_common_prefix < 1)
...@@ -238,12 +236,13 @@ string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_ ...@@ -238,12 +236,13 @@ string Ruler::get_common_part_string(const Element_pos n, Element_pos coeff_for_
else else
coeff_for_common_prefix /= 10.0; coeff_for_common_prefix /= 10.0;
if ( (coeff_for_common_prefix == 1.0) && (floor(common_part/10)>0) ) if ( (coeff_for_common_prefix == 1.0) && (floor(common_part/10.)>0) )
buf_txt << ".";/* Add comma */ buf_txt << ".";/* Add comma */
} }
const string txt_str = buf_txt.str();
for ( rit=buf_txt.str().rbegin() ; rit < buf_txt.str().rend(); rit++ )
for (string::const_reverse_iterator rit= txt_str.rbegin() ; rit < txt_str.rend(); rit ++)
result_txt << *rit; result_txt << *rit;
......
...@@ -52,6 +52,13 @@ class Render_stats_svg; ...@@ -52,6 +52,13 @@ class Render_stats_svg;
#define _RENDER_WIDTH_DEFAULT 550.f #define _RENDER_WIDTH_DEFAULT 550.f
#define _RENDER_HEIGHT_DEFAULT 300.f #define _RENDER_HEIGHT_DEFAULT 300.f
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
/*! /*!
* \brief This class redefined the Svg export to display the trace. * \brief This class redefined the Svg export to display the trace.
*/ */
......
...@@ -57,7 +57,7 @@ std::string String::to_string() const{ ...@@ -57,7 +57,7 @@ std::string String::to_string() const{
return _value; return _value;
} }
bool String::less_than::operator()(const String &s1, const String &s2) { bool String::less_than::operator()(const String &s1, const String &s2) const{
return s1._value < s2._value; return s1._value < s2._value;
} }
......
...@@ -66,10 +66,10 @@ public: ...@@ -66,10 +66,10 @@ public:
*/ */
struct less_than { struct less_than {
/*! /*!
* \fn operator()(const String &, const String &) * \fn operator()(const String &, const String &) const
* \brief Returns true if the second string is greater than the first one * \brief Returns true if the second string is greater than the first one
*/ */
bool operator()(const String &, const String &); bool operator()(const String &, const String &) const;
}; };
/*! /*!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment