PCVGBuffer.h

Go to the documentation of this file.
00001 //# PCVGBuffer.h: buffering vector graphics for the PixelCanvases
00002 //# Copyright (C) 1993,1994,1995,1996,1998,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_PCVGBUFFER_H
00029 #define TRIALDISPLAY_PCVGBUFFER_H
00030 
00031 #include <casa/aips.h>
00032 #include <casa/Arrays/Matrix.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036         class PixelCanvas;
00037 
00038 // <summary>
00039 //
00040 // </summary>
00041 //
00042 // <use visibility=export>
00043 //
00044 // <reviewed>
00045 // </reviewed>
00046 //
00047 // <prerequisite>
00048 // <li> none
00049 // </prerequisite>
00050 //
00051 // <etymology>
00052 // The name of PCVGBuffer comes from ...
00053 // </etymology>
00054 //
00055 // <synopsis>
00056 // Display Class File
00057 // </synopsis>
00058 //
00059 // <motivation>
00060 // </motivation>
00061 //
00062 // <example>
00063 // none available.
00064 // </example>
00065 //
00066 // <todo>
00067 // <li> write and test!
00068 // </todo>
00069 //
00070 
00071         class PCVGBuffer {
00072 
00073         public:
00074 
00075                 enum AccumMode { AMNone,
00076                                  AMPoints,
00077                                  AMLines,
00078                                  AMPolyline,
00079                                  AMPolygon
00080                                };
00081 
00082                 // Default Constructor Required
00083                 PCVGBuffer(PixelCanvas * pc, uInt nVerts = 1024);
00084 
00085                 // User Constructor
00086                 PCVGBuffer();
00087 
00088                 // add point
00089                 void accumPoint(Float x, Float y);
00090 
00091                 // add line
00092                 void accumLine(Float x1, Float y1, Float x2, Float y2);
00093 
00094                 // add point to polyline
00095                 void accumPolylinePoint(Float x, Float y);
00096 
00097                 // add point to polygon
00098                 void accumPolygonPoint(Float x, Float y);
00099 
00100                 // flush the buffer
00101                 void flush();
00102 
00103                 // current mode
00104                 AccumMode mode() const {
00105                         return mode_;
00106                 }
00107 
00108                 // change modes
00109                 void setMode(AccumMode m);
00110 
00111                 // check size and make more if needed
00112                 void checkSpace();
00113 
00114                 // Destructor
00115                 virtual ~PCVGBuffer();
00116 
00117         private:
00118 
00119                 PixelCanvas * pc_;
00120 
00121                 AccumMode mode_;
00122                 uInt c_;
00123                 Matrix<Float> verts_;
00124                 uInt blockSize_;
00125 
00126         };
00127 
00128 
00129 } //# NAMESPACE CASA - END
00130 
00131 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1