casa
$Rev:20696$
|
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 virtual void operator()(const WCPositionEvent &ev); 00077 virtual void operator()(const WCMotionEvent &ev); 00078 // </group> 00079 00080 protected: 00081 00082 // (Required) default constructor. 00083 DDDRectangle(); 00084 00085 // (Required) copy constructor. 00086 DDDRectangle(const DDDRectangle &other); 00087 00088 // (Required) copy assignment. 00089 void operator=(const DDDRectangle &other); 00090 00091 private: 00092 00093 // Blc and trc of rectangle in world coordinates. 00094 Vector<Double> itsBlc, itsTrc; 00095 00096 // Handle coordinates. 00097 Vector<Int> itsHX, itsHY; 00098 00099 // Mode. 00100 DDDObject::Mode itsMode; 00101 00102 // Store for movement bases. 00103 Int itsBaseMoveX, itsBaseMoveY; 00104 00105 // is it a left handle? a bottom handle? 00106 Bool itsLeftHandle, itsBottomHandle; 00107 00108 }; 00109 00110 00111 } //# NAMESPACE CASA - END 00112 00113 #endif