casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MWCPTRegion.h
Go to the documentation of this file.
1 //# MWCPTRegion.h: MultiWorldCanvas event-based polygon 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_MWCPTREGION_H
29 #define TRIALDISPLAY_MWCPTREGION_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
38 //#include <display/Display/WorldCanvas.h>
40 
41 namespace casa { //# NAMESPACE CASA - BEGIN
42 
43 // <summary>
44 // WorldCanvas event-based polygon region drawer
45 // </summary>
46 
47 // <use visibility=export>
48 
49 // <reviewed reviewer="" data="yyyy/mm/dd" tests="" demos="">
50 // </reviewed>
51 
52 // <prerequisites>
53 // <li> WCRectTool
54 // </prerequisites>
55 
56 // <etymology>
57 // WCPTRegion stands for WorldCanvas Polygon Tool Region
58 // </etymology>
59 
60 // <synopsis>
61 // This class finalises the functionality in WCRectTool to
62 // implement event-based drawing of polygonal regions on a
63 // WorldCanvas. casacore::Double clicking inside the constructed polygon
64 // emits the region, whilst pressing Escape cancels the region.
65 // </synopsis>
66 
67 // <example>
68 // </example>
69 
70 // <motivation>
71 // Polygonal regions are the most common regions, and constructing
72 // them visually can be very efficient.
73 // </motivation>
74 
75 // <todo asof="1999/02/10">
76 // <li> Nothing known
77 // </todo>
78 
79  class MWCPTRegion : public MWCPolyTool {
80 
81  public:
82 
83  // Constructor
85 
86  // Destructor
87  virtual ~MWCPTRegion();
88 
89  protected:
90 
91  // Handle double-click inside the polygon. Invokes regionReady().
92  virtual void doubleInside();
93 
94  // This function is called when a region is deliberately "finished"
95  // by the user. It can be implemented to do further actions, such
96  // as report the region to the application.
97  virtual void regionReady() { };
98 
99  // get the world coords of the current polygon region
101 
102  // get the linear coords of the current ploygon region
104 
105  };
106 
107 
108 } //# NAMESPACE CASA - END
109 
110 #endif
WorldCanvas event-based polygon region drawer.
Definition: MWCPTRegion.h:79
void getWorldCoords(casacore::Vector< casacore::Double > &x, casacore::Vector< casacore::Double > &y)
get the world coords of the current polygon region
virtual ~MWCPTRegion()
Destructor.
virtual void doubleInside()
Handle double-click inside the polygon.
virtual void regionReady()
This function is called when a region is deliberately &quot;finished&quot; by the user.
Definition: MWCPTRegion.h:97
MWCPTRegion(Display::KeySym keysym=Display::K_Pointer_Button3)
Constructor.
Base class for WorldCanvas event-based polygon tools.
Definition: MWCPolyTool.h:88
void getLinearCoords(casacore::Vector< casacore::Double > &x, casacore::Vector< casacore::Double > &y)
get the linear coords of the current ploygon region
KeySym
Keysyms for PixelCanvas keyboard events.
Definition: DisplayEnums.h:412