casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PCRefreshEvent.h
Go to the documentation of this file.
1 //# PCRefreshEvent.h: class which stores PixelCanvas refresh event information
2 //# Copyright (C) 1993,1994,1995,1996,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_PCREFRESHEVENT_H
29 #define TRIALDISPLAY_PCREFRESHEVENT_H
30 
31 #include <casa/aips.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37  class PixelCanvas;
38 
39 // <summary>
40 // Class which stores PixelCanvas refresh event information.
41 // </summary>
42 
43 // <use visibility=export>
44 
45 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46 // </reviewed>
47 
48 // <etymology>
49 // "PCRefreshEvent" is a contraction and concatenation of "PixelCanvas",
50 // "Refresh" and "Event", and describes refresh events occuring on
51 // PixelCanvases.
52 // </etymology>
53 
54 // <prerequisite>
55 // <li> <linkto class=PixelCanvasEvent>PixelCanvasEvent</linkto>
56 // </prerequisite>
57 
58 // <synopsis>
59 // This class adds to the information stored in the <linkto
60 // class=PixelCanvasEvent>PixelCanvasEvent</linkto> class. It adds
61 // information describing the reason a refresh event has occurred. An
62 // object of this class is generated and distributed to all registered
63 // PCRefreshEvent handlers whenever a refresh is explicitly or
64 // implicitly generated on a PixelCanvas.
65 //
66 // The reason field can be used to minimize the computation required
67 // to redraw the screen, or it can be ignored, forcing all elements to
68 // be redrawn. The reason for the refresh can be one of the
69 // following:
70 //
71 // <dd> Display::UserCommand
72 // <dt> The refresh event was caused by the user explicitly calling
73 // the <linkto class=PixelCanvas>PixelCanvas</linkto> refresh
74 // function.
75 //
76 // <dd> Display::ColorTableChange
77 // <dt> The refresh event was caused by a change in the distribution
78 // of colors on the <linkto class=PixelCanvas>PixelCanvas</linkto>.
79 // Graphical elements that are dependent on colormaps need to be
80 // re-drawn. Cached display lists that include colormap-dependent
81 // graphical elements must be rebuilt.
82 //
83 // <dd> Display::ColormapChange
84 // <dt> This is a less severe version of the above refresh reason
85 // (Display::ColorTableChange), and means that a single Colormap has
86 // been modified, but that the overall distribution of colors remains
87 // unchanged, ie. other Colormaps in this PixelCanvas' ColorTable are
88 // unaffected.
89 //
90 // <dd> Display::PixelCoordinateChange
91 // <dt> The <linkto class=PixelCanvas>PixelCanvas</linkto> has changed
92 // size. Usually this means the graphics drawn must be translated to
93 // a new position (recentered) which can be done by translating all
94 // primitives and display lists.
95 //
96 // <dd> Display::LinearCoordinateChange
97 // <dt> The linear coordinate system which is overlaid on the
98 // PixelCanvas (normally by a <linkto
99 // class=WorldCanvas>WorldCanvas</linkto> has changed.
100 //
101 // <dd> Display::WorldCoordinateChange
102 // <dt> The world coordinate system which is overlaid on the
103 // PixelCanvas (normally by a <linkto
104 // class=WorldCanvas>WorldCanvas</linkto> has changed.
105 //
106 // <dd> Display::BackCopiedToFront
107 // <dt> The back buffer has been written to the screen. Only
108 // transient graphics drawers should be interested in this refresh
109 // reason. Any graphics which are required to be visible over
110 // everything else on the PixelCanvas (or WorldCanvas) should catch
111 // and respond to this refresh reason. Examples include interactively
112 // constructed regions, eg. a zooming box.
113 // </synopsis>
114 
115 // <example>
116 // </example>
117 
118 // <motivation>
119 // A compact way of passing refresh event information around the
120 // display classes was needed, with a functional but tight and
121 // efficient interface.
122 // </motivation>
123 
124 // <thrown>
125 // None.
126 // </thrown>
127 
128 // <todo asof="1999/10/15">
129 // None.
130 // </todo>
131 
133 
134  public:
135 
136  // Constructor taking a pointer to the PixelCanvas for which the
137  // event is valid, and the reason for the refresh.
139 
140  // Destructor.
141  virtual ~PCRefreshEvent();
142 
143  // Why did the refresh occur?
144  virtual Display::RefreshReason reason() const {
145  return itsRefreshReason;
146  }
147 
148  protected:
149 
150  // (Required) default constructor.
151  PCRefreshEvent();
152 
153  // (Required) copy constructor.
154  PCRefreshEvent(const PCRefreshEvent &other);
155 
156  // (Required) copy assignment.
157  PCRefreshEvent &operator=(const PCRefreshEvent &other);
158 
159  private:
160 
161  // Store the reason for the refresh here at construction.
163 
164  };
165 
166 
167 } //# NAMESPACE CASA - END
168 
169 #endif
170 
171 
virtual ~PCRefreshEvent()
Destructor.
virtual Display::RefreshReason reason() const
Why did the refresh occur?
Display::RefreshReason itsRefreshReason
Store the reason for the refresh here at construction.
Base class defining interface to pixel-based output devices.
Definition: PixelCanvas.h:161
Class which stores PixelCanvas refresh event information.
PCRefreshEvent()
(Required) default constructor.
RefreshReason
Callback reasons for PCRefreshEvent and WCRefreshEvent.
Definition: DisplayEnums.h:267
PCRefreshEvent & operator=(const PCRefreshEvent &other)
(Required) copy assignment.
Base class describing event information for PixelCanvases.