casa
$Rev:20696$
|
00001 //# DSSquare.h: Square implementation for "DisplayShapes" 00002 //# Copyright (C) 1998,1999,2000,2001,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_DSSQUARE_H 00029 #define TRIALDISPLAY_DSSQUARE_H 00030 00031 #include <casa/aips.h> 00032 00033 #include <display/DisplayShapes/DSRectangle.h> 00034 00035 namespace casa { //# NAMESPACE CASA - BEGIN 00036 00037 // <summary> 00038 // Implementation of a square. 00039 // </summary> 00040 // 00041 // <prerequisite> 00042 // <li> <linkto class="DSLine">DSLine</linkto> 00043 // <li> <linkto class="DSPoly">DSPoly</linkto> 00044 // <li> <linkto class="DisplayShape">DisplayShape</linkto> 00045 // </prerequisite> 00046 // 00047 // <etymology> 00048 // DSSquare is a method of managing the drawing of a square onto a PixelCanvas. 00049 // </etymology> 00050 // 00051 // <synopsis> 00052 // DSSquare simple extends DSRectangle, and takes much of its functionality 00053 // from there. It also overrides some functions to ensure that during 00054 // manipulation of the shape, it remains a square. 00055 // 00056 // There are generally two ways to make DisplayShape(s); To create them in 00057 // "one hit" by providing arguments to the constructor, or by using the 00058 // default constructor and then the "setOptions" method. A simple interface 00059 // for all classes inheriting from the 00060 // <linkto class="DisplayShape">DisplayShape</linkto> class is provided by 00061 // <linkto class="DisplayShapeInterface">DisplayShapeInterface</linkto>. 00062 // </synopsis> 00063 // 00064 // <motivation> 00065 // To enable the drawing of squares onto a pixel canvas 00066 // </motivation> 00067 // 00068 // <example> 00069 // </example> 00070 00071 00072 class DSSquare : public DSRectangle { 00073 00074 public: 00075 00076 // Default constructor 00077 DSSquare(); 00078 00079 // Constructor. Accepts the centre (xPos, yPos), the size (height/width 00080 // in pixels), and whether or not it will ever have handles and if 00081 // so, whether to draw them now. 00082 DSSquare(const Float& xPos, const Float& yPos, const Float& size, 00083 const Bool& handles = False, const Bool& drawHandles = False); 00084 00085 // Copy cons. 00086 DSSquare(const DSSquare& other); 00087 00088 // Destructor 00089 virtual ~DSSquare(); 00090 00091 // Copy constructor 00092 00093 00094 // Set the size of the square in pixels 00095 virtual void setSize(const Float& size); 00096 00097 // Change the points, while maintaining the shape as a square 00098 // <group> 00099 virtual void changePoint(const Vector<Float>& pos); 00100 virtual void changePoint(const Vector<Float>& pos, const Int nPoint); 00101 // </group> 00102 00103 // Get and set options 00104 // <group> 00105 virtual Bool setOptions(const Record& settings); 00106 virtual Record getOptions(); 00107 // </group> 00108 00109 private: 00110 00111 }; 00112 00113 } //# NAMESPACE CASA - END 00114 00115 #endif 00116 00117 00118 00119 00120