casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PassiveCachingDD.h
Go to the documentation of this file.
1 //# PassiveCachingDD.h: passive implementation of a CachingDisplayData
2 //# Copyright (C) 1999,2000,2001,2002,2003
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_PASSIVECACHINGDD_H
29 #define TRIALDISPLAY_PASSIVECACHINGDD_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/IPosition.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37 // <summary>
38 // Class providing passive behaviour for CachingDisplayDatas.
39 // </summary>
40 
41 // <synopsis>
42 // A "passive" DisplayData is one which can only be used in
43 // conjunction with another non-passive DisplayData. As such, it will
44 // not negotiate coordinates on a WorldCanvas, nor will it provide
45 // coordinate conversion capabilities.
46 // </synopsis>
47 
49 
50  public:
51 
52  // Constructor.
54 
55  // Destructor.
56  virtual ~PassiveCachingDD();
57 
58  // casacore::Coordinate transformation handlers, called by WorldCanvasHolder.
59  // These functions simply return false because this DisplayData is
60  // passive.
61  // <group>
64  // </group>
65 
66  // casacore::Format a string containing coordinate or value information at the
67  // given world coordinate. They simply return empty Strings because
68  // this DisplayData is passive.
69  // <group>
71  const casacore::Bool &displayAxesOnly = false);
73  // </group>
74 
75 
76  // World axis information suppliers.
77  // <group>
80  // </group>
81 
82  const casacore::Unit dataUnit() const {
83  return casacore::Unit("_");
84  }
86  return casacore::IPosition( );
87  }
89  return 0;
90  }
91  std::vector<int> displayAxes( ) const {
92  return std::vector<int>( );
93  }
94 
95  // Return the number of display elements (ie. drawable images) in
96  // this DisplayData.
97  // <group>
98  virtual casacore::uInt nelements(const WorldCanvasHolder &wcHolder) const;
99  virtual casacore::uInt nelements() const;
100  // </group>
101 
102  // Install the default options for this DisplayData.
103  virtual void setDefaultOptions();
104 
105  // Apply options stored in <src>rec</src> to the DisplayData. A
106  // return value of <src>true</src> means a refresh is needed.
107  // <src>recOut</src> contains any fields which were implicitly
108  // changed as a result of the call to this function.
110 
111  // Retrieve the current and default options and parameter types.
112  virtual casacore::Record getOptions( bool scrub=false ) const;
113 
114  // Negotiatiate WorldCanvas linear coordinate system when asked to
115  // do so by the WorldCanvasHolder. In this implementation, simply
116  // return false to indicate that this DisplayData will not negotiate
117  // coordinates: it is a passive DisplayData.
118 
119  virtual void refreshEH(const WCRefreshEvent &ev);
121  AttributeBuffer &/*holderBuf*/) {
122  return false;
123  }
124 
125  // Tidy up the elements of this DisplayData.
126  virtual void cleanup();
127 
128  protected:
129 
130  // Return the current options of this DisplayData as an
131  // AttributeBuffer. The caller must delete the returned buffer.
133 
134  // (Required) copy constructor.
135  PassiveCachingDD(const PassiveCachingDD &other);
136 
137  // (Required) copy assignment.
138  void operator=(const PassiveCachingDD &other);
139 
140  };
141 
142 
143 } //# NAMESPACE CASA - END
144 
145 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
Class which stores WorldCanvas refresh event information.
virtual void setDefaultOptions()
Install the default options for this DisplayData.
Buffer for storing Attributes.
std::vector< int > displayAxes() const
virtual casacore::Bool linToWorld(casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &lin)
casacore::Coordinate transformation handlers, called by WorldCanvasHolder.
virtual casacore::Vector< casacore::String > worldAxisNames() const
World axis information suppliers.
virtual casacore::Bool worldToLin(casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &world)
virtual AttributeBuffer optionsAsAttributes()
Return the current options of this DisplayData as an AttributeBuffer.
defines physical units
Definition: Unit.h:189
virtual casacore::String showPosition(const casacore::Vector< casacore::Double > &world, const casacore::Bool &displayAxesOnly=false)
casacore::Format a string containing coordinate or value information at the given world coordinate...
virtual casacore::uInt nelements() const
and non-specific
const casacore::IPosition dataShape() const
Base class for auto-caching DisplayData objects.
virtual casacore::Bool setOptions(casacore::Record &rec, casacore::Record &recOut)
Apply options stored in rec to the DisplayData.
virtual casacore::String showValue(const casacore::Vector< casacore::Double > &world)
casacore::Format a string containing value information at the given world coordinate ...
void operator=(const PassiveCachingDD &other)
(Required) copy assignment.
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 void cleanup()
Tidy up the elements of this DisplayData.
casacore::uInt dataDim() const
Class providing passive behaviour for CachingDisplayDatas.
virtual casacore::Bool sizeControl(WorldCanvasHolder &, AttributeBuffer &)
Set (coordinate) state of WCH&#39;s WC.
PassiveCachingDD()
Constructor.
virtual casacore::Record getOptions(bool scrub=false) const
Retrieve the current and default options and parameter types.
A holder to interface between DisplayDatas and a WorldCanvas.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void refreshEH(const WCRefreshEvent &ev)
Negotiatiate WorldCanvas linear coordinate system when asked to do so by the WorldCanvasHolder.
const casacore::Unit dataUnit() const
virtual ~PassiveCachingDD()
Destructor.
unsigned int uInt
Definition: aipstype.h:51
virtual casacore::Vector< casacore::String > worldAxisUnits() const