casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WCInvisTool.h
Go to the documentation of this file.
00001 //# WCInvisTool.h: Base class for WC event-based invisible position tools
00002 //# Copyright (C) 1999,2000
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 #ifndef TRIALDISPLAY_WCINVISTOOL_H
00029 #define TRIALDISPLAY_WCINVISTOOL_H
00030 
00031 #include <casa/aips.h>
00032 #include <display/DisplayEvents/WCTool.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036 // <summary>
00037 // Base implementation of WCTool for invisible (non-drawing) tools.
00038 // </summary>
00039 // 
00040 // <synopsis>
00041 // This class implements some of WCTool, and adds additional interface
00042 // to support invisible (ie. non-drawing) tools for WorldCanvases.
00043 // </synopsis>
00044 
00045 class WCInvisTool : public WCTool {
00046 
00047  public:
00048 
00049   // constructor
00050   WCInvisTool(WorldCanvas *wcanvas,
00051               Display::KeySym keysym = Display::K_Pointer_Button1);
00052 
00053   // destructor
00054   virtual ~WCInvisTool();
00055 
00056   // Functions called by the local event handling operators -
00057   // these handle the drawing of the rectangle.  In special 
00058   // conditions, namely double clicking the key, they will
00059   // pass control on to the doubleInside and doubleOutside
00060   // functions
00061   // <group>
00062   virtual void keyPressed(const WCPositionEvent &/*ev*/);
00063   virtual void keyReleased(const WCPositionEvent &/*ev*/);
00064   virtual void moved(const WCMotionEvent &/*ev*/, const viewer::region::region_list_type & /*selected_regions*/);
00065   // </group>
00066 
00067   // Function called when a position is ready
00068   virtual void positionReady() { };
00069 
00070   // Retrieve the position in linear WorldCanvas coordinates
00071   virtual void get(Double &x, Double &y) const;
00072 
00073   // Retrieve the position in fractional linear WorldCanvas coordinates
00074   virtual void getFractional(Double &x, Double &y) const;
00075 
00076  private:
00077 
00078   // are we actively marking positions?
00079   Bool itsActive;
00080 
00081   // have we moved
00082   Bool itsMoved;
00083 
00084   // linear coordinates of the position
00085   Double itsX, itsY;
00086 
00087 };
00088 
00089 
00090 } //# NAMESPACE CASA - END
00091 
00092 #endif