ThresholdLayer.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef THRESHOLDLAYER_H
00011 #define THRESHOLDLAYER_H
00012 
00013 #include "ColorType.h"
00014 #include "ConfigurationSettings.h"
00015 #include "Layer.h"
00016 #include "TypesFile.h"
00017 
00018 /**
00019  *  Adjusts the properties of a threshold layer.
00020  *
00021  *  A threshold layer consists of markers identifying pixels in a scene that fall in a
00022  *  defined range of values.  To identify the marked pixels, the following properties
00023  *  are present: pass area, region units, and one or two threshold values.  The pass
00024  *  area defines how many threshold values are used and how they define the marked
00025  *  pixels.  The pixel marker is drawn with a symbol based on the AOI properties.
00026  *
00027  *  This subclass of Subject will notify upon the following conditions:
00028  *  - The following methods are called: setRegionUnits(), setPassArea(),
00029  *    setFirstThreshold(), setSecondThreshold(), setSymbol(), and setColor().
00030  *  - Everything else documented in AoiLayer.
00031  *
00032  *  @see     AoiLayer
00033  */
00034 class ThresholdLayer : public Layer
00035 {
00036 public:
00037    SETTING(AutoColor, ThresholdLayer, bool, false)
00038    SETTING(FirstValue, ThresholdLayer, double, 0.0)
00039    SETTING(MarkerColor, ThresholdLayer, ColorType, ColorType())
00040    SETTING(MarkerSymbol, ThresholdLayer, SymbolType, SOLID)
00041    SETTING(PassArea, ThresholdLayer, PassArea, LOWER)
00042    SETTING(SecondValue, ThresholdLayer, double, 0.0)
00043    SETTING(RegionUnits, ThresholdLayer, RegionUnits, RAW_VALUE)
00044 
00045    /**
00046     *  Emitted with boost::any<RegionUnits> when the units are changed.
00047     */
00048    SIGNAL_METHOD(ThresholdLayer, UnitsChanged)
00049 
00050    /**
00051     *  Emitted with boost::any<PassArea> when the pass area is changed.
00052     */
00053    SIGNAL_METHOD(ThresholdLayer, PassAreaChanged)
00054 
00055    /**
00056     *  Emitted with boost::any<double> when the first threshold is changed.
00057     */
00058    SIGNAL_METHOD(ThresholdLayer, FirstThresholdChanged)
00059 
00060    /**
00061     *  Emitted with boost::any<double> when the second threshold is changed.
00062     */
00063    SIGNAL_METHOD(ThresholdLayer, SecondThresholdChanged)
00064 
00065    /**
00066     *  Emitted with boost::any<SymbolType> when the symbol is changed.
00067     */
00068    SIGNAL_METHOD(ThresholdLayer, SymbolChanged)
00069 
00070    /**
00071     *  Emitted with boost::any<ColorType> when the color is changed.
00072     */
00073    SIGNAL_METHOD(ThresholdLayer, ColorChanged)
00074 
00075    /**
00076     *  Sets the first threshold value for the current threshold layer.
00077     *
00078     *  The first threshold value is used as the sole threshold value for the LOWER
00079     *  and UPPER pass areas.  It is also used as the lower threshold value for the
00080     *  MIDDLE and OUTSIDE pass areas.
00081     *
00082     *  @param   dRawValue
00083     *           The new threshold value as a raw value.
00084     *
00085     *  @notify  This method will notify signalFirstThresholdChanged() with boost::any<double>.
00086     *
00087     *  @see     getFirstThreshold(), setSecondThreshold()
00088     */
00089    virtual void setFirstThreshold(double dRawValue) = 0;
00090 
00091    /**
00092     *  Returns the first threshold value for the current threshold layer as a raw value.
00093     *
00094     *  @return  The threshold value as a raw value.
00095     *
00096     *  @see     setFirstThreshold(), getSecondThreshold()
00097     */
00098    virtual double getFirstThreshold() const = 0;
00099 
00100    /**
00101     *  Sets the second threshold value for the current threshold layer.
00102     *
00103     *  The second threshold value is used as the upper threshold value for the
00104     *  MIDDLE and OUTSIDE pass areas.  It is ignored for the LOWER and UPPER pass
00105     *  areas.
00106     *
00107     *  @param   dRawValue
00108     *           The new threshold value as a raw value.
00109     *
00110     *  @notify  This method will notify signalSecondThresholdChanged() with boost::any<double>.
00111     *
00112     *  @see     getSecondThreshold(), setFirstThreshold()
00113     */
00114    virtual void setSecondThreshold(double dRawValue) = 0;
00115 
00116    /**
00117     *  Returns the second threshold value for the current threshold layer as a raw value.
00118     *
00119     *  @return  The threshold value as a raw value.
00120     *
00121     *  @see     getFirstThreshold(), setSecondThreshold()
00122     */
00123    virtual double getSecondThreshold() const = 0;
00124 
00125    /**
00126     *  Sets the pass area for the current threshold layer.
00127     *
00128     *  @param   eArea
00129     *           The new pass area.
00130     *
00131     *  @notify  This method will notify signalPassAreaChanged() with boost::any<PassArea>.
00132     *
00133     *  @see     getPassArea()
00134     */
00135    virtual void setPassArea(const PassArea& eArea) = 0;
00136 
00137    /**
00138     *  Returns the pass area of the current threshold layer.
00139     *
00140     *  @return  The current pass area.
00141     *
00142     *  @see     setPassArea()
00143     */
00144    virtual PassArea getPassArea() const = 0;
00145 
00146    /**
00147     *  Sets the threshold units for the current threshold layer.
00148     *
00149     *  @param   eUnits
00150     *           The new threshold units.
00151     *
00152     *  @notify  This method will notify signalTypeChanged() with boost::any<RegionUnits>.
00153     *
00154     *  @see     getRegionUnits()
00155     */
00156    virtual void setRegionUnits(const RegionUnits& eUnits) = 0;
00157 
00158    /**
00159     *  Returns the threshold units of the current threshold layer.
00160     *
00161     *  @return  The current threshold units.
00162     *
00163     *  @see     setRegionUnits()
00164     */
00165    virtual RegionUnits getRegionUnits() const = 0;
00166 
00167    /**
00168     *  Converts a threshold value from one threshold units to another.
00169     *
00170     *  @param   eUnits
00171     *           The initial threshold units.
00172     *  @param   dThreshold
00173     *           The threshold value to convert.
00174     *  @param   eNewUnits
00175     *           The threshold units for the converted value.
00176     *
00177     *  @return  The converted threshold value.  If an error occurred, 0.0 is returned.
00178     */
00179    virtual double convertThreshold(const RegionUnits& eUnits, double dThreshold,
00180       const RegionUnits& eNewUnits) = 0;
00181 
00182    /**
00183     *  Converts a threshold value from the current threshold units to another.
00184     *
00185     *  @param   dThreshold
00186     *           The threshold value to convert.
00187     *  @param   eNewUnits
00188     *           The threshold units for the converted value.
00189     *
00190     *  @return  The converted threshold value.  If an error occurred, 0.0 is returned.
00191     */
00192    virtual double convertThreshold(double dThreshold, const RegionUnits& eNewUnits) = 0;
00193 
00194    /**
00195     *  Retrieves the layer's current symbol style.
00196     *
00197     *  @return  The current symbol style.
00198     */
00199    virtual SymbolType getSymbol() const = 0;
00200 
00201    /**
00202     *  Sets the layer's current symbol style.
00203     *
00204     *  @param   symbol
00205     *           The new symbol style.
00206     *
00207     *  @notify  This method will notify signalSymbolChanged() with boost::any<SymbolType>.
00208     */
00209    virtual void setSymbol(SymbolType symbol) = 0;
00210 
00211    /**
00212     *  Retrieves the layer's current color.
00213     *
00214     *  @return  The layer's current color.
00215     */
00216    virtual ColorType getColor() const = 0;
00217 
00218    /**
00219     *  Sets the layer's color.
00220     *
00221     *  @param   color
00222     *           The new color.
00223     *
00224     *  @notify  This method will notify signalColorChanged() with boost::any<ColorType>.
00225     */
00226    virtual void setColor(const ColorType &color) = 0;
00227 
00228 protected:
00229    /**
00230     * This should be destroyed by calling SpatialDataView::deleteLayer.
00231     */
00232    virtual ~ThresholdLayer() {}
00233 };
00234 
00235 #endif

Software Development Kit - Opticks 4.9.0 Build 16218