CachingDisplayMethod.h

Go to the documentation of this file.
00001 //# CachingDisplayMethod.h: assistance for auto-caching DisplayData objects
00002 //# Copyright (C) 1999,2000,2001
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_CACHINGDISPLAYMETHOD_H
00029 #define TRIALDISPLAY_CACHINGDISPLAYMETHOD_H
00030 
00031 #include <casa/aips.h>
00032 #include <display/Display/DisplayEnums.h>
00033 #include <display/DisplayDatas/DisplayMethod.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037         class AttributeBuffer;
00038         class WorldCanvas;
00039         class WorldCanvasHolder;
00040         class CachingDisplayData;
00041 
00042 // <summary>
00043 // Assistance class for auto-caching of DisplayData objects.
00044 // </summary>
00045 
00046 // <use visibility=export>
00047 
00048 // <reviewed reviewer="" data="" tests="" demos="">
00049 // </reviewed>
00050 
00051 // <prerequisite>
00052 // <li> <linkto class=DisplayMethod> DisplayMethod </linkto>
00053 // <li> <linkto class=CachingDisplayData> CachingDisplayData </linkto>
00054 // </prerequisite>
00055 
00056 // <etymology>
00057 // "CachingDisplayMethod" is an implementation of a <linkto
00058 // class=DisplayMethod> DisplayMethod </linkto> which provides a
00059 // single element in a cache of individual depictions of some data.
00060 // </etymology>
00061 
00062 // <synopsis>
00063 // </synopsis>
00064 
00065 
00066         class CachingDisplayMethod : public DisplayMethod {
00067 
00068         public:
00069 
00070                 // Constructor.  A single instance of a CachingDisplayMethod is
00071                 // setup to draw on a particular WorldCanvas, and only when
00072                 // particular conditions, as stored in the provided
00073                 // AttributeBuffers, are met.  The parent DisplayData is given
00074                 // in <src>parentDisplayData</src>.
00075                 CachingDisplayMethod(WorldCanvas *worldCanvas,
00076                                      AttributeBuffer *wchAttributes,
00077                                      AttributeBuffer *ddAttributes,
00078                                      CachingDisplayData *parentDisplayData);
00079 
00080                 // Destructor.
00081                 virtual ~CachingDisplayMethod();
00082 
00083                 // Return the WorldCanvas recorded in this CachingDisplayMethod.
00084                 virtual WorldCanvas *worldCanvas() {
00085                         return itsWorldCanvas;
00086                 }
00087 
00088                 // Draw this slice of data on the supplied WorldCanvasHolder.
00089                 virtual void draw(Display::RefreshReason reason,
00090                                   WorldCanvasHolder &wcHolder);
00091 
00092         protected:
00093 
00094                 // (Required) default constructor.
00095                 CachingDisplayMethod();
00096 
00097                 // (Required) copy constructor.
00098                 CachingDisplayMethod(const CachingDisplayMethod &other);
00099 
00100                 // (Required) copy assignment.
00101                 void operator=(const CachingDisplayMethod &other);
00102 
00103                 // Draw into a cached drawing list, called by draw function.
00104                 // The return value is set False if the DM could not draw or
00105                 // does not wish a drawlist to be saved.
00106                 virtual Bool drawIntoList(Display::RefreshReason reason,
00107                                           WorldCanvasHolder &wcHolder) = 0;
00108 
00109         private:
00110 
00111                 // Store for the WorldCanvas which this has previously drawn upon.
00112                 WorldCanvas *itsWorldCanvas;
00113 
00114                 // Store for WorldCanvasHolder- and DisplayData-specific
00115                 // AttributeBuffers.
00116                 AttributeBuffer *itsWCHAttributes, *itsDDAttributes;
00117 
00118                 // Do we have a cached drawing list?
00119                 Bool itsHasList;
00120 
00121                 // Store for cached drawing list number.
00122                 uInt itsCachedDrawingList;
00123 
00124         };
00125 
00126 
00127 } //# NAMESPACE CASA - END
00128 
00129 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1