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 GRAPHICELEMENT_H 00011 #define GRAPHICELEMENT_H 00012 00013 #include "DataElement.h" 00014 00015 class GraphicGroup; 00016 class RasterElement; 00017 00018 /** 00019 * GraphicElement is a model class used for vector-based graphical data. 00020 * 00021 * This subclass of Subject will notify upon the following conditions: 00022 * * Any graphic object within the element is modified. 00023 * * The geocentricity of the element is modified via setGeocentric(). 00024 * * Everything documented in DataElement. 00025 */ 00026 class GraphicElement : public DataElement 00027 { 00028 public: 00029 /** 00030 * Get the group which contains the all vector objects in the element. 00031 * 00032 * @return The associated GraphicGroup. 00033 */ 00034 virtual GraphicGroup *getGroup() = 0; 00035 00036 /** 00037 * Get the group which contains the all vector objects in the element. 00038 * 00039 * @return The associated GraphicGroup. 00040 */ 00041 virtual const GraphicGroup *getGroup() const = 0; 00042 00043 /** 00044 * Sets whether modifications made are interactive or programmatic. 00045 * 00046 * For efficiency, it is sometimes useful to prevent refreshes and updates 00047 * when a large amount of modifications are made to the layer. 00048 * 00049 * @param interactive 00050 * Determines whether to go into interactive or batch mode. If 00051 * a value of false is passed in, all refreshes are delayed until 00052 * the method is called again with a true value. 00053 * 00054 * @see getInteractive() 00055 */ 00056 virtual void setInteractive(bool interactive) = 0; 00057 00058 /** 00059 * Gets whether modifications made are interactive or programmatic. 00060 * 00061 * @return The current state of the interactive flag. 00062 * 00063 * @see setInteractive() 00064 */ 00065 virtual bool getInteractive() const = 0; 00066 00067 /** 00068 * Sets whether graphic objects within this graphic element are geocentric 00069 * in nature. 00070 * 00071 * This method obtains georeferencing information from the element's parent 00072 * and updates the bounding box locations of all graphic objects in the 00073 * element to include latitude/longitude coordinates in addition to pixel 00074 * coordinates. 00075 * 00076 * After calling this method GraphicObject::getLlCorner() and 00077 * GraphicObject::getUrCorner() will continue to return pixel coordinate 00078 * locations. 00079 * 00080 * @param geocentric 00081 * Whether the GraphicObjects are geocentric. 00082 * 00083 * @return Returns \c true if the operation succeeded; \c false otherwise. 00084 * The operation will fail if this element's parent is not a 00085 * georeferenced RasterElement. 00086 * 00087 * @notify This method will notify with Subject::signalModified() if the 00088 * graphic objects are successfully set as geocentric. 00089 * 00090 * @see getGeocentric() 00091 */ 00092 virtual bool setGeocentric(bool geocentric) = 0; 00093 00094 /** 00095 * Gets whether graphic objects within this graphic element are geocentric 00096 * in nature. 00097 * 00098 * @return Returns \c true if the graphic objects is this element are 00099 * geocentric; \c false otherwise. 00100 * 00101 * @see setGeocentric() 00102 */ 00103 virtual bool getGeocentric() const = 0; 00104 00105 protected: 00106 /** 00107 * This should be destroyed by calling ModelServices::destroyElement. 00108 */ 00109 virtual ~GraphicElement() {} 00110 }; 00111 00112 #endif