casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MultiPolylineToolImpl.h
Go to the documentation of this file.
00001 //# Copyright (C) 1999,2000,2001,2002
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
00024 //#
00025 //# $Id$
00026 
00027 #ifndef DISPLAY_MULTIPOLYLINETOOLIMPL_H
00028 #define DISPLAY_MULTIPOLYLINETOOLIMPL_H
00029 
00030 //# aips includes
00031 #include <casa/aips.h>
00032 #include <casa/Arrays/Vector.h>
00033 
00034 //# trial includes
00035 
00036 //# display library includes
00037 //#include <display/Display/WorldCanvas.h>
00038 #include <display/DisplayEvents/MultiPolylineTool.h>
00039 #include <display/region/RegionSourceFactory.h>
00040 
00041 namespace casa { //# NAMESPACE CASA - BEGIN
00042 
00043 // <summary>
00044 // WorldCanvas event-based polyline region drawer
00045 // </summary>
00046 
00047 // <use visibility=export>
00048 
00049 // <reviewed reviewer="" data="yyyy/mm/dd" tests="" demos="">
00050 // </reviewed>
00051 
00052 // <prerequisites>
00053 //   <li> WCRectTool
00054 // </prerequisites>
00055 
00056 
00057 // <example>
00058 // </example>
00059 
00060 
00061 
00062 class MultiPolylineToolImpl : public MultiPolylineTool {
00063 
00064  public:
00065 
00066   // Constructor
00067   MultiPolylineToolImpl(viewer::RegionSourceFactory *rf, PanelDisplay* pd, Display::KeySym keysym = Display::K_Pointer_Button3);
00068 
00069   // Destructor
00070   virtual ~MultiPolylineToolImpl();
00071 
00072  protected:
00073 
00074   // Handle double-click inside the polygon.  Invokes regionReady().
00075   virtual void doubleInside();
00076 
00077   // This function is called when a region is deliberately "finished"
00078   // by the user.  It can be implemented to do further actions, such
00079   // as report the region to the application.
00080   virtual void regionReady() { };
00081 
00082   // get the world coords of the current polygon region
00083   void getWorldCoords(Vector<Double> &x, Vector<Double> &y);
00084 
00085   // get the linear coords of the current ploygon region
00086   void getLinearCoords(Vector<Double> &x, Vector<Double> &y);
00087 
00088 };
00089 
00090 
00091 } //# NAMESPACE CASA - END
00092 
00093 #endif