casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CachingDisplayMethod.h
Go to the documentation of this file.
1 //# CachingDisplayMethod.h: assistance for auto-caching DisplayData objects
2 //# Copyright (C) 1999,2000,2001
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_CACHINGDISPLAYMETHOD_H
29 #define TRIALDISPLAY_CACHINGDISPLAYMETHOD_H
30 
31 #include <casa/aips.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37  class AttributeBuffer;
38  class WorldCanvas;
39  class WorldCanvasHolder;
40  class CachingDisplayData;
41 
42 // <summary>
43 // Assistance class for auto-caching of DisplayData objects.
44 // </summary>
45 
46 // <use visibility=export>
47 
48 // <reviewed reviewer="" data="" tests="" demos="">
49 // </reviewed>
50 
51 // <prerequisite>
52 // <li> <linkto class=DisplayMethod> DisplayMethod </linkto>
53 // <li> <linkto class=CachingDisplayData> CachingDisplayData </linkto>
54 // </prerequisite>
55 
56 // <etymology>
57 // "CachingDisplayMethod" is an implementation of a <linkto
58 // class=DisplayMethod> DisplayMethod </linkto> which provides a
59 // single element in a cache of individual depictions of some data.
60 // </etymology>
61 
62 // <synopsis>
63 // </synopsis>
64 
65 
67 
68  public:
69 
70  // Constructor. A single instance of a CachingDisplayMethod is
71  // setup to draw on a particular WorldCanvas, and only when
72  // particular conditions, as stored in the provided
73  // AttributeBuffers, are met. The parent DisplayData is given
74  // in <src>parentDisplayData</src>.
76  AttributeBuffer *wchAttributes,
77  AttributeBuffer *ddAttributes,
79 
80  // Destructor.
81  virtual ~CachingDisplayMethod();
82 
83  // Return the WorldCanvas recorded in this CachingDisplayMethod.
84  virtual WorldCanvas *worldCanvas() {
85  return itsWorldCanvas;
86  }
87 
88  // Draw this slice of data on the supplied WorldCanvasHolder.
89  virtual void draw(Display::RefreshReason reason,
90  WorldCanvasHolder &wcHolder);
91 
92  protected:
93 
94  // (Required) default constructor.
96 
97  // (Required) copy constructor.
99 
100  // (Required) copy assignment.
101  void operator=(const CachingDisplayMethod &other);
102 
103  // Draw into a cached drawing list, called by draw function.
104  // The return value is set false if the DM could not draw or
105  // does not wish a drawlist to be saved.
107  WorldCanvasHolder &wcHolder) = 0;
108 
109  private:
110 
111  // Store for the WorldCanvas which this has previously drawn upon.
113 
114  // Store for WorldCanvasHolder- and DisplayData-specific
115  // AttributeBuffers.
117 
118  // Do we have a cached drawing list?
120 
121  // Store for cached drawing list number.
123 
124  };
125 
126 
127 } //# NAMESPACE CASA - END
128 
129 #endif
Assistance class for auto-caching of DisplayData objects.
virtual void draw(Display::RefreshReason reason, WorldCanvasHolder &wcHolder)
Draw this slice of data on the supplied WorldCanvasHolder.
casacore::Bool itsHasList
Do we have a cached drawing list?
Buffer for storing Attributes.
casacore::uInt itsCachedDrawingList
Store for cached drawing list number.
virtual ~CachingDisplayMethod()
Destructor.
virtual WorldCanvas * worldCanvas()
Return the WorldCanvas recorded in this CachingDisplayMethod.
Base class for auto-caching DisplayData objects.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
WorldCanvas * itsWorldCanvas
Store for the WorldCanvas which this has previously drawn upon.
CachingDisplayMethod()
(Required) default constructor.
virtual casacore::Bool drawIntoList(Display::RefreshReason reason, WorldCanvasHolder &wcHolder)=0
Draw into a cached drawing list, called by draw function.
DisplayData * parentDisplayData()
Return the parent DisplayData.
RefreshReason
Callback reasons for PCRefreshEvent and WCRefreshEvent.
Definition: DisplayEnums.h:267
void operator=(const CachingDisplayMethod &other)
(Required) copy assignment.
Base class for drawing a particular element (view) of a DisplayData.
Definition: DisplayMethod.h:56
A holder to interface between DisplayDatas and a WorldCanvas.
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
AttributeBuffer * itsWCHAttributes
Store for WorldCanvasHolder- and DisplayData-specific AttributeBuffers.
unsigned int uInt
Definition: aipstype.h:51