casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DSSquare.h
Go to the documentation of this file.
1 //# DSSquare.h: Square implementation for "DisplayShapes"
2 //# Copyright (C) 1998,1999,2000,2001,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id:
27 
28 #ifndef TRIALDISPLAY_DSSQUARE_H
29 #define TRIALDISPLAY_DSSQUARE_H
30 
31 #include <casa/aips.h>
32 
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37 // <summary>
38 // Implementation of a square.
39 // </summary>
40 //
41 // <prerequisite>
42 // <li> <linkto class="DSLine">DSLine</linkto>
43 // <li> <linkto class="DSPoly">DSPoly</linkto>
44 // <li> <linkto class="DisplayShape">DisplayShape</linkto>
45 // </prerequisite>
46 //
47 // <etymology>
48 // DSSquare is a method of managing the drawing of a square onto a PixelCanvas.
49 // </etymology>
50 //
51 // <synopsis>
52 // DSSquare simple extends DSRectangle, and takes much of its functionality
53 // from there. It also overrides some functions to ensure that during
54 // manipulation of the shape, it remains a square.
55 //
56 // There are generally two ways to make DisplayShape(s); To create them in
57 // "one hit" by providing arguments to the constructor, or by using the
58 // default constructor and then the "setOptions" method. A simple interface
59 // for all classes inheriting from the
60 // <linkto class="DisplayShape">DisplayShape</linkto> class is provided by
61 // <linkto class="DisplayShapeInterface">DisplayShapeInterface</linkto>.
62 // </synopsis>
63 //
64 // <motivation>
65 // To enable the drawing of squares onto a pixel canvas
66 // </motivation>
67 //
68 // <example>
69 // </example>
70 
71 
72  class DSSquare : public DSRectangle {
73 
74  public:
75 
76  // Default constructor
77  DSSquare();
78 
79  // Constructor. Accepts the centre (xPos, yPos), the size (height/width
80  // in pixels), and whether or not it will ever have handles and if
81  // so, whether to draw them now.
82  DSSquare(const casacore::Float& xPos, const casacore::Float& yPos, const casacore::Float& size,
83  const casacore::Bool& handles = false, const casacore::Bool& drawHandles = false);
84 
85  // Copy cons.
86  DSSquare(const DSSquare& other);
87 
88  // Destructor
89  virtual ~DSSquare();
90 
91  // Copy constructor
92 
93 
94  // Set the size of the square in pixels
95  virtual void setSize(const casacore::Float& size);
96 
97  // Change the points, while maintaining the shape as a square
98  // <group>
99  virtual void changePoint(const casacore::Vector<casacore::Float>& pos);
100  virtual void changePoint(const casacore::Vector<casacore::Float>& pos, const casacore::Int nPoint);
101  // </group>
102 
103  // Get and set options
104  // <group>
105  virtual casacore::Bool setOptions(const casacore::Record& settings);
106  virtual casacore::Record getOptions();
107  // </group>
108 
109  private:
110 
111  };
112 
113 } //# NAMESPACE CASA - END
114 
115 #endif
116 
117 
118 
119 
120 
DSSquare()
Default constructor.
int Int
Definition: aipstype.h:50
Implementation of a rectangle.
Definition: DSRectangle.h:80
virtual void setSize(const casacore::Float &size)
Copy constructor.
size_t size() const
virtual casacore::Bool setOptions(const casacore::Record &settings)
Get and set options.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual ~DSSquare()
Destructor.
float Float
Definition: aipstype.h:54
virtual void changePoint(const casacore::Vector< casacore::Float > &pos)
Change the points, while maintaining the shape as a square.
virtual casacore::Record getOptions()
Get and set options.
Implementation of a square.
Definition: DSSquare.h:72