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 ARROW_H 00013 #define ARROW_H 00014 00015 #include "ColorType.h" 00016 #include "LocationType.h" 00017 #include "PlotObject.h" 00018 #include "TypesFile.h" 00019 00020 /** 00021 * A set of points connected by a line forming an arrow. 00022 * 00023 * This subclass of Subject will notify upon the following conditions: 00024 * - The following methods are called: setArrowStyle(), setBaseLocation(), 00025 * setTipLocation(), setLocation(). 00026 * - Everything else documented in PlotObject. 00027 * 00028 * @see PlotObject 00029 */ 00030 class Arrow : public PlotObject 00031 { 00032 public: 00033 /** 00034 * Returns the arrow style 00035 * 00036 * @return Returns the arrow style as an enumerated type 00037 */ 00038 virtual ArrowStyle getArrowStyle() const = 0; 00039 00040 /** 00041 * Returns the location of the beginning of the arrow 00042 * 00043 * @return LocationType 00044 */ 00045 virtual LocationType getBaseLocation() const = 0; 00046 00047 /** 00048 * Returns the location of the end of the arrow 00049 * 00050 * @return LocationType 00051 */ 00052 virtual LocationType getTipLocation() const = 0; 00053 00054 /** 00055 * Returns the color of the arrow 00056 * 00057 * @return A color object 00058 */ 00059 virtual ColorType getColor() const = 0; 00060 00061 /** 00062 * Determines if this plot object resides at this point, most likely a mouse click 00063 * 00064 * @param point The location of the mouse click 00065 * @return True if the plot object is at this point 00066 */ 00067 virtual bool hit(LocationType point) const = 0; 00068 00069 /** 00070 * Sets the objects arrow style 00071 * 00072 * @param eStyle The arrow style 00073 * 00074 * @notify This method will notify Subject::signalModified. 00075 */ 00076 virtual void setArrowStyle(const ArrowStyle& eStyle) = 0; 00077 00078 /** 00079 * Sets the location of the arrow, both beginning and ending 00080 * 00081 * @param baseLocation The beginning point 00082 * @param tipLocation The ending point 00083 * 00084 * @notify This method will notify Subject::signalModified. 00085 */ 00086 virtual void setLocation(const LocationType& baseLocation, const LocationType& tipLocation) = 0; 00087 00088 /** 00089 * Sets the beginning location of the arrow 00090 * 00091 * @param baseLocation 00092 * 00093 * @notify This method will notify Subject::signalModified. 00094 */ 00095 virtual void setBaseLocation(const LocationType& baseLocation) = 0; 00096 00097 /** 00098 * Sets the ending location of the arrow 00099 * 00100 * @param tipLocation 00101 * 00102 * @notify This method will notify Subject::signalModified. 00103 */ 00104 virtual void setTipLocation(const LocationType& tipLocation) = 0; 00105 00106 /** 00107 * Sets the color of the arrow 00108 * 00109 * @param newColor 00110 */ 00111 virtual void setColor(const ColorType& newColor) = 0; 00112 00113 protected: 00114 /** 00115 * This should be destroyed by calling PlotView::deleteObject. 00116 */ 00117 virtual ~Arrow() {} 00118 }; 00119 00120 #endif