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