casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
DTVisible.h
Go to the documentation of this file.
00001 //# DTVisible.h: class providing draw style settings for visible DisplayTools
00002 //# Copyright (C) 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_DTVISIBLE_H
00029 #define TRIALDISPLAY_DTVISIBLE_H
00030 
00031 #include <casa/aips.h>
00032 
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035 // <summary>
00036 // Class providing draw style settings for visible DisplayTools.
00037 // </summary>
00038 
00039 // <use visibility=local>
00040 
00041 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00042 // </reviewed>
00043 
00044 // <etymology>
00045 // "DTVisible" is a contraction and concatenation of "DisplayTool" and 
00046 // "Visible", and provides additional interface features describing 
00047 // drawing options for visible DisplayTools.
00048 // </etymology>
00049 
00050 // <synopsis>
00051 // The purpose of this class is to store and provide information
00052 // describing drawing settings for <linkto
00053 // class=DisplayTool>DisplayTools</linkto> which will need to draw on
00054 // a PixelCanvas or WorldCanvas.  Presently it only stores the drawing
00055 // color and line width, and double click interval, but it will 
00056 // probably grow into something
00057 // more sophisticated.  The settings are taken from the users
00058 // <src>.aipsrc</src> file as follows:
00059 //
00060 // <dd> <src>display.controls.color</src>
00061 // <dt> Either a named color (eg. <src>red</src>) can be given, or
00062 // the individual red, green and blue components specified in
00063 // hexadecimal (eg. <src>#f0f033</src>).  The default color is 
00064 // orange.
00065 //
00066 // <dd> <src>display.controls.linewidth</src>
00067 // <dt> An integer should be given specifying the line width 
00068 // to use when drawing DisplayTools.  The default value is one.
00069 //
00070 // <dd> <src>display.controls.doubleclickinterval</src>
00071 // <dt> A real number specifying the time interval in seconds, 
00072 // in which a double click will be deemed to have occurred.  The
00073 // default value is 0.5 seconds.
00074 // </synopsis>
00075 
00076 // <example>
00077 // </example>
00078 
00079 // <motivation>
00080 // Since many PixelCanvas- and WorldCanvas-based tools (derived from
00081 // <linkto class=PCTool>PCTool</linkto> and <linkto
00082 // class=WCTool>WCTool</linkto> respectively) will
00083 // need to draw on the canvas, it makes sense to unify their selection
00084 // of drawing color and style in one place: this class.
00085 // </motivation>
00086 
00087 // <thrown>
00088 // None.
00089 // </thrown>
00090 
00091 // <todo asof="1999/10/18">
00092 // None.
00093 // </todo>
00094 
00095 class DTVisible {
00096 
00097  public:
00098   
00099   // Default constructor.
00100   DTVisible();
00101 
00102   // Destructor.
00103   virtual ~DTVisible();
00104 
00105   // Return the color to use.
00106   virtual String drawColor() const
00107     { return itsDrawColor; }
00108 
00109   // Return the line width to use.
00110   virtual Int lineWidth() const
00111     { return itsLineWidth; }
00112 
00113   // Return the double click interval (in seconds).
00114   virtual Double doubleClickInterval() const
00115     { return itsDoubleClickInterval; }
00116 
00117  protected:
00118 
00119   // (Required) copy constructor.
00120   DTVisible(const DTVisible &other);
00121 
00122   // (Required) copy assignment.
00123   DTVisible &operator=(const DTVisible &other);
00124 
00125  private:
00126 
00127   // Store the color to use here.
00128   String itsDrawColor;
00129 
00130   // Store the line width here.
00131   Int itsLineWidth;
00132 
00133   // Store the double click interval (in seconds) here.
00134   Double itsDoubleClickInterval;
00135 
00136 };
00137 
00138 
00139 } //# NAMESPACE CASA - END
00140 
00141 #endif