Commit 736311b2 authored by Clément Vuchener's avatar Clément Vuchener

Affichage des informations sur les entites

parent bff7b047
This diff is collapsed.
......@@ -24,7 +24,7 @@ EntityType::~EntityType(){
// Destruction of the list _values
// As long as everithing has not been cleaned
while (!_values.empty()){
while (!_values.empty()) {
delete _values.front();
_values.pop_front();
}
......
......@@ -42,7 +42,14 @@ bool Color::instantiate(const std::string &in, Color &out) {
std::string Color::to_string() const {
std::ostringstream oss;
oss << std::setprecision(Value::_PRECISION) << _r << " " << _g << " " << _b;
oss << "<font color=\"#";
oss << std::hex << std::setfill('0');;
oss << std::setw(2) << (int)(_r*255+0.5)%256
<< std::setw(2) << (int)(_g*255+0.5)%256
<< std::setw(2) << (int)(_b*255+0.5)%256;
oss << "\">";
oss << std::dec << std::setprecision(Value::_PRECISION) << _r << " " << _g << " " << _b;
oss << "</font>";
return oss.str();
}
......
......@@ -20,12 +20,6 @@ void Name::set_alias(std::string alias) {
_alias = alias;
}
Name::Name(const Name &name) : Value(name){
_name = name._name;
_alias = name._alias;
}
String Name::to_String() const{
if (!_name.empty())
return String(_name);
......
......@@ -38,13 +38,6 @@ public:
*/
Name(std::string name, std::string alias);
/*!
*
* \brief Copy constructor
*
*/
Name(const Name &);
/*!
* \fn set_name(std::string name)
* \brief Set the name
......
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