casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
DisplayShapeWithCoords.h
Go to the documentation of this file.
00001 //# DisplayShapeWithCoords.h : Base class for DisplayShapes with Coords
00002 //# Copyright (C) 1998,1999,2000,2001,2002
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 #ifndef TRIALDISPLAY_DISPLAYSHAPEWITHCOORDS_H
00028 #define TRIALDISPLAY_DISPLAYSHAPEWITHCOORDS_H
00029 
00030 #include <casa/aips.h>
00031 #include <display/DisplayShapes/DisplayShape.h>
00032 
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035 // <summary>
00036 // Base class for DisplayShapes with Coords
00037 // </summary>
00038 
00039 class Record;
00040 class PixelCanvas;
00041 class PanelDisplay;
00042 class WorldCanvas;
00043 
00044 template <class T> class Vector;
00045 template <class T> class Matrix;
00046 
00047 class DisplayShapeWithCoords {
00048   
00049 public:
00050   virtual Record getRawOptions() = 0;
00051 
00052   static void floatToPix(Record& inHere, const String& field);
00053   static void floatPointToPix(Record& inHere, const String& field);
00054 
00055   static void matrixFloatToQuant(Record& inHere, const String& field,
00056                                  const String& unit);
00057   static void matrixFloatFromQuant(Record& inHere, 
00058                                    const String& field,
00059                                    const String& onlyParseTheseUnits);
00060 
00061   static void floatFromPix(Record& inHere, const String& field);
00062   static void floatPointFromPix(Record& inHere, const String& field);
00063 
00064   static WorldCanvas* chooseWCFromWorldPoint(const Record& settings, 
00065                                              PanelDisplay* pd);
00066 
00067   static WorldCanvas* chooseWCFromWorldPoints(const Record& settings,
00068                                               const String& fieldWithPoints,
00069                                               PanelDisplay* pd);
00070 
00071   static WorldCanvas* chooseWCFromPixPoint(const Float& xPos, 
00072                                            const Float& yPos,
00073                                            PanelDisplay* pd);
00074 
00075   static WorldCanvas* chooseWCFromPixPoints(const Matrix<Float> points,
00076                                             PanelDisplay* pd);
00077   
00078   static Vector<Float> floatPointFromQuant(const Record &inHere, 
00079                                            const String& field,
00080                                            String& units);
00081 
00082   static Vector<Float> relToScreen(const Vector<Float>& rel, PixelCanvas* pc);
00083   static Vector<Float> screenToRel(const Vector<Float>& screen, 
00084                                    PixelCanvas* pc);
00085 
00086   static Matrix<Float> relToScreen(const Matrix<Float>& rel, PixelCanvas* pc);
00087   static Matrix<Float> screenToRel(const Matrix<Float>& screen, 
00088                                    PixelCanvas* pc);
00089   
00090   static Bool inWorldCanvasDrawArea(const Matrix<Float> points, 
00091                                     WorldCanvas* wc);
00092 
00093   static void pixelToWorldPoints(Record& inHere, const String& fieldname,
00094                                  WorldCanvas* wc);
00095   virtual ~DisplayShapeWithCoords(){}
00096   
00097 };
00098 
00099 } //# NAMESPACE CASA - END
00100 
00101 #endif
00102 
00103 
00104 
00105 
00106 
00107