casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
DDDHandle.h
Go to the documentation of this file.
00001 //# DDDHandle.h: class to draw handles on DDDObjects
00002 //# Copyright (C) 1999,2000,2001
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_DDDHANDLE_H
00029 #define TRIALDISPLAY_DDDHANDLE_H
00030 
00031 #include <casa/aips.h>
00032 #include <casa/Exceptions.h>
00033 #include <casa/Arrays/Vector.h>
00034 #include <casa/Arrays/Matrix.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary>
00039 // A class to draw and detect handles on a DDDObject
00040 // </summary>
00041 
00042 // <synopsis> This class defines a square handle and it's
00043 // behaviour. This can be used to interact with DDDObjects
00044 // </synopsis>
00045 
00046 class DDDHandle {
00047   
00048 public:
00049   // enum describing the size of the handle
00050   enum Size {NONE=0,SMALL,MEDIUM,LARGE};
00051 
00052   // Default constructor
00053   DDDHandle();
00054   // Constructor taking the position where to place the handle and it's size
00055   DDDHandle(Double posx, Double posy, DDDHandle::Size size=DDDHandle::MEDIUM);
00056 
00057   // Destructor.
00058   virtual ~DDDHandle();
00059   
00060   // This function returns true when the input poistion is within the handle
00061   virtual Bool underCursor(Double posx, Double posy) const; 
00062 
00063   // give the handle a new size
00064   virtual void resize(const DDDHandle::Size& size);
00065   // move the handle to a new position
00066   virtual void move(Double dx, Double dy);
00067   
00068   // <group>
00069   // utility funtions to retrieve blc/trc of the handle or the handle corners
00070   virtual Double blcX() const;
00071   virtual Double blcY() const;
00072   virtual Double trcX() const;
00073   virtual Double trcY() const;
00074   Matrix<Double> getHandle() const {return itsCorners;};
00075   // </group>
00076 
00077   // set up the handle
00078   // <group>
00079   void createHandle(Double x, Double y);
00080   void createHandle(const Vector<Double>& point);
00081   // </group>
00082 
00083   DDDHandle(const DDDHandle &);
00084   void operator=(const DDDHandle &);
00085 
00086 private:
00087   // the corners
00088   Matrix<Double> itsCorners;
00089   // the size
00090   DDDHandle::Size itsSize;
00091 
00092 };
00093 
00094 
00095 } //# NAMESPACE CASA - END
00096 
00097 #endif