casa
$Rev:20696$
|
00001 //# PCRefreshEvent.h: class which stores PixelCanvas refresh event information 00002 //# Copyright (C) 1993,1994,1995,1996,1999,2000 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef TRIALDISPLAY_PCREFRESHEVENT_H 00029 #define TRIALDISPLAY_PCREFRESHEVENT_H 00030 00031 #include <casa/aips.h> 00032 #include <display/Display/DisplayEnums.h> 00033 #include <display/DisplayEvents/PixelCanvasEvent.h> 00034 00035 namespace casa { //# NAMESPACE CASA - BEGIN 00036 00037 class PixelCanvas; 00038 00039 // <summary> 00040 // Class which stores PixelCanvas refresh event information. 00041 // </summary> 00042 00043 // <use visibility=export> 00044 00045 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00046 // </reviewed> 00047 00048 // <etymology> 00049 // "PCRefreshEvent" is a contraction and concatenation of "PixelCanvas", 00050 // "Refresh" and "Event", and describes refresh events occuring on 00051 // PixelCanvases. 00052 // </etymology> 00053 00054 // <prerequisite> 00055 // <li> <linkto class=PixelCanvasEvent>PixelCanvasEvent</linkto> 00056 // </prerequisite> 00057 00058 // <synopsis> 00059 // This class adds to the information stored in the <linkto 00060 // class=PixelCanvasEvent>PixelCanvasEvent</linkto> class. It adds 00061 // information describing the reason a refresh event has occurred. An 00062 // object of this class is generated and distributed to all registered 00063 // PCRefreshEvent handlers whenever a refresh is explicitly or 00064 // implicitly generated on a PixelCanvas. 00065 // 00066 // The reason field can be used to minimize the computation required 00067 // to redraw the screen, or it can be ignored, forcing all elements to 00068 // be redrawn. The reason for the refresh can be one of the 00069 // following: 00070 // 00071 // <dd> Display::UserCommand 00072 // <dt> The refresh event was caused by the user explicitly calling 00073 // the <linkto class=PixelCanvas>PixelCanvas</linkto> refresh 00074 // function. 00075 // 00076 // <dd> Display::ColorTableChange 00077 // <dt> The refresh event was caused by a change in the distribution 00078 // of colors on the <linkto class=PixelCanvas>PixelCanvas</linkto>. 00079 // Graphical elements that are dependent on colormaps need to be 00080 // re-drawn. Cached display lists that include colormap-dependent 00081 // graphical elements must be rebuilt. 00082 // 00083 // <dd> Display::ColormapChange 00084 // <dt> This is a less severe version of the above refresh reason 00085 // (Display::ColorTableChange), and means that a single Colormap has 00086 // been modified, but that the overall distribution of colors remains 00087 // unchanged, ie. other Colormaps in this PixelCanvas' ColorTable are 00088 // unaffected. 00089 // 00090 // <dd> Display::PixelCoordinateChange 00091 // <dt> The <linkto class=PixelCanvas>PixelCanvas</linkto> has changed 00092 // size. Usually this means the graphics drawn must be translated to 00093 // a new position (recentered) which can be done by translating all 00094 // primitives and display lists. 00095 // 00096 // <dd> Display::LinearCoordinateChange 00097 // <dt> The linear coordinate system which is overlaid on the 00098 // PixelCanvas (normally by a <linkto 00099 // class=WorldCanvas>WorldCanvas</linkto> has changed. 00100 // 00101 // <dd> Display::WorldCoordinateChange 00102 // <dt> The world coordinate system which is overlaid on the 00103 // PixelCanvas (normally by a <linkto 00104 // class=WorldCanvas>WorldCanvas</linkto> has changed. 00105 // 00106 // <dd> Display::BackCopiedToFront 00107 // <dt> The back buffer has been written to the screen. Only 00108 // transient graphics drawers should be interested in this refresh 00109 // reason. Any graphics which are required to be visible over 00110 // everything else on the PixelCanvas (or WorldCanvas) should catch 00111 // and respond to this refresh reason. Examples include interactively 00112 // constructed regions, eg. a zooming box. 00113 // </synopsis> 00114 00115 // <example> 00116 // </example> 00117 00118 // <motivation> 00119 // A compact way of passing refresh event information around the 00120 // display classes was needed, with a functional but tight and 00121 // efficient interface. 00122 // </motivation> 00123 00124 // <thrown> 00125 // None. 00126 // </thrown> 00127 00128 // <todo asof="1999/10/15"> 00129 // None. 00130 // </todo> 00131 00132 class PCRefreshEvent : public PixelCanvasEvent { 00133 00134 public: 00135 00136 // Constructor taking a pointer to the PixelCanvas for which the 00137 // event is valid, and the reason for the refresh. 00138 PCRefreshEvent(PixelCanvas *pc, const Display::RefreshReason &reason); 00139 00140 // Destructor. 00141 virtual ~PCRefreshEvent(); 00142 00143 // Why did the refresh occur? 00144 virtual Display::RefreshReason reason() const 00145 { return itsRefreshReason; } 00146 00147 protected: 00148 00149 // (Required) default constructor. 00150 PCRefreshEvent(); 00151 00152 // (Required) copy constructor. 00153 PCRefreshEvent(const PCRefreshEvent &other); 00154 00155 // (Required) copy assignment. 00156 PCRefreshEvent &operator=(const PCRefreshEvent &other); 00157 00158 private: 00159 00160 // Store the reason for the refresh here at construction. 00161 Display::RefreshReason itsRefreshReason; 00162 00163 }; 00164 00165 00166 } //# NAMESPACE CASA - END 00167 00168 #endif 00169 00170