proto-1.0 261: Prevent sanity check to check graphical interface

Index: ChangeLog from Christophe Berger <christophe@lrde.epita.fr> * olena/oln/appli/astro/clean.hh: No ntg use anymore. * olena/oln/appli/astro/tree_statistics.hh: Fix missing include. * olena/oln/appli/astro/graphical_interface/interface.pro: Define to know if sanity or makefile is building app. * olena/oln/appli/astro/graphical_interface/image_viewer.hh: prevent sanity. * olena/oln/appli/astro/graphical_interface/qtincludes.hh: Likewise. * olena/oln/appli/astro/graphical_interface/utils.hh: Likewise. * olena/oln/appli/astro/graphical_interface/filterinterface.hh: Likewise and fix attribute bug. clean.hh | 41 ++++++++++++++++++++++++------ graphical_interface/filterinterface.hh | 45 ++++++++++++++++++++------------- graphical_interface/image_viewer.hh | 10 ++++--- graphical_interface/interface.pro | 2 + graphical_interface/qtincludes.hh | 18 +++++++------ graphical_interface/utils.hh | 9 ++++-- tree_statistics.hh | 1 7 files changed, 87 insertions(+), 39 deletions(-) Index: olena/oln/appli/astro/graphical_interface/filterinterface.hh --- olena/oln/appli/astro/graphical_interface/filterinterface.hh (revision 260) +++ olena/oln/appli/astro/graphical_interface/filterinterface.hh (working copy) @@ -25,6 +25,7 @@ // reasons why the executable file might be covered by the GNU General // Public License. +#ifdef _COMPILE_WITH_QT #ifndef _FILTERINTERFACE_HH_ # define _FILTERINTERFACE_HH_ # include <string> @@ -76,14 +77,13 @@ mt_.set_area_max(value_area_max->value()); mt_.set_level(value_level->value()); mt_.set_height(value_height->value()); - mt_.set_circle(value_circle->value() / 100); - mt_.set_tower(value_tower->value() / 100); - - std::string out = "attributes value changed.";// area(" -// + Utils::int2string(value_area->value()) -// + "), point_value(" -// + Utils::int2string(value_level->value()) -// + ")"; + float value_to_set = value_circle->value(); + value_to_set /= 100; + mt_.set_circle(value_to_set); + value_to_set = value_tower->value(); + value_to_set /= 100; + mt_.set_tower(value_to_set); + std::string out = "attributes value changed."; this->text_state->setText(out.c_str()); } @@ -109,6 +109,16 @@ display_out_.reload(tmp_); this->text_state->setText(""); display_out_.show(); +#ifndef NDEBUG + std::cerr << "Attribute flags:" << std::endl + << " * Area: " << mt_.area_tag_ << " from " << mt_.get_area_min() << " to " + << mt_.get_area_max() << std::endl + << " * Level: " << mt_.level_tag_ << " value: " << mt_.get_level() << std::endl + << " * Height: " << mt_.height_tag_ << " value: " << mt_.get_height() << std::endl + << " * Circle: " << mt_.circle_tag_ << " value: " << mt_.get_circle() << std::endl + << " * Center: " << mt_.center_p_tag_ << std::endl + << " * Tower: " << mt_.tour_tag_ << " value: " << mt_.get_tower() << std::endl; +#endif } virtual void DisplayInputImage() @@ -212,3 +222,4 @@ }; #endif // !_FILTERINTERFACE_HH_ +#endif // !_COMPILE_WITH_QT Index: olena/oln/appli/astro/clean.hh --- olena/oln/appli/astro/clean.hh (revision 260) +++ olena/oln/appli/astro/clean.hh (working copy) @@ -41,8 +41,6 @@ # include <vector> - - #define get_aux_data(IT1ER, AT1T1R) this->aux_data_[IT1ER].call(&T1::AT1T1R##_get) #define set_aux_data(IT1ER, AT1T1R, VAL) this->aux_data_[IT1ER].call(&T1::AT1T1R##_set, VAL) @@ -114,32 +112,61 @@ { area_min_ = nb; } + unsigned get_area_min() const + { + return area_min_; + } void set_tower(float nb) { tour_ = nb; } + float get_tower() const + { + return tour_; + } + void set_circle(float nb) { circle_ = nb; } + float get_circle() const + { + return circle_; + } + void set_area_max(unsigned nb) { area_max_ = nb; } + unsigned get_area_max() const + { + return area_max_; + } + void set_level(unsigned nb) { level_ = nb; } + unsigned get_level() const + { + return level_; + } + void set_height(unsigned nb) { height_ = nb; } + unsigned get_height() const + { + return height_; + } + // attributes to compute the output bool level_attr(const point_type& p) @@ -282,20 +309,20 @@ { unsigned tmp = get_aux_data(*c, height) + this->input[*c].value() - this->input[*p].value(); - set_aux_data(*p, height, ntg::max(tmp, get_aux_data(*p, height))); + set_aux_data(*p, height, std::max(tmp, get_aux_data(*p, height))); } if (tour_tag_) set_aux_data(*p, int_volume, get_aux_data(*p, int_volume) + get_aux_data(*c, int_volume)); if (circle_tag_) { - set_aux_data(*p, row_min, ntg::min(get_aux_data(*p, row_min), + set_aux_data(*p, row_min, std::min(get_aux_data(*p, row_min), get_aux_data(*c, row_min))); - set_aux_data(*p, row_max, ntg::max(get_aux_data(*p, row_max), + set_aux_data(*p, row_max, std::max(get_aux_data(*p, row_max), get_aux_data(*c, row_max))); - set_aux_data(*p, col_min, ntg::min(get_aux_data(*p, col_min), + set_aux_data(*p, col_min, std::min(get_aux_data(*p, col_min), get_aux_data(*c, col_min))); - set_aux_data(*p, col_max, ntg::max(get_aux_data(*p, col_max), + set_aux_data(*p, col_max, std::max(get_aux_data(*p, col_max), get_aux_data(*c, col_max))); } if (center_p_tag_) Index: olena/oln/appli/astro/graphical_interface/interface.pro --- olena/oln/appli/astro/graphical_interface/interface.pro (revision 260) +++ olena/oln/appli/astro/graphical_interface/interface.pro (working copy) @@ -3,6 +3,8 @@ CONFIG += warn_off release qt +DEFINES += _COMPILE_WITH_QT + INCLUDEPATH += . ../../../../../olena ../../../../../metalic ../../../../../integre SOURCES += main.cc Index: olena/oln/appli/astro/graphical_interface/image_viewer.hh --- olena/oln/appli/astro/graphical_interface/image_viewer.hh (revision 260) +++ olena/oln/appli/astro/graphical_interface/image_viewer.hh (working copy) @@ -25,6 +25,7 @@ // reasons why the executable file might be covered by the GNU General // Public License. +#ifdef _COMPILE_WITH_QT #ifndef _IMAGE_VIEWER_HH_ # define _IMAGE_VIEWER_HH_ # include "qtincludes.hh" @@ -145,3 +146,4 @@ }; #endif // !_IMAGE_VIEWER_HH_ +#endif // !_COMPILE_WITH_QT Index: olena/oln/appli/astro/graphical_interface/utils.hh --- olena/oln/appli/astro/graphical_interface/utils.hh (revision 260) +++ olena/oln/appli/astro/graphical_interface/utils.hh (working copy) @@ -25,8 +25,10 @@ // reasons why the executable file might be covered by the GNU General // Public License. +#ifdef _COMPILE_WITH_QT #ifndef _UTILS_HH_ # define _UTILS_HH_ +# include <string> // FIXME: #include something here! @@ -50,3 +52,4 @@ } #endif // !_UTILS_HH_ +#endif // !_COMPILE_WITH_QT Index: olena/oln/appli/astro/graphical_interface/qtincludes.hh --- olena/oln/appli/astro/graphical_interface/qtincludes.hh (revision 260) +++ olena/oln/appli/astro/graphical_interface/qtincludes.hh (working copy) @@ -25,6 +25,7 @@ // reasons why the executable file might be covered by the GNU General // Public License. +#ifdef _COMPILE_WITH_QT #include <qapplication.h> #include <qpushbutton.h> #include <qlabel.h> @@ -33,3 +34,4 @@ #include <qslider.h> #include <qcheckbox.h> #include <qspinbox.h> +#endif // !_COMPILE_WITH_QT Index: olena/oln/appli/astro/tree_statistics.hh --- olena/oln/appli/astro/tree_statistics.hh (revision 260) +++ olena/oln/appli/astro/tree_statistics.hh (working copy) @@ -39,6 +39,7 @@ # include <oln/basics.hh> # include <queue> +# include <fstream> namespace oln {
participants (1)
-
Christophe Berger