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 00011 00012 #ifndef POLYGONPLOTOBJECT_H 00013 #define POLYGONPLOTOBJECT_H 00014 00015 #include "ColorType.h" 00016 #include "LocationType.h" 00017 #include "PointSet.h" 00018 #include "TypesFile.h" 00019 00020 /** 00021 * A set of points connected by a line. 00022 * 00023 * This subclass of Subject will notify upon the following conditions: 00024 * - The following methods are called: setFillColor(), setFillStyle(), 00025 * setHatchStyle(). 00026 * - Everything else documented in PointSet. 00027 * 00028 * @see PlotObject 00029 */ 00030 class PolygonPlotObject : public PointSet 00031 { 00032 public: 00033 /** 00034 * Returns the polygon fill color 00035 * 00036 * @return The polygon fill color 00037 */ 00038 virtual ColorType getFillColor() const = 0; 00039 00040 /** 00041 * Returns the polygon fill style 00042 * 00043 * @return The polygon fill style 00044 * 00045 * @see FillStyle 00046 */ 00047 virtual FillStyle getFillStyle() const = 0; 00048 00049 /** 00050 * Returns the hatch style 00051 * 00052 * @return The hatch style 00053 * 00054 * @see SymbolType 00055 */ 00056 virtual SymbolType getHatchStyle() const = 0; 00057 00058 /** 00059 * Returns the fill state of the polygon 00060 * 00061 * @return True, is filled, false is not filled 00062 */ 00063 virtual bool isFilled() const = 0; 00064 00065 /** 00066 * Determines if this plot object resides at this point, most likely a mouse click 00067 * 00068 * @param point The location of the mouse click 00069 * @return True if the plot object is at this point. This check includes the center 00070 * if the object is filled, otherwise it only includes the outline. 00071 */ 00072 virtual bool hit(LocationType point) const = 0; 00073 00074 /** 00075 * Sets the polygon fill color 00076 * 00077 * @param fillColor The new color 00078 * 00079 * @notify This method will notify Subject::signalModified. 00080 */ 00081 virtual void setFillColor(const ColorType& fillColor) = 0; 00082 00083 /** 00084 * Sets the polygon fill style 00085 * 00086 * @param fillStyle The new fill style 00087 * 00088 * @notify This method will notify Subject::signalModified. 00089 */ 00090 virtual void setFillStyle(const FillStyle& fillStyle) = 0; 00091 00092 /** 00093 * Sets the polygon hatch style 00094 * 00095 * @param hatchStyle The new hatch sytle 00096 * 00097 * @notify This method will notify Subject::signalModified. 00098 */ 00099 virtual void setHatchStyle(const SymbolType& hatchStyle) = 0; 00100 00101 protected: 00102 /** 00103 * This should be destroyed by calling PlotView::deleteObject. 00104 */ 00105 virtual ~PolygonPlotObject() {} 00106 }; 00107 00108 #endif