00001 #include <QtGui> 00002 #include "info.h" 00003 00004 /******************************************************************************/ 00005 00006 Info::Info(QWidget *parent, Qt::WFlags f) : QWidget(parent, f) 00007 { 00008 setupUi(this); // this sets up GUI 00009 setWindowFlags(f & (~Qt::WindowMaximizeButtonHint)); 00010 } 00011 00012 /******************************************************************************/ 00013 00014 void Info::setBiota(Biota b) 00015 { 00016 biota = b; 00017 } 00018 00019 /******************************************************************************/ 00020 00021 #define PI 3.1415926535897932384626433832795f 00022 #define TO_DEGREE (180.0f/PI) 00023 00024 void Info::showEvent ( QShowEvent * event ) 00025 { 00026 Q_UNUSED(event) 00027 00028 labelReproducao->setText(QVariant(biota.genes.limiar_reproducao).toString() + tr(" wens")); 00029 labelDistribuicao->setText(QVariant((int)(biota.genes.distribuicao_energia * 100.0f)).toString() + tr(" %")); 00030 labelAnguloColisao->setText(QVariant((int)(biota.genes.angulo_colisao*TO_DEGREE)).toString() + " " + tr("degrees")); 00031 labelAnguloReproducao->setText(QVariant((int)(biota.genes.angulo_reproducao*TO_DEGREE)).toString() + " " + tr("degrees")); 00032 } 00033 00034 /******************************************************************************/