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 AOIELEMENT_H 00011 #define AOIELEMENT_H 00012 00013 #include "GraphicElement.h" 00014 #include "LocationType.h" 00015 00016 #include <vector> 00017 00018 class BitMask; 00019 class GraphicObject; 00020 00021 /** 00022 * Storage for a collection of pixel locations. 00023 * 00024 * An area of interest (AOI) is a concept used to select individual 00025 * pixels within a two-dimensional raster area to limit or control 00026 * processing. The AOI class contains a number of vector objects 00027 * which are added together to identify whether each pixel in a scene 00028 * is included in the collection. 00029 * 00030 * This subclass of Subject will notify upon the following conditions: 00031 * * The following methods are called: addPoint(), addPoints(), removePoint(), 00032 * removePoints(), togglePoint(), togglePoints(), toggleAllPoints(), clearPoints(). 00033 * * Everything else documented in GraphicElement. 00034 */ 00035 class AoiElement : public GraphicElement 00036 { 00037 public: 00038 /** 00039 * Emitted when the points in the AOI are changed, e.g., points are added, removed, toggled, AOI area is moved, etc. 00040 */ 00041 SIGNAL_METHOD(AoiElement, PointsChanged) 00042 00043 /** 00044 * Clear all points from the AOI. 00045 * 00046 * Calling this method will delete all objects 00047 * within the AOI. 00048 * 00049 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00050 */ 00051 virtual void clearPoints() = 0; 00052 00053 /** 00054 * Get the count of pixels selected by the AOI. 00055 * 00056 * @return The number of points which are selected. 00057 */ 00058 virtual size_t getPixelCount() const = 0; 00059 00060 /** 00061 * Get all points selected by the AOI. 00062 * 00063 * @return A BitMask indicating which points are selected. 00064 */ 00065 virtual const BitMask *getSelectedPoints() const = 0; 00066 00067 /** 00068 * Toggle all points. This causes an inversion of the pixels selected. 00069 * 00070 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00071 */ 00072 virtual void toggleAllPoints() = 0; 00073 00074 /** 00075 * Determine whether all points are toggled. 00076 * 00077 * @return True if all points have been toggled, false otherwise. 00078 */ 00079 virtual bool getAllPointsToggled() const = 0; 00080 00081 /** 00082 * Adds a list of points to the collection of those currently marked 00083 * as selected. 00084 * 00085 * @param points 00086 * A vector of points to be marked as selected in the AOI. 00087 * 00088 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00089 */ 00090 virtual GraphicObject *addPoints(const std::vector<LocationType>& points) = 0; 00091 00092 /** 00093 * Updates the AOI to include any additional points marked as selected 00094 * from the incoming BitMask argument. 00095 * 00096 * @param pPoints 00097 * A BitMask containing additional points to mark as selected. 00098 * The AoiElement does not take ownership over the mask. 00099 * 00100 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00101 */ 00102 virtual GraphicObject *addPoints(const BitMask* pPoints) = 0; 00103 00104 /** 00105 * Adds a point to the collection of those currently marked 00106 * as selected. 00107 * 00108 * @param point 00109 * A point to mark as selected in the AOI. 00110 * 00111 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00112 */ 00113 virtual GraphicObject *addPoint(LocationType point) = 0; 00114 00115 /** 00116 * Removes a list of points from the collection of those currently marked 00117 * as selected. 00118 * 00119 * @param points 00120 * A vector of points to be marked as unselected in the AOI. 00121 * 00122 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00123 */ 00124 virtual GraphicObject *removePoints(const std::vector<LocationType>& points) = 0; 00125 00126 /** 00127 * Updates the AOI to remove any additional points marked as selected 00128 * from the incoming BitMask argument. 00129 * 00130 * @param pPoints 00131 * A BitMask containing additional points to mark as unselected. 00132 * The AoiElement does not take ownership over the mask. 00133 * 00134 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00135 */ 00136 virtual GraphicObject *removePoints(const BitMask* pPoints) = 0; 00137 00138 /** 00139 * Removes a point from the collection of those currently marked 00140 * as selected. 00141 * 00142 * @param point 00143 * A point to mark as unselected in the AOI. 00144 * 00145 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00146 */ 00147 virtual GraphicObject *removePoint(LocationType point) = 0; 00148 00149 /** 00150 * Toggles a set of points in the collection. %Any point currently selected is 00151 * changed to unselected. If it is currently unselected, then it changes 00152 * to selected. 00153 * 00154 * @param points 00155 * A vector of points to toggle the selected status in the AOI. 00156 * 00157 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00158 */ 00159 virtual GraphicObject *togglePoints(const std::vector<LocationType>& points) = 0; 00160 00161 /** 00162 * Toggles a set of points in the collection. %Any point currently selected is 00163 * changed to unselected. If it is currently unselected, then it changes 00164 * to selected. 00165 * 00166 * @param pPoints 00167 * A BitMask containing selected pixels indicating those that should 00168 * be toggled. The AoiElement does not take ownership over the mask. 00169 * 00170 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00171 */ 00172 virtual GraphicObject *togglePoints(const BitMask* pPoints) = 0; 00173 00174 /** 00175 * Toggles a point from in the collection. If the point is currently selected, 00176 * change it to unselected. If it is currently unselected, then change it 00177 * to selected. 00178 * 00179 * @param point 00180 * A point to toggle the selected status in the AOI. 00181 * 00182 * @notify This method will notify Subject::signalModified and AoiElement::signalPointsChanged. 00183 */ 00184 virtual GraphicObject *togglePoint(LocationType point) = 0; 00185 00186 00187 protected: 00188 /** 00189 * This should be destroyed by calling ModelServices::destroyElement. 00190 */ 00191 virtual ~AoiElement() {} 00192 }; 00193 00194 #endif