casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SkyCatOverlayDD.h
Go to the documentation of this file.
1 //# SkyCatOverlay.h: sky catalogue overlay displaydata
2 //# Copyright (C) 1999,2000,2001,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_SKYCATOVERLAYDD_H
29 #define TRIALDISPLAY_SKYCATOVERLAYDD_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/Vector.h>
39 
40 namespace casacore{
41 
42  class Table;
43 }
44 
45 namespace casa { //# NAMESPACE CASA - BEGIN
46 
47  class SkyCatOverlayDM;
48 
49 // <summary>
50 // Simple implementation of a cached DisplayData for sky catalogue overlays.
51 // </summary>
52 
54 
55  public:
56 
57  // Constructor taking a pointer to an already constructed Table.
59 
60  // Constructor taking a casacore::String which describes the full pathname
61  // of a casacore::Table on disk.
62  SkyCatOverlayDD(const casacore::String tablename);
63 
64  // Destructor.
65  virtual ~SkyCatOverlayDD();
66 
67  // Install the default options for this DisplayData.
68  virtual void setDefaultOptions();
69 
70  // Apply options stored in <src>rec</src> to the DisplayData. A
71  // return value of <src>true</src> means a refresh is needed.
72  // <src>recOut</src> contains any fields which were implicitly
73  // changed as a result of the call to this function.
75 
76  // Retrieve the current and default options and parameter types.
77  virtual casacore::Record getOptions( bool scrub=false ) const;
78 
79  // Return the type of this DisplayData.
82  }
83  // Pure virtual function from DisplayData...
85  return "sky cat";
86  }
87 
88 
89  // Create a new AxesDisplayMethod for drawing on the given
90  // WorldCanvas when the AttributeBuffers are suitably matched to the
91  // current state of this DisplayData and of the WorldCanvas/Holder.
92  // The tag is a unique number used to identify the age of the newly
93  // constructed CachingDisplayMethod.
95  AttributeBuffer* wchAttributes,
96  AttributeBuffer* ddAttributes,
97  CachingDisplayData* dd);
98 
99  // Return the current options of this DisplayData as an
100  // AttributeBuffer.
102 
103 
104  // Get the column name for text labelling.
105  virtual casacore::String nameColumn() const {
106  return itsParamNameColumn->value();
107  }
108 
109  // Get the line width for labelling.
110  virtual casacore::Float lineWidth() const {
111  return itsParamLineWidth->value();
112  }
113 
114  // Get the marker type, size and color.
115  // <group>
116  virtual Display::Marker markerType() const {
117  return static_cast<Display::Marker>(itsParamMarkerType->keyValue());
118  }
119  virtual casacore::Int markerSize() const {
120  return itsParamMarkerSize->value();
121  }
122  virtual casacore::String markerColor() const {
123  return itsParamMarkerColor->value();
124  }
125  // </group>
126  // Get the column name for value-size mapping.
127  virtual casacore::String mapColumn() const {
128  return itsParamMapColumn->value();
129  }
130 
131 
132  // Get the character font, size, color and angle for labelling.
133  // <group>
134  virtual casacore::String charFont() const {
135  return itsParamCharacterFont->value();
136  }
137  virtual casacore::Float charSize() const {
138  return itsParamCharacterSize->value();
139  }
140  virtual casacore::String charColor() const {
141  return itsParamCharacterColor->value();
142  }
143  virtual casacore::Int charAngle() const {
144  return itsParamCharacterAngle->value();
145  }
146  // </group>
147 
148  // Get the label x and y offsets (in character height).
149  // <group>
150  virtual casacore::Float labelXOffset() const {
151  return itsParamLabelXOffset->value();
152  }
153  virtual casacore::Float labelYOffset() const {
154  return itsParamLabelYOffset->value();
155  }
156  // </group>
157 
158  // Determine ability to draw, given current canvas coordinate state.
159  // This DD requires direction coordinates in both X and Y axis codes.
160  virtual casacore::Bool conformsToCS(const WorldCanvas& wch);
161 
162  std::string errorMessage( ) const { return ""; }
163 
164  protected:
165 
166  // (Required) default constructor.
167  SkyCatOverlayDD();
168 
169  // (Required) copy constructor.
170  SkyCatOverlayDD(const SkyCatOverlayDD &other);
171 
172  // (Required) copy assignment.
173  void operator=(const SkyCatOverlayDD &other);
174 
175  // Attempt to determine which columns map to longitude, latitude,
176  // and type.
178 
179  // Return the unit of a given column in the table. This is
180  // extracted from the first column keyword matching the pattern
181  // <src>^[uU][nN][iI][tT]$</src>. If no unit keyword is available,
182  // the returned unit is a null unit.
183  casacore::Unit columnUnit(const casacore::String columnName) const;
184 
185  private:
186 
187  // Store the column names here.
189 
190  // Option: what type of coordinates are provided?
191  //casacore::String itsCoordinateType;
192 
193  // Which column is mapped to the longitude coordinate, and what is
194  // its unit?
197 
198  // Which column is mapped to the latitude coordinate, and what is
199  // its unit?
202 
203  // Which column is mapped to epoch
205 
206  // Option: which column is mapped to the name?
208 
209  // plot line width
211 
212  // Marker type, size and color.
217 
218 
219  // Labelling character font, size, color and angle.
224 
225  // Labelling character offsets in character height units.
228 
229  // Allow the DisplayMethod to access the private data.
230  friend class SkyCatOverlayDM;
231 
232  // Construct and destruct the parameter set.
233  // <group>
234  void constructParameters();
235  void destructParameters();
236  // </group>
237 
238  };
239 
240 
241 } //# NAMESPACE CASA - END
242 
243 #endif
Implementation of DParameterChoice to store color selection parameters.
void operator=(const SkyCatOverlayDD &other)
(Required) copy assignment.
casacore::Unit columnUnit(const casacore::String columnName) const
Return the unit of a given column in the table.
int Int
Definition: aipstype.h:50
Simple implementation of a cached DisplayData for sky catalogue overlays.
Assistance class for auto-caching of DisplayData objects.
DParameterChoice * itsParamMapColumn
Main interface class to a read/write table.
Definition: Table.h:153
casacore::Unit itsLongitudeUnit
DParameterChoice * itsParamCharacterFont
Labelling character font, size, color and angle.
virtual casacore::Bool setOptions(casacore::Record &rec, casacore::Record &recOut)
Apply options stored in rec to the DisplayData.
DisplayDataType
WorldCanvasHolder - what type of DisplayData is this, need to know for drawing order.
Definition: DisplayEnums.h:355
Buffer for storing Attributes.
virtual Display::Marker markerType() const
Get the marker type, size and color.
DParameterChoice * itsParamNameColumn
Option: which column is mapped to the name?
DParameterMapKeyChoice * itsParamMarkerType
Marker type, size and color.
DParameterRange< casacore::Float > * itsParamLabelYOffset
void constructParameters()
Construct and destruct the parameter set.
virtual void setDefaultOptions()
Install the default options for this DisplayData.
DParameterRange< casacore::Int > * itsParamCharacterAngle
DParameterRange< casacore::Float > * itsParamLabelXOffset
Labelling character offsets in character height units.
virtual casacore::Float labelYOffset() const
virtual casacore::String charColor() const
virtual casacore::Record getOptions(bool scrub=false) const
Retrieve the current and default options and parameter types.
virtual casacore::Int markerSize() const
casacore::Vector< casacore::String > itsColumnNames
Store the column names here.
defines physical units
Definition: Unit.h:189
virtual casacore::Float lineWidth() const
Get the line width for labelling.
virtual casacore::String markerColor() const
virtual casacore::Float labelXOffset() const
Get the label x and y offsets (in character height).
Base class for auto-caching DisplayData objects.
casacore::String itsLongitudeColumn
Option: what type of coordinates are provided? casacore::String itsCoordinateType; ...
casacore::String itsLatitudeColumn
Which column is mapped to the latitude coordinate, and what is its unit?
casacore::Table * table()
Return the casacore::Table pointer for use by derived classes.
DParameterRange< casacore::Float > * itsParamCharacterSize
casacore::String itsDirectionTypeColumn
Which column is mapped to epoch.
virtual CachingDisplayMethod * newDisplayMethod(WorldCanvas *worldCanvas, AttributeBuffer *wchAttributes, AttributeBuffer *ddAttributes, CachingDisplayData *dd)
Create a new AxesDisplayMethod for drawing on the given WorldCanvas when the AttributeBuffers are sui...
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual casacore::String mapColumn() const
Get the column name for value-size mapping.
virtual casacore::Float charSize() const
float Float
Definition: aipstype.h:54
Class to draw catalogue overlays for SkyCatOverlayDD.
Implementation of DisplayParameter to store choice parameters.
DParameterRange< casacore::Int > * itsParamMarkerSize
Implementation of DParameterChoice to store parameter and associated key.
casacore::Int keyValue()
Return the current value of this parameter.
DParameterColorChoice * itsParamMarkerColor
virtual casacore::Bool conformsToCS(const WorldCanvas &wch)
Determine ability to draw, given current canvas coordinate state.
T value()
Return the current value of this parameter.
virtual casacore::Int charAngle() const
virtual casacore::String charFont() const
Get the character font, size, color and angle for labelling.
virtual casacore::Bool determineDirectionColumnMapping()
Attempt to determine which columns map to longitude, latitude, and type.
Class adding casacore::Table-specific support functions to PassiveCachingDD.
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
virtual casacore::String nameColumn() const
Get the column name for text labelling.
DParameterColorChoice * itsParamCharacterColor
casacore::String value()
Return the current value of this parameter.
casacore::Unit itsLatitudeUnit
String: the storage and methods of handling collections of characters.
Definition: String.h:223
SkyCatOverlayDD()
(Required) default constructor.
DParameterRange< casacore::Int > * itsParamLineWidth
plot line width
virtual ~SkyCatOverlayDD()
Destructor.
casacore::String dataType() const
Pure virtual function from DisplayData...
std::string errorMessage() const
Canvas annotation - can draw outside draw area.
Definition: DisplayEnums.h:363
virtual Display::DisplayDataType classType()
Return the type of this DisplayData.
virtual AttributeBuffer optionsAsAttributes()
Return the current options of this DisplayData as an AttributeBuffer.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42