region_centers->push_back(std::shared_ptr<RegionInfo>(new ImageRegionInfo(name,description,getLayerCenter(padd, image, *imageregion))));
#include <display/region/Rectangle.h>
#include <display/Display/WorldCanvas.h>
#include <display/Display/PixelCanvas.h>
#include <display/Display/WorldCanvasHolder.h>
#include <display/Display/PanelDisplay.h>
#include <display/DisplayDatas/PrincipalAxesDD.h>
#include <display/QtViewer/QtDisplayData.qo.h>
#include <images/Regions/WCBox.h>
#include <display/ds9/ds9writer.h>
#include <imageanalysis/Annotations/AnnRectBox.h>
#include <coordinates/Coordinates/CoordinateUtil.h>
#include <guitools/Histogram/BinPlotWidget.qo.h>
#include <display/DisplayDatas/MSAsRaster.h>
#include <display/DisplayErrors.h>
using namespace casacore;
Rectangle::Rectangle( WorldCanvas *wc, QtRegionDock *d, double x1, double y1, double x2, double y2,
bool hold_signals ) : Region( "rectangle", wc, d, hold_signals ),
Rectangle::Rectangle( QtRegionSourceKernel *rs, WorldCanvas *wc, double x1, double y1, double x2, double y2,
bool hold_signals) : Region( "rectangle", wc, rs->dock( ), hold_signals ),
Rectangle::~Rectangle( ) { }
unsigned int Rectangle::check_handle( double x, double y ) const {
bool blc = x >= blc_x && x <= (blc_x + handle_delta_x) && y >= blc_y && y <= (blc_y + handle_delta_y);
bool tlc = x >= blc_x && x <= (blc_x + handle_delta_x) && y >= (trc_y - handle_delta_y) && y <= trc_y;
bool brc = x >= (trc_x - handle_delta_x) && x <= trc_x && y >= blc_y && y <= (blc_y + handle_delta_y);
bool trc = x >= (trc_x - handle_delta_x) && x <= trc_x && y >= (trc_y - handle_delta_y) && y <= trc_y;
return trc ? 1 : brc ? 2 : blc ? 3 : tlc ? 4 : 0;
int Rectangle::clickHandle( double x, double y ) const {
if ( visible_ == false ) return 0;
return check_handle( x, y );
bool Rectangle::doubleClick( double x, double y ) {
const std::list<DisplayData*> &dds = wc_->displaylist( );
for ( std::list<DisplayData*>::const_iterator ddi=dds.begin(); ddi != dds.end(); ++ddi ) {