Commit 14502b8f authored by Kevin Coulomb's avatar Kevin Coulomb

Une EntityValue invalide n'empeche plus une entité d'être affichée

parent 3ac10108
......@@ -241,18 +241,18 @@ public:
i++) {
state = *i;
map<std::string, Value *>::const_iterator field;
// Search the color
extra_fields = state->get_value()->get_extra_fields();
map<std::string, Value *>::const_iterator field = extra_fields->find(std::string("Color"));
if (field == extra_fields->end()) {
/* Call the object state drawing function with default color */
draw_state(draw_object, state->get_start_time().get_value(), state->get_end_time().get_value(), position, 0.7, 0.7, 0.75);
}
else {
if (state->get_value() &&
(field = state->get_value()->get_extra_fields()->find(std::string("Color"))) != extra_fields->end()) {
/* Call the object state drawing function with the state color */
color = (const Color *)(*field).second;
draw_state(draw_object, state->get_start_time().get_value(), state->get_end_time().get_value(), position,
color->get_red(), color->get_green(), color->get_blue());
color->get_red(), color->get_green(), color->get_blue());
}
else {
/* Call the object state drawing function with default color */
draw_state(draw_object, state->get_start_time().get_value(), state->get_end_time().get_value(), position, 0.7, 0.7, 0.75);
}
}/* end for */
......
......@@ -48,6 +48,7 @@ public:
/*!
* \fn get_value() const
* \brief Get the value of the event
* \return Pointer to the Entityvalue or NULL if it has no value
*/
const EntityValue *get_value() const;
};
......
......@@ -57,6 +57,7 @@ public:
/*!
* \fn get_value() const
* \brief Get the value of the link
* \return Pointer to the Entityvalue or NULL if it has no value
*/
const EntityValue *get_value() const;
......
......@@ -56,6 +56,7 @@ public:
/*!
* \fn get_value() const
* \brief Get the value of the state
* \return Pointer to the Entityvalue or NULL if it has no value
*/
const EntityValue *get_value() const;
};
......
......@@ -95,7 +95,7 @@ void Trace::define_entity_value(Name &name, EntityType *entity_type, map<std::st
}
void Trace::set_state(Date &time, StateType *type, Container *container, EntityValue *value, map<std::string, Value *> &opt) {
if (container && type && value)
if (container && type)
container->set_state(time, type, value);
// Delete unused extra fields
......@@ -103,7 +103,7 @@ void Trace::set_state(Date &time, StateType *type, Container *container, EntityV
}
void Trace::push_state(Date &time, StateType *type, Container *container, EntityValue *value, map<std::string, Value *> &opt) {
if (container && type && value)
if (container && type)
container->push_state(time, type, value);
// Delete unused extra fields
......@@ -119,7 +119,7 @@ void Trace::pop_state(Date &time, StateType *type, Container *container, map<std
}
void Trace::new_event(Date &time, EventType *type, Container *container, EntityValue *value, map<std::string, Value *> &opt) {
if (container && type && value)
if (container && type)
container->new_event(time, type, value);
// Delete unused extra fields
......@@ -151,7 +151,7 @@ void Trace::sub_variable(Date &time, VariableType *type, Container *container, D
}
void Trace::start_link(Date &time, LinkType *type, Container *ancestor, Container *source, EntityValue *value, String key, map<std::string, Value *> &opt) {
if (ancestor && type && source && value)
if (ancestor && type && source)
ancestor->start_link(time, type, source, value, key);
// Delete unused extra fields
......@@ -159,7 +159,7 @@ void Trace::start_link(Date &time, LinkType *type, Container *ancestor, Containe
}
void Trace::end_link(Date &time, LinkType *type, Container *ancestor, Container *destination, EntityValue *value, String key, map<std::string, Value *> &opt) {
if (ancestor && type && destination && value)
if (ancestor && type && destination)
ancestor->end_link(time, destination, key);
// Delete unused extra fields
......
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