#include <QDebug>
#include <display/region/QtRegionStats.qo.h>
#include <display/region/RegionInfo.h>
#include <QStackedWidget>
#include <display/region/Region.qo.h>
#include <display/region/RegionInfo.h>
#include <display/region/Polyline.qo.h>
#include <display/DisplayErrors.h>
using namespace casacore;
namespace casa {
namespace viewer {
namespace qt {
void stats_t::stats_t::setLabels( const std::string &label, const std::string &desc ) {
label_ = label;
description_ = desc;
setTitle(QString::fromStdString(label_));
}
image_stats_t::image_stats_t( statfield_list_t &fields, QWidget *parent ) : stats_t(parent) {
setupUi(this);
fields.push_back(statfield_list_t::value_type(box11,text11));
fields.push_back(statfield_list_t::value_type(box12,text12));
fields.push_back(statfield_list_t::value_type(box13,text13));
fields.push_back(statfield_list_t::value_type(box14,text14));
fields.push_back(statfield_list_t::value_type(box21,text21));
fields.push_back(statfield_list_t::value_type(box22,text22));
fields.push_back(statfield_list_t::value_type(box23,text23));
fields.push_back(statfield_list_t::value_type(box24,text24));
fields.push_back(statfield_list_t::value_type(box31,text31));
fields.push_back(statfield_list_t::value_type(box32,text32));
fields.push_back(statfield_list_t::value_type(box33,text33));
fields.push_back(statfield_list_t::value_type(box34,text34));
fields.push_back(statfield_list_t::value_type(box41,text41));
fields.push_back(statfield_list_t::value_type(box42,text42));
fields.push_back(statfield_list_t::value_type(box43,text43));
fields.push_back(statfield_list_t::value_type(box44,text44));
}
ms_stats_t::ms_stats_t( statfield_list_t &fields, QWidget *parent ) : stats_t(parent) {
setupUi(this);
fields.push_back(statfield_list_t::value_type(box11,text11));
fields.push_back(statfield_list_t::value_type(box12,text12));
fields.push_back(statfield_list_t::value_type(box21,text21));
fields.push_back(statfield_list_t::value_type(box22,text22));
fields.push_back(statfield_list_t::value_type(box31,text31));
fields.push_back(statfield_list_t::value_type(box32,text32));
fields.push_back(statfield_list_t::value_type(box41,text41));
fields.push_back(statfield_list_t::value_type(box42,text42));
}
SliceStats::SliceStats( QWidget *parent ) : stats_t(parent) {
setupUi(this);
connect( sliceToolButton, SIGNAL(clicked()), this, SIGNAL(show1DSliceTool()));
}
bool SliceStats::updateStatisticsInfo( std::shared_ptr<casa::viewer::RegionInfo> info ) {
std::shared_ptr<SliceRegionInfo> sliceInfo = std::dynamic_pointer_cast<SliceRegionInfo>(info);
if ( sliceInfo ) {
Polyline* polylineRegion = sliceInfo->getRegion();
polylineRegion->addPlot( this->getPlotHolder(), sliceInfo->label());
}
return true;