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 AOILAYER_H 00011 #define AOILAYER_H 00012 00013 #include "GraphicLayer.h" 00014 #include "ConfigurationSettings.h" 00015 #include "TypesFile.h" 00016 00017 class ColorType; 00018 00019 /** 00020 * Adjusts the properties of an AOI layer. 00021 * 00022 * An AOI layer consists of markers identifying pixels in a scene that are included 00023 * in the area of interest. The pixel marker has two properties: color and symbol. 00024 * This class provides the means to set the color and symbol for the current layer 00025 * and also the default color and symbol for new layers. 00026 * 00027 * This subclass of Subject will notify upon the following conditions: 00028 * - The following methods are called: setColor(), setSymbol(). 00029 * - The AOI is manipulated through the GUI. 00030 * - Everything else documented in GraphicLayer. 00031 * 00032 * @see Layer 00033 */ 00034 class AoiLayer : public GraphicLayer 00035 { 00036 public: 00037 SETTING(AutoColor, AoiLayer, bool, false) 00038 SETTING(MarkerColor, AoiLayer, ColorType, ColorType()) 00039 SETTING(MarkerSymbol, AoiLayer, SymbolType, SOLID) 00040 00041 /** 00042 * Emitted with any<ColorType> when the color is changed. 00043 */ 00044 SIGNAL_METHOD(AoiLayer, ColorChanged) 00045 /** 00046 * Emitted with any<SymbolType> when the symbol is changed. 00047 */ 00048 SIGNAL_METHOD(AoiLayer, SymbolChanged) 00049 00050 /** 00051 * Sets the pixel marker color for the current AOI layer. 00052 * 00053 * @param aoiColor 00054 * The new pixel marker color. 00055 * 00056 * @notify This method will notify Subject::signalModified. 00057 * 00058 * @see getColor() 00059 */ 00060 virtual void setColor(const ColorType& aoiColor) = 0; 00061 00062 /** 00063 * Returns the pixel marker color of the current AOI layer. 00064 * 00065 * @return The current pixel marker color. 00066 * 00067 * @see setColor() 00068 */ 00069 virtual ColorType getColor() const = 0; 00070 00071 /** 00072 * Sets the pixel marker symbol for the current AOI layer. 00073 * 00074 * @param aoiSymbol 00075 * The new pixel marker symbol. 00076 * 00077 * @notify This method will notify Subject::signalModified. 00078 * 00079 * @see getSymbol() 00080 */ 00081 virtual void setSymbol(const SymbolType& aoiSymbol) = 0; 00082 00083 /** 00084 * Returns the pixel marker symbol of the current AOI layer. 00085 * 00086 * @return The current pixel marker symbol. 00087 * 00088 * @see setSymbol() 00089 */ 00090 virtual SymbolType getSymbol() const = 0; 00091 00092 /** 00093 * Sets the initial drawing mode that is used when the user adds a new 00094 * object to the layer with the mouse. 00095 * 00096 * This method provides a means for objects to set the initial object 00097 * drawing mode for only this layer. This value is reset when the user 00098 * selects a new mode on the AOI toolbar. 00099 * 00100 * @param mode 00101 * The initial drawing mode to use when the user adds a new object 00102 * to the layer with the mouse. 00103 * 00104 * @see DesktopServices::setAoiSelectionTool() 00105 */ 00106 virtual void setMode(ModeType mode) = 0; 00107 00108 /** 00109 * Returns the initial drawing mode that is used when the user adds a new 00110 * object to the layer with the mouse. 00111 * 00112 * @return The initial drawing mode used when the user added a new object 00113 * to the layer with the mouse. This value may be different than 00114 * the return value of DesktopServices::getAoiSelectionMode() if 00115 * the setMode() method was called and the user has not selected a 00116 * new mode on the toolbar. 00117 */ 00118 virtual ModeType getMode() const = 0; 00119 00120 /** 00121 * Correct the coordinate for whatever snapping may be required. 00122 * 00123 * AoiLayer snaps mid-pixel points so that objects appear in the 00124 * center of the selected pixels. 00125 * 00126 * @param coord 00127 * Coordinate to correct. 00128 * 00129 * @return The corrected coordinate. 00130 */ 00131 virtual LocationType correctCoordinate(const LocationType &coord) const = 0; 00132 00133 protected: 00134 /** 00135 * This should be destroyed by calling SpatialDataView::deleteLayer. 00136 */ 00137 virtual ~AoiLayer() {} 00138 }; 00139 00140 #endif