casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MWCAnimator.h
Go to the documentation of this file.
1 //# MWCAnimator.h: Animator for MultiWCHolder class
2 //# Copyright (C) 2000,2001,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_MWCANIMATOR_H
29 #define TRIALDISPLAY_MWCANIMATOR_H
30 
31 #include <casa/aips.h>
32 #include <list>
33 
34 namespace casacore{
35 
36  class RecordInterface;
37 }
38 
39 namespace casa { //# NAMESPACE CASA - BEGIN
40 
41  class MultiWCHolder;
42  class AttributeBuffer;
43 
44 // <summary>
45 // Animator for MultiWCHolder class.
46 // </summary>
47 // <use visibility=export>
48 //
49 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
50 // </reviewed>
51 //
52 // <etymology>
53 // </etymology>
54 //
55 // <synopsis>
56 // </synopsis>
57 //
58 // <motivation>
59 // </motivation>
60 //
61 // <todo>
62 // </todo>
63 
64  class MWCAnimator {
65 
66  public:
67 
68  // Constructor which makes an isolated MWCAnimator.
69  MWCAnimator();
70 
71  // Constructor which makes a MWCAnimator which is connected to
72  // the specified MultiWCHolder.
73  MWCAnimator(MultiWCHolder &mholder);
74 
75  // Destructor.
76  virtual ~MWCAnimator();
77 
78  // Add or remove a MultiWCHolder, or remove all MultiWCHolders
79  // from this MWCAnimator. <src>mholder</src> is
80  // added at the end of the list.
81  // <group>
82  virtual void addMWCHolder(MultiWCHolder &mholder);
83  virtual void removeMWCHolder(MultiWCHolder &mholder);
84  virtual void removeMWCHolders();
85  // </group>
86 
87  // Install the given restriction, spaced by the given increment, on
88  // all MultiWCHolders. Ultimately this will go private and be
89  // called (for example) by next(), prev(). But for now we leave it
90  // public for testing purposes. After being called,
91  // <src>restrictions</src> is the set of restrictions which have
92  // been placed on the final WorldCanvasHolder of the final
93  // MultiWCHolder in the list.
94  virtual void setLinearRestrictions(AttributeBuffer &restrictions,
95  const AttributeBuffer &increments);
96 
97  // Install a restriction of the given name, and initial value and
98  // increment, on all MultiWCHolders. This is templated and the
99  // templates are valid for any type which can be added to an
100  // AttributeBuffer. This function simply sets up a single-element
101  // AttributeBuffer and calls <src>setLinearRestrictions</src>.
102  template <class T> void setLinearRestriction(const casacore::String &name,
103  const T &value,
104  const T &increment,
105  const T& tol);
106 
107  // Install a restriction described by the given casacore::RecordInterface,
108  // on all MultiWCHolders. This method simply extracts the fields
109  // <src>name</src>, <src>value</src>, and <src>increment</src>
110  // from <src>rec</src>, and calls the explicit version of
111  // <src>setLinearRestriction</src>. The <src>value</src> and
112  // <src>increment</src> fields can contain either casacore::Int, Float
113  // or casacore::Double data at the moment.
114  virtual void setLinearRestriction(const casacore::RecordInterface &rec);
115 
116  // Remove a restriction (including a 'linear' (ramped) one).
117  // (Can be (and is) used to remove 'bindex' restriction).
118  virtual void removeRestriction(const casacore::String& name);
119 
120  private:
121 
122  // The list of MultiWCHolders that are connected to this MWCAnimator.
123  std::list<MultiWCHolder *> itsMWCHList;
124 
125  // Do we already have this MultiWCHolder registered?
127 
128  };
129 
130 } //# NAMESPACE CASA - END
131 
132 #ifndef AIPS_NO_TEMPLATE_SRC
133 #include <display/DisplayEvents/MWCAniTemplates.tcc>
134 #endif
135 
136 #endif
void setLinearRestriction(const casacore::String &name, const T &value, const T &increment, const T &tol)
Install a restriction of the given name, and initial value and increment, on all MultiWCHolders.
casacore::Bool isAlreadyRegistered(const MultiWCHolder &holder)
Do we already have this MultiWCHolder registered?
virtual void removeMWCHolders()
Buffer for storing Attributes.
MWCAnimator()
Constructor which makes an isolated MWCAnimator.
virtual void addMWCHolder(MultiWCHolder &mholder)
Add or remove a MultiWCHolder, or remove all MultiWCHolders from this MWCAnimator.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
virtual void removeRestriction(const casacore::String &name)
Remove a restriction (including a &#39;linear&#39; (ramped) one).
virtual void setLinearRestrictions(AttributeBuffer &restrictions, const AttributeBuffer &increments)
Install the given restriction, spaced by the given increment, on all MultiWCHolders.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
A holder of WorldCanvasHolders to use for panelling applications.
Definition: MultiWCHolder.h:99
virtual void removeMWCHolder(MultiWCHolder &mholder)
std::list< MultiWCHolder * > itsMWCHList
The list of MultiWCHolders that are connected to this MWCAnimator.
Definition: MWCAnimator.h:123
Animator for MultiWCHolder class.
Definition: MWCAnimator.h:64
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Abstract base class for Record classes.
virtual ~MWCAnimator()
Destructor.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42