casa
$Rev:20696$
|
Class which stores WorldCanvas refresh event information. More...
#include <WCRefreshEvent.h>
Public Member Functions | |
WCRefreshEvent (WorldCanvas *wc, const Display::RefreshReason &reason) | |
Constructor taking a pointer to the WorldCanvas for which the event is valid, and the reason for the refresh. | |
virtual | ~WCRefreshEvent () |
Destructor. | |
virtual Display::RefreshReason | reason () const |
Why did the refresh occur? | |
Protected Member Functions | |
WCRefreshEvent () | |
(Required) default constructor. | |
WCRefreshEvent (const WCRefreshEvent &other) | |
(Required) copy constructor. | |
WCRefreshEvent & | operator= (const WCRefreshEvent &other) |
(Required) copy assignment. | |
Private Attributes | |
Display::RefreshReason | itsRefreshReason |
Store the reason for the refresh here at construction. |
Class which stores WorldCanvas refresh event information.
Public interface
"WCRefreshEvent" is a contraction and concatenation of "WorldCanvas", "Refresh" and "Event", and describes refresh events occuring on WorldCanvases.
This class adds to the information stored in the WorldCanvasEvent class. It adds information describing the reason a refresh event has occurred. An object of this class is generated and distributed to all registered WCRefreshEvent handlers whenever a refresh is explicitly or implicitly generated on a WorldCanvas.
The reason field can be used to minimize the computation required to redraw the screen, or it can be ignored, forcing all elements to be redrawn. The reason for the refresh can be one of the following:
The refresh event was caused by the user explicitly calling the WorldCanvas refresh function.
The refresh event was caused by a change in the distribution of colors on the PixelCanvas . Graphical elements that are dependent on colormaps need to be re-drawn. Cached display lists that include colormap-dependent graphical elements must be rebuilt.
This is a less severe version of the above refresh reason (Display::ColorTableChange), and means that a single Colormap has been modified, but that the overall distribution of colors remains unchanged, ie. other Colormaps in this WorldCanvas' ColorTable are unaffected.
Display::PixelCoordinateChange
The PixelCanvas has changed size. Usually this means the graphics drawn must be translated to a new position (recentered) which can be done by translating all primitives and display lists.
Display::LinearCoordinateChange
The linear coordinate system which is overlaid on the PixelCanvas (normally by a WorldCanvas has changed.
Display::WorldCoordinateChange
The world coordinate system which is overlaid on the PixelCanvas (normally by a WorldCanvas has changed.
The back buffer has been written to the screen. Only transient graphics drawers should be interested in this refresh reason. Any graphics which are required to be visible over everything else on the PixelCanvas (or WorldCanvas) should catch and respond to this refresh reason. Examples include interactively constructed regions, eg. a zooming box.
A compact way of passing refresh event information around the display classes was needed, with a functional but tight and efficient interface.
.
Definition at line 132 of file WCRefreshEvent.h.
casa::WCRefreshEvent::WCRefreshEvent | ( | WorldCanvas * | wc, |
const Display::RefreshReason & | reason | ||
) |
Constructor taking a pointer to the WorldCanvas for which the event is valid, and the reason for the refresh.
virtual casa::WCRefreshEvent::~WCRefreshEvent | ( | ) | [virtual] |
Destructor.
casa::WCRefreshEvent::WCRefreshEvent | ( | ) | [protected] |
(Required) default constructor.
casa::WCRefreshEvent::WCRefreshEvent | ( | const WCRefreshEvent & | other | ) | [protected] |
(Required) copy constructor.
WCRefreshEvent& casa::WCRefreshEvent::operator= | ( | const WCRefreshEvent & | other | ) | [protected] |
(Required) copy assignment.
virtual Display::RefreshReason casa::WCRefreshEvent::reason | ( | ) | const [inline, virtual] |
Why did the refresh occur?
Definition at line 144 of file WCRefreshEvent.h.
References itsRefreshReason.
Store the reason for the refresh here at construction.
Definition at line 161 of file WCRefreshEvent.h.
Referenced by reason().