casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MWCRTRegion.h
Go to the documentation of this file.
1 //# MWCRTRegion.h: WorldCanvas event-based rectangle region drawer
2 //# Copyright (C) 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_MWCRTREGION_H
29 #define TRIALDISPLAY_MWCRTREGION_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> MWCRectTool
53 // </prerequisites>
54 
55 // <etymology>
56 // MWCRTRegion stands for MultiWorldCanvas Rectangle Tool Region
57 // </etymology>
58 
59 // <synopsis>
60 // This class finalises the functionality in MWCRectTool 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 MWCRTRegion : public MWCRectTool {
79 
80  public:
81 
82  // Constructor
84 
85  // Destructor
86  virtual ~MWCRTRegion();
87 
88  // handle events, via new-style interface. Currently just for reset event.
89  virtual void handleEvent(DisplayEvent& ev);
90 
91  protected:
92 
93  // Handle double-click inside the rectangle. Invokes regionReady().
94  virtual void doubleInside();
95 
96  // This function is called when a region is deliberately "finished"
97  // by the user. It can be implemented to do further actions, such
98  // as report the region to the application
99  virtual void regionReady() { };
100 
101  // get the world coords of the current rectangular region
103 
104  // get the linear coords of the current rectangular region
106 
107  };
108 
109 
110 } //# NAMESPACE CASA - END
111 
112 #endif
Base class for MultiWorldCanvas event-based rectangle tools.
Definition: MWCRectTool.h:84
WorldCanvas event-based rectangle region drawer.
Definition: MWCRTRegion.h:78
virtual ~MWCRTRegion()
Destructor.
Class describing the most basic event information in the display classes.
Definition: DisplayEvent.h:82
virtual void regionReady()
This function is called when a region is deliberately &quot;finished&quot; by the user.
Definition: MWCRTRegion.h:99
void getLinearCoords(casacore::Vector< casacore::Double > &blc, casacore::Vector< casacore::Double > &trc)
get the linear coords of the current rectangular region
MWCRTRegion(Display::KeySym keysym=Display::K_Pointer_Button2)
Constructor.
void getWorldCoords(casacore::Vector< casacore::Double > &blc, casacore::Vector< casacore::Double > &trc)
get the world coords of the current rectangular region
virtual void doubleInside()
Handle double-click inside the rectangle.
virtual void handleEvent(DisplayEvent &ev)
handle events, via new-style interface.
KeySym
Keysyms for PixelCanvas keyboard events.
Definition: DisplayEnums.h:412