casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Ellipse.h
Go to the documentation of this file.
00001 //# ellipse.h: base class for statistical regions
00002 //# Copyright (C) 2011
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 
00028 
00029 #ifndef REGION_ELLIPSE_H_
00030 #define REGION_ELLIPSE_H_
00031 
00032 #include <display/region/Rectangle.h>
00033 #include <casa/BasicSL/String.h>
00034 #include <list>
00035 
00036 namespace casa {
00037 
00038         class PanelDisplay;
00039         class AnnRegion;
00040 
00041         namespace viewer {
00042 
00043                 // carry over from QtRegion... hopefully, removed soon...
00044                 class QtRegionSourceKernel;
00045 
00046                 // All regions are specified in "linear coordinates", not "pixel coordinates". This is necessary
00047                 // because "linear coordinates" scale with zooming whereas "pixel coordinates" do not. Unfortunately,
00048                 // this means that coordinate transformation is required each time the region is drawn.
00049                 class Ellipse : public Rectangle {
00050                 public:
00051                         ~Ellipse( );
00052                         Ellipse( WorldCanvas *wc, QtRegionDock *d, double x1, double y1, double x2, double y2);
00053 
00054                         // carry over from QtRegion... hopefully, removed soon...
00055                         Ellipse( QtRegionSourceKernel *factory, WorldCanvas *wc, double x1, double y1, double x2, double y2, bool hold_signals=false );
00056 
00057                         // returns mouse movement state
00058                         unsigned int mouseMovement( double x, double y, bool other_selected );
00059 
00060                         AnnotationBase *annotation( ) const;
00061 
00062                         bool flag( MSAsRaster * ) {
00063                                 return false;
00064                         }
00065 
00066                         // fetch region type...
00067                         region::RegionTypes type( ) const {
00068                                 return region::EllipseRegion;
00069                         }
00070 
00071                 protected:
00072                         std::list<std::tr1::shared_ptr<RegionInfo> > *generate_dds_centers(  );
00073                         ImageRegion *get_image_region( DisplayData* ) const;
00074                         // Ellipse is derived from Rectangle, but we have no way to generate ellipse
00075                         // statistics for a measurement set (our only non-image display data)... so
00076                         // we have to define this to prevent MS info being reported for the bounding
00077                         // rectangle of an Ellipse...
00078                         void generate_nonimage_statistics( DisplayData*, std::list<RegionInfo> * ) { }
00079 
00080                         virtual void fetch_region_details( region::RegionTypes &type, std::vector<std::pair<int,int> > &pixel_pts,
00081                                                            std::vector<std::pair<double,double> > &world_pts ) const;
00082 
00083                         void drawRegion( bool );
00084                         /* void drawHandles( ); */
00085 
00086                 };
00087         }
00088 }
00089 
00090 #endif