DDDRectangle.h

Go to the documentation of this file.
00001 //# DDDRectangle.h: implementation of rectangular DDDObject
00002 //# Copyright (C) 1999,2000,2002
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_DDDRECTANGLE_H
00029 #define TRIALDISPLAY_DDDRECTANGLE_H
00030 
00031 #include <casa/aips.h>
00032 #include <casa/Arrays/Vector.h>
00033 #include <casa/Containers/Record.h>
00034 #include <display/DisplayDatas/DDDObject.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary>
00039 // Implementation of a rectangular object for DrawingDisplayData class.
00040 // </summary>
00041 
00042 // <synopsis>
00043 // This class implements the interface defined by DDDObject, to provide
00044 // a rectangle object for registration with DrawingDisplayData objects.
00045 // </synopsis>
00046 
00047         class DDDRectangle : public DDDObject {
00048 
00049         public:
00050 
00051                 // Constructor taking a Record description.  Fields in the record,
00052                 // on top of what is consumed by the DDDObject constructor, are:
00053                 // <src>blc</src> and <src>trc</src>.
00054                 DDDRectangle(const Record &description, DrawingDisplayData *owner);
00055 
00056                 // Destructor.
00057                 virtual ~DDDRectangle();
00058 
00059 
00060                 // Draw this rectangle object for the given reason on the provided
00061                 // WorldCanvas.
00062                 virtual void draw(const Display::RefreshReason &reason,
00063                                   WorldCanvas *worldcanvas);
00064 
00065                 // Return a record describing this object.
00066                 virtual Record description();
00067 
00068                 // Update this object based on the information in the provided
00069                 // Record.
00070                 virtual void setDescription(const Record &rec);
00071 
00072                 // Event handlers.  The parent DrawingDisplayData will distribute
00073                 // events as necessary to the various DDDObjects which comprise it.
00074                 // <group>
00075                 virtual void operator()(const WCRefreshEvent &/*ev*/) {
00076                         ;
00077                 };
00078                 virtual void operator()(const WCPositionEvent &ev);
00079                 virtual void operator()(const WCMotionEvent &ev);
00080                 // </group>
00081 
00082         protected:
00083 
00084                 // (Required) default constructor.
00085                 DDDRectangle();
00086 
00087                 // (Required) copy constructor.
00088                 DDDRectangle(const DDDRectangle &other);
00089 
00090                 // (Required) copy assignment.
00091                 void operator=(const DDDRectangle &other);
00092 
00093         private:
00094 
00095                 // Blc and trc of rectangle in world coordinates.
00096                 Vector<Double> itsBlc, itsTrc;
00097 
00098                 // Handle coordinates.
00099                 Vector<Int> itsHX, itsHY;
00100 
00101                 // Mode.
00102                 DDDObject::Mode itsMode;
00103 
00104                 // Store for movement bases.
00105                 Int itsBaseMoveX, itsBaseMoveY;
00106 
00107                 // is it a left handle?  a bottom handle?
00108                 Bool itsLeftHandle, itsBottomHandle;
00109 
00110         };
00111 
00112 
00113 } //# NAMESPACE CASA - END
00114 
00115 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1