casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WCRTRegion.h
Go to the documentation of this file.
1 //# WCRTRegion.h: WorldCanvas event-based rectangle region drawer
2 //# Copyright (C) 1999,2000
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_WCRTREGION_H
29 #define TRIALDISPLAY_WCRTREGION_H
30 
31 //# aips includes
32 #include <casa/aips.h>
33 #include <casa/Arrays/Vector.h>
34 
35 //# trial includes
36 
37 //# display library includes
39 
40 namespace casa { //# NAMESPACE CASA - BEGIN
41 
42 // <summary>
43 // WorldCanvas event-based rectangle region drawer
44 // </summary>
45 
46 // <use visibility=export>
47 
48 // <reviewed reviewer="" data="yyyy/mm/dd" tests="" demos="">
49 // </reviewed>
50 
51 // <prerequisites>
52 // <li> WCRectTool
53 // </prerequisites>
54 
55 // <etymology>
56 // WCRTRegion stands for WorldCanvas Rectangle Tool Region
57 // </etymology>
58 
59 // <synopsis>
60 // This class finalises the functionality in WCRectTool to
61 // implement event-based drawing of rectangular regions on a
62 // WorldCanvas. casacore::Double clicking inside the constructed rectangle
63 // emits the region, whilst pressing Escape cancels the region.
64 // </synopsis>
65 
66 // <example>
67 // </example>
68 
69 // <motivation>
70 // Rectangular regions are the most common regions, and constructing
71 // them visually can be very efficient.
72 // </motivation>
73 
74 // <todo asof="1999/02/10">
75 // <li> Nothing known
76 // </todo>
77 
78  class WCRTRegion : public WCRectTool {
79 
80  public:
81 
82  // Constructor
83  WCRTRegion(WorldCanvas *wcanvas,
85 
86  // Destructor
87  virtual ~WCRTRegion();
88 
89  // Functions specific to the region drawing - these are called by
90  // lower-level event handlers in the base classes
91  virtual void doubleInside();
92 
93  // This function is called when a region is deliberately "finished"
94  // by the user. It can be implemented to do further actions, such
95  // as report the region to the application
96  virtual void regionReady() { };
97 
98  private:
99 
100  // get the linear coords of the current rectangular region
102 
103  };
104 
105 
106 } //# NAMESPACE CASA - END
107 
108 #endif
Base class for WorldCanvas event-based rectangle tools.
Definition: WCRectTool.h:88
WorldCanvas event-based rectangle region drawer.
Definition: WCRTRegion.h:78
virtual void doubleInside()
Functions specific to the region drawing - these are called by lower-level event handlers in the base...
virtual void regionReady()
This function is called when a region is deliberately &quot;finished&quot; by the user.
Definition: WCRTRegion.h:96
virtual ~WCRTRegion()
Destructor.
WCRTRegion(WorldCanvas *wcanvas, Display::KeySym keysym=Display::K_Pointer_Button1)
Constructor.
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
void getLinearCoords(casacore::Vector< casacore::Double > &blc, casacore::Vector< casacore::Double > &trc)
get the linear coords of the current rectangular region
KeySym
Keysyms for PixelCanvas keyboard events.
Definition: DisplayEnums.h:412