casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WCPGFilter.h
Go to the documentation of this file.
00001 //# WCPGFilter.h: interface between WorldCanvas and its PGPLOT driver
00002 //# Copyright (C) 1993,1994,1995,1996,1998,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_WCPGFILTER_H
00029 #define TRIALDISPLAY_WCPGFILTER_H
00030 
00031 #include <casa/aips.h>
00032 
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035 class WorldCanvas;
00036 template <class T> class Matrix;
00037 template <class T> class Vector;
00038 
00039 // <summary>
00040 // Interface between the WorldCanvas and its PGPLOT driver.
00041 // </summary>
00042 
00043 // <use visibility=export>
00044 
00045 // <reviewed>
00046 // </reviewed>
00047   
00048 // <prerequisite>
00049 // <li> none
00050 // </prerequisite>
00051 
00052 // <etymology>
00053 // "WCPGFilter" is a contraction and concatenation of "WorldCanvas," 
00054 // "PGPLOT" and "Filter", and is a simple filtering interface between
00055 // the WorldCanvas and its PGPLOT driver.
00056 // </etymology>
00057 
00058 // <synopsis>
00059 // </synopsis>
00060 
00061 // <motivation>
00062 // </motivation>
00063 
00064 // <example>
00065 // </example>
00066 
00067 // <todo>
00068 // </todo>
00069 
00070 class WCPGFilter {
00071 
00072  public:
00073 
00074   // Constructor taking a pointer to a WorldCanvas.
00075   WCPGFilter(WorldCanvas *wc);
00076 
00077   // Destructor.
00078   virtual ~WCPGFilter();
00079 
00080   // Reference counting: ref, unref and refCount.
00081   // <group>
00082   virtual void ref()
00083     { itsRefCount++; }
00084   virtual void unref() 
00085     { itsRefCount--; }
00086   virtual Int refCount() const 
00087     { return itsRefCount; }
00088   // </group>
00089 
00090   // Return the PGPLOT device id.
00091   virtual Int pgid() const 
00092     { return Int(itsPgPlotID); }
00093 
00094   // Realign the PGPLOT domain to the WorldCanvas domain.  If linear
00095   // is False, then the pgplot canvas is setup to match the world
00096   // coordinates, but of course is only valid where the world
00097   // coordinates are linear to first approximation.
00098   Bool realign(const Bool &linear = True);
00099 
00100   // Contour using pgcont function.
00101   void cont(const Matrix<Float> &m,
00102             const Vector<Float> &levels,
00103             const Matrix<Float> &tr);
00104 
00105   // Contour using pgconb function. (contour with blanks)
00106   void conb(const Matrix<Float> &m,
00107             const Vector<Float> &levels,
00108             const Matrix<Float> &tr,
00109             const Float blank);
00110 
00111  private:
00112 
00113   // Store for the WorldCanvas this filters for.
00114   WorldCanvas *itsWorldCanvas;
00115 
00116   // Store the PGPLOT device id here.
00117   uInt itsPgPlotID;
00118 
00119   // Reference counting.
00120   Int itsRefCount;
00121 
00122   // Split contours into positive and negative
00123    void splitContours (Vector<Float>& neg, Vector<Float>& pos,
00124                        const Vector<Float>& levels);
00125 
00126 
00127 };
00128 
00129 
00130 } //# NAMESPACE CASA - END
00131 
00132 #endif
00133