casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
AniPosEH.h
Go to the documentation of this file.
00001 //# AniPosEH.h: Animator position event handler for a WorldCanvas
00002 //# Copyright (C) 1996,1997,1998,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_ANIPOSEH_H
00029 #define TRIALDISPLAY_ANIPOSEH_H
00030 
00031 #include <casa/aips.h>
00032 #include <display/DisplayEvents/WCPositionEH.h>
00033 #include <display/DisplayEvents/Animator.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 class WorldCanvasHolder;
00038 class Attribute;
00039 
00040 // <summary>
00041 // WorldCanvas position event handler for Animator.
00042 // </summary>
00043 //
00044 // <synopsis>
00045 // </synopsis>
00046 
00047 class AniPosEH : public WCPositionEH {
00048 
00049  public:
00050 
00051   // Constructor
00052   AniPosEH();
00053   
00054   // Destrutor
00055   ~AniPosEH();
00056 
00057   // The operator that is given the position events and must process
00058   // them
00059   virtual void operator()(const WCPositionEvent& ev);
00060 
00061   // add/remove a WorldCanvasHolder to the handler
00062   // <group>
00063   virtual void addWorldCanvasHolder(WorldCanvasHolder *wcHolder);
00064   virtual void removeWorldCanvasHolder(WorldCanvasHolder& wcHolder);
00065   // </group>
00066 
00067   // reset the animator - this is typically called by the WorldCanvasHolder
00068   // when DisplayDatas are registered or unregistered
00069   virtual void resetAnimator() { animator.reset(); }
00070   
00071  private:
00072 
00073   // the Animator we control
00074   Animator animator;
00075 
00076   // List of WorldCanvasHolders
00077   List<void *> holderList;
00078 
00079   // set a restriction on the WorldCanvasHolders
00080   void setRestriction(Attribute& att);
00081 
00082   // refresh the WorldCanvasHolders
00083   void refresh();
00084   
00085   // cleanup the DisplayDatas on all WorldCanvasHolders
00086   void cleanup();
00087 };
00088 
00089 
00090 } //# NAMESPACE CASA - END
00091 
00092 #endif