ScrollingRasterDD.h

Go to the documentation of this file.
00001 //# ScrollingRasterDD.h: Base class for scrolling DisplayData objects
00002 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003,2004
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_SCROLLINGRASTERDD_H
00029 #define TRIALDISPLAY_SCROLLINGRASTERDD_H
00030 
00031 #include <display/DisplayDatas/PrincipalAxesDD.h>
00032 
00033 #include <casa/Arrays/Array.h>
00034 #include <lattices/Lattices/Lattice.h>
00035 #include <casa/Containers/Record.h>
00036 
00037 #include <images/Images/ImageInterface.h>
00038 #include <lattices/Lattices/MaskedLattice.h>
00039 #include <lattices/LatticeMath/LatticeStatistics.h>
00040 #include <lattices/Lattices/SubLattice.h>
00041 #include <lattices/Lattices/LatticeConcat.h>
00042 
00043 // <summary>
00044 // Base class for scrolling DisplayData objects
00045 // </summary>
00046 
00047 namespace casa { //# NAMESPACE CASA - BEGIN
00048 
00049         class WCResampleHandler;
00050 
00051         class ScrollingRasterDM;
00052 
00053         class ScrollingRasterDD : public PrincipalAxesDD {
00054 
00055         public:
00056                 ScrollingRasterDD(const uInt nDim,
00057                                   const IPosition, const Vector<String>, const Vector<String>,
00058                                   uInt sAxis = 2, uInt scanNo = 100);
00059                 virtual ~ScrollingRasterDD();
00060 
00061                 virtual void updateLattice(const Record &) {};
00062                 virtual void updateLattice(Array<Float> &, DisplayCoordinateSystem &);
00063 
00064                 virtual String className() const {
00065                         return String("ScrollingRasterDD");
00066                 }
00067 
00068                 virtual Bool setOptions(Record &rec, Record &recOut);
00069                 virtual Record getOptions( bool scrub=false ) const;
00070 
00071                 virtual void setDefaultOptions();
00072 
00073                 // distribute options to all the axis labellers - empty here, we use WorldAxesDD
00074                 virtual Bool setLabellerOptions(Record &, Record &) {
00075                         return False;
00076                 }
00077 
00078                 // retrieve options from the axis labellers - empty here, we use WorldAxesDD
00079                 virtual Record getLabellerOptions( bool /*scrub*/=false ) const {
00080                         Record rec;
00081                         return rec;
00082                 }
00083 
00084 
00085                 virtual Bool sizeControl(WorldCanvasHolder& wcHolder,
00086                                          AttributeBuffer& holderBuf);
00087 
00088                 virtual WCResampleHandler *resampleHandler() {
00089                         return itsResampleHandler;
00090                 }
00091 
00092         protected:
00093                 friend class ScrollingRasterDM;
00094 
00095                 virtual void updateLatticeConcat(Array<Float>* = NULL , DisplayCoordinateSystem* = NULL);
00096                 virtual void initLattice(const Record &);
00097                 virtual void initLattice(const Float, const Float, const uInt);
00098 
00099                 virtual void recreateEmptyLattices(uInt changedScanNumber = 0);
00100 
00101                 virtual const IPosition dataShape() const;
00102                 virtual uInt dataDim() const;
00103                 virtual const Unit dataUnit() const;
00104                 virtual void setupElements();
00105                 virtual void getMinAndMax();
00106                 virtual void updateLatticeStatistics();
00107 
00108                 //virtual void refresh(Bool);
00109 
00110                 virtual Bool labelAxes(const WCRefreshEvent &ev);
00111 
00112                 virtual MaskedLattice<Float>* maskedLattice() {
00113                         return itsLatticeConcatPtr;
00114                 }
00115 
00116                 virtual Display::DisplayDataType classType() {
00117                         return Display::Raster;
00118                 }
00119                 // Pure virtual function from DisplayData...
00120                 String dataType() const {
00121                         return "scrolling";
00122                 }
00123 
00124                 virtual String showValue(const Vector<Double> &world);
00125                 virtual Float dataValue(IPosition pos);
00126                 virtual Bool maskValue(const IPosition &pos);
00127 
00128                 virtual Vector<String> worldAxisNames() const;
00129                 virtual Vector<String> worldAxisUnits() const;
00130 
00131                 // (Required) default constructor.
00132                 ScrollingRasterDD(uInt mAxis=2, uInt scanNo=100);
00133 
00134                 // (Required) copy constructor.
00135                 ScrollingRasterDD(const ScrollingRasterDD &other);
00136 
00137                 // (Required) copy assignment.
00138                 void operator=(const ScrollingRasterDD &other);
00139 
00140                 // Set Spectral preference -> not used here.
00141                 virtual void setSpectralPreference (
00142                     DisplayCoordinateSystem& /*cSys*/, const String&, const String& ) {}
00143 
00144                 void setHeaderMin(Float x) {
00145                         itsHeaderMin = x;
00146                 }
00147                 void setHeaderMax(Float x) {
00148                         itsHeaderMax = x;
00149                 }
00150                 Float headerMin() {
00151                         return itsHeaderMin;
00152                 }
00153                 Float headerMax() {
00154                         return itsHeaderMax;
00155                 }
00156                 void setScanNumber(uInt x) {
00157                         itsScanNumber = x;
00158                 }
00159                 uInt scanNumber() {
00160                         return itsScanNumber;
00161                 }
00162                 Bool headerReceived() {
00163                         return itsHeaderReceived;
00164                 }
00165                 void setHeaderReceived(Bool x) {
00166                         itsHeaderReceived = x;
00167                 }
00168 
00169                 IPosition latticesShape() {
00170                         return itsLattices[0]->shape();
00171                 }
00172                 uInt shiftAxis() {
00173                         return itsShiftAxis;
00174                 }
00175 
00176                 void setNeedResize(const Bool x) {
00177                         itsNeedResize = x;
00178                 }
00179                 Bool needResize() {
00180                         return itsNeedResize;
00181                 }
00182 
00183                 IPosition fixedPos() {
00184                         return itsFixedPos;
00185                 }
00186 
00187                 //void setPlaneNumber(const uInt x) { itsPlaneNumber = x; }
00188                 //uInt planeNumber() { return itsPlaneNumber; }
00189 
00190                 void setLatticeShape(const IPosition x) {
00191                         itsLatticeShape = x;
00192                 }
00193                 IPosition latticeShape() {
00194                         return itsLatticeShape;
00195                 }
00196 
00197         private:
00198                 // Worker function for c'tors.
00199                 void initSRDD(const Vector<String> aAxisNames, const Vector<String> aAxisUnits,
00200                               uInt mAxis);
00201 
00202                 uInt nDim;
00203 
00204                 //ImageInterface<Float> *itsImagePtr;
00206                 LatticeConcat<Float>* itsLatticeConcatPtr;
00207                 //MaskedLattice<Float>  *itsMaskedLatticePtr;
00208                 LatticeStatistics<Float> *itsLatticeStatisticsPtr;
00209                 SubLattice<Float> *itsFilledDisplayedLatticePtr;
00210                 //Int itsM2Axis;
00211                 IPosition itsFixedPos;
00212 
00213                 Int itsFilledCount;
00214 
00215                 MaskedLattice<Float> **itsLattices;
00216 
00217                 Bool itsNeedResize;
00218                 uInt itsShiftAxis;
00219 
00220                 Bool itsHeaderReceived;
00221                 Float itsHeaderMin;
00222                 Float itsHeaderMax;
00223                 uInt itsScanNumber;
00224                 IPosition itsLatticeShape;
00225                 //IPosition itsScanShape;
00226                 //uInt itsPlaneNumber;
00227 
00228                 // storage for the display parameters
00229                 String itsResample;
00230 
00231                 // pointer to resampler
00232                 WCResampleHandler *itsResampleHandler;
00233 
00234         };
00235 
00236 
00237 } //# NAMESPACE CASA - END
00238 
00239 #endif
00240 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1